aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-13 00:00:25 +0000
committerDan Gohman <gohman@apple.com>2008-05-13 00:00:25 +0000
commit089efffd7d1ca0d10522ace38d36e0a67f4fac2d (patch)
tree9221560124d6ed762ef6e5bbda45f4038dacdeb0 /lib/VMCore
parent74d6faf5c9732e3a51e68c58b3fb7d3e9ff8bfb6 (diff)
downloadexternal_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.zip
external_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.tar.gz
external_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.tar.bz2
Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp4
-rw-r--r--lib/VMCore/PassManager.cpp4
-rw-r--r--lib/VMCore/Type.cpp3
-rw-r--r--lib/VMCore/Verifier.cpp14
4 files changed, 17 insertions, 8 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 974678b..b327a6a 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -1514,6 +1514,8 @@ void UndefValue::destroyConstant() {
//---- ConstantExpr::get() implementations...
//
+namespace {
+
struct ExprMapKeyType {
explicit ExprMapKeyType(unsigned opc, std::vector<Constant*> ops,
unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { }
@@ -1537,6 +1539,8 @@ struct ExprMapKeyType {
}
};
+}
+
namespace llvm {
template<>
struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index 3123794..add6529 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -360,10 +360,10 @@ public:
}
};
-static TimingInfo *TheTimeInfo;
-
} // End of anon namespace
+static TimingInfo *TheTimeInfo;
+
//===----------------------------------------------------------------------===//
// PMTopLevelManager implementation
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 6339912..d7fe2d1 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -550,6 +550,7 @@ void DerivedType::dropAllTypeUses() {
}
+namespace {
/// TypePromotionGraph and graph traits - this is designed to allow us to do
/// efficient SCC processing of type graphs. This is the exact same as
@@ -560,6 +561,8 @@ struct TypePromotionGraph {
TypePromotionGraph(Type *T) : Ty(T) {}
};
+}
+
namespace llvm {
template <> struct GraphTraits<TypePromotionGraph> {
typedef Type NodeType;
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index aec5974..4c6f9e0 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -92,11 +92,14 @@ namespace { // Anonymous namespace for class
return false;
}
};
+}
- char PreVerifier::ID = 0;
- RegisterPass<PreVerifier> PreVer("preverify", "Preliminary module verification");
- const PassInfo *PreVerifyID = PreVer.getPassInfo();
+char PreVerifier::ID = 0;
+static RegisterPass<PreVerifier>
+PreVer("preverify", "Preliminary module verification");
+static const PassInfo *PreVerifyID = PreVer.getPassInfo();
+namespace {
struct VISIBILITY_HIDDEN
Verifier : public FunctionPass, InstVisitor<Verifier> {
static char ID; // Pass ID, replacement for typeid
@@ -305,11 +308,10 @@ namespace { // Anonymous namespace for class
Broken = true;
}
};
-
- char Verifier::ID = 0;
- RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace
+char Verifier::ID = 0;
+static RegisterPass<Verifier> X("verify", "Module Verifier");
// Assert - We know that cond should be true, if not print an error message.
#define Assert(C, M) \