llvm.org GIT mirror llvm / 3898e47
Move some helpers from the global namespace into anonymous ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344468 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 11 months ago
5 changed file(s) with 17 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
651651 return N;
652652 }
653653
654 IntrinsicFunctionKind
654 static IntrinsicFunctionKind
655655 translateIntrinsicFunctionCode(char CH, FunctionIdentifierCodeGroup Group) {
656656 // Not all ? identifiers are intrinsics *functions*. This function only maps
657657 // operator codes for the special functions, all others are handled elsewhere,
12191219 outputHex(OS, C);
12201220 }
12211221
1222 unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) {
1222 static unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) {
12231223 const uint8_t *End = StringBytes + Length - 1;
12241224 unsigned Count = 0;
12251225 while (Length > 0 && *End == 0) {
12301230 return Count;
12311231 }
12321232
1233 unsigned countEmbeddedNulls(const uint8_t *StringBytes, unsigned Length) {
1233 static unsigned countEmbeddedNulls(const uint8_t *StringBytes,
1234 unsigned Length) {
12341235 unsigned Result = 0;
12351236 for (unsigned I = 0; I < Length; ++I) {
12361237 if (*StringBytes++ == 0)
12391240 return Result;
12401241 }
12411242
1242 unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
1243 unsigned NumBytes) {
1243 static unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
1244 unsigned NumBytes) {
12441245 assert(NumBytes > 0);
12451246
12461247 // If the number of bytes is odd, this is guaranteed to be a char string.
297297 return false;
298298 }
299299
300 CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT,
301 const ISD::ArgFlagsTy &Flags) {
300 static CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT,
301 const ISD::ArgFlagsTy &Flags) {
302302 // > does not mean loss of information as type RegisterVT can't hold type VT,
303303 // it means that type VT is split into multiple registers of type RegisterVT
304304 if (VT.getSizeInBits() >= RegisterVT.getSizeInBits())
311311 }
312312
313313 template
314 void setLocInfo(SmallVectorImpl &ArgLocs,
315 const SmallVectorImpl &Arguments) {
314 static void setLocInfo(SmallVectorImpl &ArgLocs,
315 const SmallVectorImpl &Arguments) {
316316 for (unsigned i = 0; i < ArgLocs.size(); ++i) {
317317 const CCValAssign &VA = ArgLocs[i];
318318 CCValAssign::LocInfo LocInfo = determineLocInfo(
5858 // possible search paths should be the same.
5959 // Returns nullptr in case it does not find any EH pad in the search, or finds
6060 // multiple different EH pads.
61 MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) {
61 static MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) {
6262 MachineFunction *MF = MI->getParent()->getParent();
6363 SmallVector WL;
6464 SmallPtrSet Visited;
8383 return new X86CondBrFoldingPass();
8484 }
8585
86 namespace {
8687 // A class the stores the auxiliary information for each MBB.
8788 struct TargetMBBInfo {
8889 MachineBasicBlock *TBB;
128129 return MBBInfos[MBB->getNumber()].get();
129130 }
130131 };
132 } // namespace
131133
132134 // Find a valid path that we can reuse the CondCode.
133135 // The resulted path (if return true) is stored in BranchPath.
620620 // CHRBiasThreshold, put Key into TrueSet and return true. If FalseProb >=
621621 // CHRBiasThreshold, put Key into FalseSet and return true. Otherwise, return
622622 // false.
623 template
624 bool checkBias(K *Key, BranchProbability TrueProb, BranchProbability FalseProb,
625 S &TrueSet, S &FalseSet, M &BiasMap) {
623 template
624 static bool checkBias(K *Key, BranchProbability TrueProb,
625 BranchProbability FalseProb, S &TrueSet, S &FalseSet,
626 M &BiasMap) {
626627 BranchProbability Threshold = getCHRBiasThreshold();
627628 if (TrueProb >= Threshold) {
628629 TrueSet.insert(Key);