[llvm] r353710 - Move some classes into anonymous namespaces. NFC.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 07:16:22 PST 2019


Author: d0k
Date: Mon Feb 11 07:16:21 2019
New Revision: 353710

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

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Feb 11 07:16:21 2019
@@ -19404,10 +19404,12 @@ SDValue DAGCombiner::FindBetterChain(LSB
   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

Modified: llvm/trunk/lib/DebugInfo/CodeView/CodeViewError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/CodeViewError.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/CodeViewError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/CodeViewError.cpp Mon Feb 11 07:16:21 2019
@@ -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() {

Modified: llvm/trunk/lib/DebugInfo/MSF/MSFError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/MSFError.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/MSF/MSFError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/MSF/MSFError.cpp Mon Feb 11 07:16:21 2019
@@ -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; }

Modified: llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/GenericError.cpp Mon Feb 11 07:16:21 2019
@@ -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; }

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/RawError.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/RawError.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/RawError.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/RawError.cpp Mon Feb 11 07:16:21 2019
@@ -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; }

Modified: llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp Mon Feb 11 07:16:21 2019
@@ -179,9 +179,9 @@ getRegClassForTypeOnBank(LLT Ty, const R
 
 /// 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) {

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp?rev=353710&r1=353709&r2=353710&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp Mon Feb 11 07:16:21 2019
@@ -223,7 +223,7 @@ static Function *createWrapper(Function
 
 // 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.




More information about the llvm-commits mailing list