diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-10-13 22:18:22 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-10-13 22:18:22 +0000 |
commit | c55e9975566ca2491d377a33f1ac497ef12571a3 (patch) | |
tree | 1474ecce883dbfa88a45d8d0bc6bfa75bd8fa3c5 /llvm | |
parent | 7899ccbcca9dd69ad21231a047c1e6130528937e (diff) | |
download | bcm5719-llvm-c55e9975566ca2491d377a33f1ac497ef12571a3.tar.gz bcm5719-llvm-c55e9975566ca2491d377a33f1ac497ef12571a3.zip |
Move some helpers from the global namespace into anonymous ones.
llvm-svn: 344468
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Demangle/MicrosoftDemangle.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsCallLowering.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86CondBrFolding.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp | 7 |
5 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index 9f60eb22cc4..59fb7c9ae9f 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -652,7 +652,7 @@ Demangler::demangleLiteralOperatorIdentifier(StringView &MangledName) { return N; } -IntrinsicFunctionKind +static IntrinsicFunctionKind translateIntrinsicFunctionCode(char CH, FunctionIdentifierCodeGroup Group) { // Not all ? identifiers are intrinsics *functions*. This function only maps // operator codes for the special functions, all others are handled elsewhere, @@ -1220,7 +1220,7 @@ static void outputEscapedChar(OutputStream &OS, unsigned C) { outputHex(OS, C); } -unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) { +static unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) { const uint8_t *End = StringBytes + Length - 1; unsigned Count = 0; while (Length > 0 && *End == 0) { @@ -1231,7 +1231,8 @@ unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) { return Count; } -unsigned countEmbeddedNulls(const uint8_t *StringBytes, unsigned Length) { +static unsigned countEmbeddedNulls(const uint8_t *StringBytes, + unsigned Length) { unsigned Result = 0; for (unsigned I = 0; I < Length; ++I) { if (*StringBytes++ == 0) @@ -1240,8 +1241,8 @@ unsigned countEmbeddedNulls(const uint8_t *StringBytes, unsigned Length) { return Result; } -unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars, - unsigned NumBytes) { +static unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars, + unsigned NumBytes) { assert(NumBytes > 0); // If the number of bytes is odd, this is guaranteed to be a char string. diff --git a/llvm/lib/Target/Mips/MipsCallLowering.cpp b/llvm/lib/Target/Mips/MipsCallLowering.cpp index 8babdbf902a..4d070f9f523 100644 --- a/llvm/lib/Target/Mips/MipsCallLowering.cpp +++ b/llvm/lib/Target/Mips/MipsCallLowering.cpp @@ -298,8 +298,8 @@ static bool isSupportedType(Type *T) { return false; } -CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT, - const ISD::ArgFlagsTy &Flags) { +static CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT, + const ISD::ArgFlagsTy &Flags) { // > does not mean loss of information as type RegisterVT can't hold type VT, // it means that type VT is split into multiple registers of type RegisterVT if (VT.getSizeInBits() >= RegisterVT.getSizeInBits()) @@ -312,8 +312,8 @@ CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT, } template <typename T> -void setLocInfo(SmallVectorImpl<CCValAssign> &ArgLocs, - const SmallVectorImpl<T> &Arguments) { +static void setLocInfo(SmallVectorImpl<CCValAssign> &ArgLocs, + const SmallVectorImpl<T> &Arguments) { for (unsigned i = 0; i < ArgLocs.size(); ++i) { const CCValAssign &VA = ArgLocs[i]; CCValAssign::LocInfo LocInfo = determineLocInfo( diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp index 936b801a9a0..98953f09482 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp @@ -59,7 +59,7 @@ FunctionPass *llvm::createWebAssemblyLateEHPrepare() { // possible search paths should be the same. // Returns nullptr in case it does not find any EH pad in the search, or finds // multiple different EH pads. -MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) { +static MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) { MachineFunction *MF = MI->getParent()->getParent(); SmallVector<MachineBasicBlock *, 2> WL; SmallPtrSet<MachineBasicBlock *, 2> Visited; diff --git a/llvm/lib/Target/X86/X86CondBrFolding.cpp b/llvm/lib/Target/X86/X86CondBrFolding.cpp index 8b9ef20d916..1d221930c2a 100644 --- a/llvm/lib/Target/X86/X86CondBrFolding.cpp +++ b/llvm/lib/Target/X86/X86CondBrFolding.cpp @@ -84,6 +84,7 @@ FunctionPass *llvm::createX86CondBrFolding() { return new X86CondBrFoldingPass(); } +namespace { // A class the stores the auxiliary information for each MBB. struct TargetMBBInfo { MachineBasicBlock *TBB; @@ -129,6 +130,7 @@ private: return MBBInfos[MBB->getNumber()].get(); } }; +} // namespace // Find a valid path that we can reuse the CondCode. // The resulted path (if return true) is stored in BranchPath. diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp index 2c0721f7366..8f4159d3d19 100644 --- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp +++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp @@ -621,9 +621,10 @@ static BranchProbability getCHRBiasThreshold() { // CHRBiasThreshold, put Key into TrueSet and return true. If FalseProb >= // CHRBiasThreshold, put Key into FalseSet and return true. Otherwise, return // false. -template<typename K, typename S, typename M> -bool checkBias(K *Key, BranchProbability TrueProb, BranchProbability FalseProb, - S &TrueSet, S &FalseSet, M &BiasMap) { +template <typename K, typename S, typename M> +static bool checkBias(K *Key, BranchProbability TrueProb, + BranchProbability FalseProb, S &TrueSet, S &FalseSet, + M &BiasMap) { BranchProbability Threshold = getCHRBiasThreshold(); if (TrueProb >= Threshold) { TrueSet.insert(Key); |