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

@@ -52,22 +52,24 @@ namespace {
AU.addRequired<LoopInfo>();
}
};
}
char LoopExtractor::ID = 0;
RegisterPass<LoopExtractor>
X("loop-extract", "Extract loops into new functions");
char LoopExtractor::ID = 0;
static RegisterPass<LoopExtractor>
X("loop-extract", "Extract loops into new functions");
namespace {
/// SingleLoopExtractor - For bugpoint.
struct SingleLoopExtractor : public LoopExtractor {
static char ID; // Pass identification, replacement for typeid
SingleLoopExtractor() : LoopExtractor(1) {}
};
char SingleLoopExtractor::ID = 0;
RegisterPass<SingleLoopExtractor>
Y("loop-extract-single", "Extract at most one loop into a new function");
} // End anonymous namespace
char SingleLoopExtractor::ID = 0;
static RegisterPass<SingleLoopExtractor>
Y("loop-extract-single", "Extract at most one loop into a new function");
// createLoopExtractorPass - This pass extracts all natural loops from the
// program into a function if it can.
//
@@ -146,14 +148,14 @@ FunctionPass *llvm::createSingleLoopExtractorPass() {
}
namespace {
// BlockFile - A file which contains a list of blocks that should not be
// extracted.
static cl::opt<std::string>
BlockFile("extract-blocks-file", cl::value_desc("filename"),
cl::desc("A file containing list of basic blocks to not extract"),
cl::Hidden);
// BlockFile - A file which contains a list of blocks that should not be
// extracted.
static cl::opt<std::string>
BlockFile("extract-blocks-file", cl::value_desc("filename"),
cl::desc("A file containing list of basic blocks to not extract"),
cl::Hidden);
namespace {
/// BlockExtractorPass - This pass is used by bugpoint to extract all blocks
/// from the module into their own functions except for those specified by the
/// BlocksToNotExtract list.
@@ -173,12 +175,12 @@ namespace {
bool runOnModule(Module &M);
};
char BlockExtractorPass::ID = 0;
RegisterPass<BlockExtractorPass>
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
}
char BlockExtractorPass::ID = 0;
static RegisterPass<BlockExtractorPass>
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
// createBlockExtractorPass - This pass extracts all blocks (except those
// specified in the argument list) from the functions in the module.
//