1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Move some classes into anonymous namespaces. NFC.

llvm-svn: 353710
This commit is contained in:
Benjamin Kramer 2019-02-11 15:16:21 +00:00
parent 2775e932aa
commit f0a0f80db1
7 changed files with 14 additions and 4 deletions

View 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

View 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() {

View 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; }

View 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; }

View 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; }

View 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) {

View 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.