summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-10-22 17:35:07 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-10-22 17:35:07 +0000
commit9192e7ab12f13953e94f41b6c8546bb7194ba057 (patch)
tree221b5db1efe623f6c920164e56fa1c451debbdeb /llvm/lib
parentac1a614079b7643acc39ace2b85f1b2e9c0918d3 (diff)
downloadbcm5719-llvm-9192e7ab12f13953e94f41b6c8546bb7194ba057.tar.gz
bcm5719-llvm-9192e7ab12f13953e94f41b6c8546bb7194ba057.zip
Make some symbols static, move classes into anonymous namespaces.
llvm-svn: 117111
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/RegionInfo.cpp2
-rw-r--r--llvm/lib/MC/MCDisassembler/EDOperand.cpp23
-rw-r--r--llvm/lib/Target/PTX/PTXISelLowering.cpp8
-rw-r--r--llvm/lib/VMCore/PassRegistry.cpp2
-rw-r--r--llvm/lib/VMCore/Verifier.cpp2
5 files changed, 19 insertions, 18 deletions
diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp
index 2622c8966cd..6725cfd28fa 100644
--- a/llvm/lib/Analysis/RegionInfo.cpp
+++ b/llvm/lib/Analysis/RegionInfo.cpp
@@ -45,7 +45,7 @@ STATISTIC(numSimpleRegions, "The # of simple regions");
/// PrintStyle - Print region in difference ways.
enum PrintStyle { PrintNone, PrintBB, PrintRN };
-cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
+static cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
cl::desc("style of printing regions"),
cl::values(
clEnumValN(PrintNone, "none", "print no details"),
diff --git a/llvm/lib/MC/MCDisassembler/EDOperand.cpp b/llvm/lib/MC/MCDisassembler/EDOperand.cpp
index 2aed123368d..cfeb56fa3df 100644
--- a/llvm/lib/MC/MCDisassembler/EDOperand.cpp
+++ b/llvm/lib/MC/MCDisassembler/EDOperand.cpp
@@ -260,23 +260,20 @@ int EDOperand::isMemory() {
}
#ifdef __BLOCKS__
-struct RegisterReaderWrapper {
- EDOperand::EDRegisterBlock_t regBlock;
-};
+namespace {
+ struct RegisterReaderWrapper {
+ EDOperand::EDRegisterBlock_t regBlock;
+ };
+}
-int readerWrapperCallback(uint64_t *value,
- unsigned regID,
- void *arg) {
- struct RegisterReaderWrapper *wrapper = (struct RegisterReaderWrapper *)arg;
+static int readerWrapperCallback(uint64_t *value, unsigned regID, void *arg) {
+ RegisterReaderWrapper *wrapper = (RegisterReaderWrapper *)arg;
return wrapper->regBlock(value, regID);
}
-int EDOperand::evaluate(uint64_t &result,
- EDRegisterBlock_t regBlock) {
- struct RegisterReaderWrapper wrapper;
+int EDOperand::evaluate(uint64_t &result, EDRegisterBlock_t regBlock) {
+ RegisterReaderWrapper wrapper;
wrapper.regBlock = regBlock;
- return evaluate(result,
- readerWrapperCallback,
- (void*)&wrapper);
+ return evaluate(result, readerWrapperCallback, (void*)&wrapper);
}
#endif
diff --git a/llvm/lib/Target/PTX/PTXISelLowering.cpp b/llvm/lib/Target/PTX/PTXISelLowering.cpp
index 6e68c376018..0ee4bf01ee7 100644
--- a/llvm/lib/Target/PTX/PTXISelLowering.cpp
+++ b/llvm/lib/Target/PTX/PTXISelLowering.cpp
@@ -44,7 +44,8 @@ const char *PTXTargetLowering::getTargetNodeName(unsigned Opcode) const {
// Calling Convention Implementation
//===----------------------------------------------------------------------===//
-static struct argmap_entry {
+namespace {
+struct argmap_entry {
MVT::SimpleValueType VT;
TargetRegisterClass *RC;
TargetRegisterClass::iterator loc;
@@ -52,12 +53,13 @@ static struct argmap_entry {
argmap_entry(MVT::SimpleValueType _VT, TargetRegisterClass *_RC)
: VT(_VT), RC(_RC), loc(_RC->begin()) {}
- void reset(void) { loc = RC->begin(); }
- bool operator==(MVT::SimpleValueType _VT) { return VT == _VT; }
+ void reset() { loc = RC->begin(); }
+ bool operator==(MVT::SimpleValueType _VT) const { return VT == _VT; }
} argmap[] = {
argmap_entry(MVT::i1, PTX::PredsRegisterClass),
argmap_entry(MVT::i32, PTX::RRegs32RegisterClass)
};
+} // end anonymous namespace
static SDValue lower_kernel_argument(int i,
SDValue Chain,
diff --git a/llvm/lib/VMCore/PassRegistry.cpp b/llvm/lib/VMCore/PassRegistry.cpp
index 95ca6814094..1fc26b0648d 100644
--- a/llvm/lib/VMCore/PassRegistry.cpp
+++ b/llvm/lib/VMCore/PassRegistry.cpp
@@ -40,6 +40,7 @@ static ManagedStatic<sys::SmartMutex<true> > Lock;
// PassRegistryImpl
//
+namespace {
struct PassRegistryImpl {
/// PassInfoMap - Keep track of the PassInfo object for each registered pass.
typedef DenseMap<const void*, const PassInfo*> MapType;
@@ -57,6 +58,7 @@ struct PassRegistryImpl {
std::vector<const PassInfo*> ToFree;
std::vector<PassRegistrationListener*> Listeners;
};
+} // end anonymous namespace
void *PassRegistry::getImpl() const {
if (!pImpl)
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index c779578b9b8..2b87619038c 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -106,7 +106,7 @@ namespace { // Anonymous namespace for class
char PreVerifier::ID = 0;
INITIALIZE_PASS(PreVerifier, "preverify", "Preliminary module verification",
false, false)
-char &PreVerifyID = PreVerifier::ID;
+static char &PreVerifyID = PreVerifier::ID;
namespace {
class TypeSet : public AbstractTypeUser {
OpenPOWER on IntegriCloud