Move helper classes into anonymous namespaces. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269591 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2016-05-15 15:18:11 +00:00
parent 746e3cee24
commit 95ce0c789b
6 changed files with 10 additions and 2 deletions

View File

@ -37,6 +37,7 @@
#include <map>
using namespace llvm;
namespace {
/// These are manifest constants used by the bitcode writer. They do not need to
/// be kept in sync with the reader, but need to be consistent within this file.
enum {
@ -463,6 +464,7 @@ private:
}
std::map<GlobalValue::GUID, unsigned> &valueIds() { return GUIDToValueIdMap; }
};
} // end anonymous namespace
static unsigned getEncodedCastOpcode(unsigned Opcode) {
switch (Opcode) {

View File

@ -14,6 +14,7 @@
using namespace llvm;
using namespace llvm::pdb;
namespace {
class GenericErrorCategory : public std::error_category {
public:
const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb"; }
@ -33,6 +34,7 @@ public:
llvm_unreachable("Unrecognized generic_error_code");
}
};
} // end anonymous namespace
static ManagedStatic<GenericErrorCategory> Category;

View File

@ -5,6 +5,7 @@
using namespace llvm;
using namespace llvm::pdb;
namespace {
class RawErrorCategory : public std::error_category {
public:
const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb.raw"; }
@ -24,6 +25,7 @@ public:
llvm_unreachable("Unrecognized raw_error_code");
}
};
} // end anonymous namespace
static ManagedStatic<RawErrorCategory> Category;

View File

@ -589,7 +589,7 @@ bool AArch64ExpandPseudo::expandMOVImm(MachineBasicBlock &MBB,
return true;
}
void addPostLoopLiveIns(MachineBasicBlock *MBB, LivePhysRegs &LiveRegs) {
static void addPostLoopLiveIns(MachineBasicBlock *MBB, LivePhysRegs &LiveRegs) {
for (auto I = LiveRegs.begin(); I != LiveRegs.end(); ++I)
MBB->addLiveIn(*I);
}

View File

@ -144,6 +144,7 @@ ModulePass *llvm::createPGOIndirectCallPromotionLegacyPass(bool InLTO) {
return new PGOIndirectCallPromotionLegacyPass(InLTO);
}
namespace {
// The class for main data structure to promote indirect calls to conditional
// direct calls.
class ICallPromotionFunc {
@ -234,6 +235,7 @@ public:
}
bool processFunction();
};
} // end anonymous namespace
bool ICallPromotionFunc::isPromotionProfitable(uint64_t Count,
uint64_t TotalCount) {

View File

@ -100,7 +100,7 @@ static bool DCEInstruction(Instruction *I,
return false;
}
bool eliminateDeadCode(Function &F, TargetLibraryInfo *TLI) {
static bool eliminateDeadCode(Function &F, TargetLibraryInfo *TLI) {
bool MadeChange = false;
SmallSetVector<Instruction *, 16> WorkList;
// Iterate over the original function, only adding insts to the worklist