]> granicus.if.org Git - llvm/commitdiff
Move some classes into anonymous namespaces. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 11 Feb 2019 15:16:21 +0000 (15:16 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 11 Feb 2019 15:16:21 +0000 (15:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353710 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/DebugInfo/CodeView/CodeViewError.cpp
lib/DebugInfo/MSF/MSFError.cpp
lib/DebugInfo/PDB/GenericError.cpp
lib/DebugInfo/PDB/Native/RawError.cpp
lib/Target/AArch64/AArch64InstructionSelector.cpp
lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp

index d242d3c159a87218ab05233960bcc044dfb816a6..ee0d7fdd056ee2dbd6d54d88c014b2e53b6f4eb9 100644 (file)
@@ -19404,10 +19404,12 @@ SDValue DAGCombiner::FindBetterChain(LSBaseSDNode *N, SDValue OldChain) {
   return DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Aliases);
 }
 
+namespace {
 // TODO: Replace with with std::monostate when we move to C++17.
 struct UnitT { } Unit;
 bool operator==(const UnitT &, const UnitT &) { return true; }
 bool operator!=(const UnitT &, const UnitT &) { return false; }
+} // namespace
 
 // This function tries to collect a bunch of potentially interesting
 // nodes to improve the chains of, all at once. This might seem
index 277db2280719e3acc9ec82b96e142c08c460643a..69390c708f59901b4a0d23b5147dee78036a8652 100644 (file)
@@ -13,6 +13,7 @@
 using namespace llvm;
 using namespace llvm::codeview;
 
+namespace {
 // FIXME: This class is only here to support the transition to llvm::Error. It
 // will be removed once this transition is complete. Clients should prefer to
 // deal with the Error value directly, rather than converting to error_code.
@@ -38,6 +39,7 @@ public:
     llvm_unreachable("Unrecognized cv_error_code");
   }
 };
+} // namespace
 
 static llvm::ManagedStatic<CodeViewErrorCategory> CodeViewErrCategory;
 const std::error_category &llvm::codeview::CVErrorCategory() {
index 34bbc7f094bf9045d41aaaf17dfbe85b0a21f9a2..b368b802c5643a82a1d26cbb7887a97643f76186 100644 (file)
@@ -13,6 +13,7 @@
 using namespace llvm;
 using namespace llvm::msf;
 
+namespace {
 // FIXME: This class is only here to support the transition to llvm::Error. It
 // will be removed once this transition is complete. Clients should prefer to
 // deal with the Error value directly, rather than converting to error_code.
@@ -38,6 +39,7 @@ public:
     llvm_unreachable("Unrecognized msf_error_code");
   }
 };
+} // namespace
 
 static llvm::ManagedStatic<MSFErrorCategory> MSFCategory;
 const std::error_category &llvm::msf::MSFErrCategory() { return *MSFCategory; }
index 586f300e172302b4226ea91b3f844b57b0475c6f..70dc094c42ecf66103ed069c4112cb1ef4af5daf 100644 (file)
@@ -13,6 +13,7 @@
 using namespace llvm;
 using namespace llvm::pdb;
 
+namespace {
 // FIXME: This class is only here to support the transition to llvm::Error. It
 // will be removed once this transition is complete. Clients should prefer to
 // deal with the Error value directly, rather than converting to error_code.
@@ -39,6 +40,7 @@ public:
     llvm_unreachable("Unrecognized generic_error_code");
   }
 };
+} // namespace
 
 static llvm::ManagedStatic<PDBErrorCategory> PDBCategory;
 const std::error_category &llvm::pdb::PDBErrCategory() { return *PDBCategory; }
index dec9797088f23e3ba5ab9fb41865ba42c40e0392..ed6cf08396755a32da98777d664e81e819fd5514 100644 (file)
@@ -5,6 +5,7 @@
 using namespace llvm;
 using namespace llvm::pdb;
 
+namespace {
 // FIXME: This class is only here to support the transition to llvm::Error. It
 // will be removed once this transition is complete. Clients should prefer to
 // deal with the Error value directly, rather than converting to error_code.
@@ -44,6 +45,7 @@ public:
     llvm_unreachable("Unrecognized raw_error_code");
   }
 };
+} // namespace
 
 static llvm::ManagedStatic<RawErrorCategory> RawCategory;
 const std::error_category &llvm::pdb::RawErrCategory() { return *RawCategory; }
index 3ca599532a1e5dd0ed5ec2afc973c22217ceb434..e1352c366e8c1d4574f5eae0cd473dd69eb08aa3 100644 (file)
@@ -179,9 +179,9 @@ getRegClassForTypeOnBank(LLT Ty, const RegisterBank &RB,
 
 /// Given a register bank, and size in bits, return the smallest register class
 /// that can represent that combination.
-const TargetRegisterClass *getMinClassForRegBank(const RegisterBank &RB,
-                                                 unsigned SizeInBits,
-                                                 bool GetAllRegSet = false) {
+static const TargetRegisterClass *
+getMinClassForRegBank(const RegisterBank &RB, unsigned SizeInBits,
+                      bool GetAllRegSet = false) {
   unsigned RegBankID = RB.getID();
 
   if (RegBankID == AArch64::GPRRegBankID) {
index d059ef69915d2498f8c708d7f55b5d38678b2703..b7fc65401fc48594c3830bb863d7d790b0094a3a 100644 (file)
@@ -223,7 +223,7 @@ static Function *createWrapper(Function *F, FunctionType *Ty) {
 
 // Test whether a main function with type FuncTy should be rewritten to have
 // type MainTy.
-bool shouldFixMainFunction(FunctionType *FuncTy, FunctionType *MainTy) {
+static bool shouldFixMainFunction(FunctionType *FuncTy, FunctionType *MainTy) {
   // Only fix the main function if it's the standard zero-arg form. That way,
   // the standard cases will work as expected, and users will see signature
   // mismatches from the linker for non-standard cases.