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
This commit is contained in:
Dan Gohman
2008-05-13 00:00:25 +00:00
parent a334d5f535
commit 844731a7f1
124 changed files with 785 additions and 707 deletions

View File

@@ -89,14 +89,14 @@ STATISTIC(NumNodes , "Number of nodes");
STATISTIC(NumUnified , "Number of variables unified");
STATISTIC(NumErased , "Number of redundant constraints erased");
namespace {
const unsigned SelfRep = (unsigned)-1;
const unsigned Unvisited = (unsigned)-1;
// Position of the function return node relative to the function node.
const unsigned CallReturnPos = 1;
// Position of the function call node relative to the function node.
const unsigned CallFirstArgPos = 2;
static const unsigned SelfRep = (unsigned)-1;
static const unsigned Unvisited = (unsigned)-1;
// Position of the function return node relative to the function node.
static const unsigned CallReturnPos = 1;
// Position of the function call node relative to the function node.
static const unsigned CallFirstArgPos = 2;
namespace {
struct BitmapKeyInfo {
static inline SparseBitVector<> *getEmptyKey() {
return reinterpret_cast<SparseBitVector<> *>(-1);
@@ -608,17 +608,16 @@ namespace {
PrintPointsToGraph();
}
};
char Andersens::ID = 0;
RegisterPass<Andersens> X("anders-aa",
"Andersen's Interprocedural Alias Analysis", false,
true);
RegisterAnalysisGroup<AliasAnalysis> Y(X);
// Initialize Timestamp Counter (static).
unsigned Andersens::Node::Counter = 0;
}
char Andersens::ID = 0;
static RegisterPass<Andersens>
X("anders-aa", "Andersen's Interprocedural Alias Analysis", false, true);
static RegisterAnalysisGroup<AliasAnalysis> Y(X);
// Initialize Timestamp Counter (static).
unsigned Andersens::Node::Counter = 0;
ModulePass *llvm::createAndersensPass() { return new Andersens(); }
//===----------------------------------------------------------------------===//

View File

@@ -190,12 +190,13 @@ private:
}
};
RegisterAnalysisGroup<CallGraph> X("Call Graph");
RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction", false, true);
RegisterAnalysisGroup<CallGraph, true> Z(Y);
} //End anonymous namespace
static RegisterAnalysisGroup<CallGraph> X("Call Graph");
static RegisterPass<BasicCallGraph>
Y("basiccg", "Basic CallGraph Construction", false, true);
static RegisterAnalysisGroup<CallGraph, true> Z(Y);
char CallGraph::ID = 0;
char BasicCallGraph::ID = 0;

View File

@@ -27,6 +27,8 @@ using namespace llvm;
//
/// CGPassManager manages FPPassManagers and CalLGraphSCCPasses.
namespace {
class CGPassManager : public ModulePass, public PMDataManager {
public:
@@ -73,6 +75,8 @@ public:
}
};
}
char CGPassManager::ID = 0;
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.

View File

@@ -146,14 +146,13 @@ namespace {
GlobalValue *OkayStoreDest = 0);
bool AnalyzeIndirectGlobalMemory(GlobalValue *GV);
};
char GlobalsModRef::ID = 0;
RegisterPass<GlobalsModRef> X("globalsmodref-aa",
"Simple mod/ref analysis for globals", false,
true);
RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
char GlobalsModRef::ID = 0;
static RegisterPass<GlobalsModRef>
X("globalsmodref-aa", "Simple mod/ref analysis for globals", false, true);
static RegisterAnalysisGroup<AliasAnalysis> Y(X);
Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); }
/// getUnderlyingObject - This traverses the use chain to figure out what object