[llvm] r269591 - Move helper classes into anonymous namespaces. NFC.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sun May 15 08:18:13 PDT 2016


Author: d0k
Date: Sun May 15 10:18:11 2016
New Revision: 269591

URL: http://llvm.org/viewvc/llvm-project?rev=269591&view=rev
Log:
Move helper classes into anonymous namespaces. NFC.

Modified:
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
    llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp
    llvm/trunk/lib/DebugInfo/PDB/Raw/RawError.cpp
    llvm/trunk/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
    llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
    llvm/trunk/lib/Transforms/Scalar/DCE.cpp

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Sun May 15 10:18:11 2016
@@ -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) {

Modified: llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp Sun May 15 10:18:11 2016
@@ -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;
 

Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/RawError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/RawError.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/RawError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/RawError.cpp Sun May 15 10:18:11 2016
@@ -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;
 

Modified: llvm/trunk/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp Sun May 15 10:18:11 2016
@@ -589,7 +589,7 @@ bool AArch64ExpandPseudo::expandMOVImm(M
   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);
 }

Modified: llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp Sun May 15 10:18:11 2016
@@ -144,6 +144,7 @@ ModulePass *llvm::createPGOIndirectCallP
   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) {

Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=269591&r1=269590&r2=269591&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Sun May 15 10:18:11 2016
@@ -100,7 +100,7 @@ static bool DCEInstruction(Instruction *
   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




More information about the llvm-commits mailing list