diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
commit | 844731a7f1909f55935e3514c9e713a62d67662e (patch) | |
tree | 9221560124d6ed762ef6e5bbda45f4038dacdeb0 /lib/Transforms/Utils | |
parent | a334d5f5355be5c26ea2d3c28456722afd1a4559 (diff) | |
download | external_llvm-844731a7f1909f55935e3514c9e713a62d67662e.tar.gz external_llvm-844731a7f1909f55935e3514c9e713a62d67662e.tar.bz2 external_llvm-844731a7f1909f55935e3514c9e713a62d67662e.zip |
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/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/BasicInliner.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/BreakCriticalEdges.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerSwitch.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/Mem2Reg.cpp | 6 |
8 files changed, 29 insertions, 31 deletions
diff --git a/lib/Transforms/Utils/BasicInliner.cpp b/lib/Transforms/Utils/BasicInliner.cpp index a3f294d342..5c2c6989b7 100644 --- a/lib/Transforms/Utils/BasicInliner.cpp +++ b/lib/Transforms/Utils/BasicInliner.cpp @@ -26,11 +26,9 @@ using namespace llvm; -namespace { - static cl::opt<unsigned> - BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200), - cl::desc("Control the amount of basic inlining to perform (default = 200)")); -} +static cl::opt<unsigned> +BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200), + cl::desc("Control the amount of basic inlining to perform (default = 200)")); namespace llvm { diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index e230ca6830..4bf7bac4e2 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -48,12 +48,12 @@ namespace { AU.addPreservedID(LoopSimplifyID); } }; - - char BreakCriticalEdges::ID = 0; - RegisterPass<BreakCriticalEdges> X("break-crit-edges", - "Break critical edges in CFG"); } +char BreakCriticalEdges::ID = 0; +static RegisterPass<BreakCriticalEdges> +X("break-crit-edges", "Break critical edges in CFG"); + // Publically exposed interface to pass... const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo(); FunctionPass *llvm::createBreakCriticalEdgesPass() { diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 39314678bd..ff5f863645 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -94,10 +94,10 @@ namespace { return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B); } }; - - char LCSSA::ID = 0; - RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass"); } + +char LCSSA::ID = 0; +static RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass"); LoopPass *llvm::createLCSSAPass() { return new LCSSA(); } const PassInfo *llvm::LCSSAID = X.getPassInfo(); diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 8e30e04286..9351837aca 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -95,12 +95,12 @@ namespace { SmallVectorImpl<BasicBlock*> &SplitPreds, Loop *L); }; - - char LoopSimplify::ID = 0; - RegisterPass<LoopSimplify> - X("loopsimplify", "Canonicalize natural loops", true); } +char LoopSimplify::ID = 0; +static RegisterPass<LoopSimplify> +X("loopsimplify", "Canonicalize natural loops", true); + // Publically exposed interface to pass... const PassInfo *llvm::LoopSimplifyID = X.getPassInfo(); FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 8708f994fe..edce5e144c 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -66,12 +66,12 @@ namespace { /// bool runOnBasicBlock(BasicBlock &BB); }; - - char LowerAllocations::ID = 0; - RegisterPass<LowerAllocations> - X("lowerallocs", "Lower allocations from instructions to calls"); } +char LowerAllocations::ID = 0; +static RegisterPass<LowerAllocations> +X("lowerallocs", "Lower allocations from instructions to calls"); + // Publically exposed interface to pass... const PassInfo *llvm::LowerAllocationsID = X.getPassInfo(); // createLowerAllocationsPass - Interface to this file... diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 3d356b78ae..0530e52173 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -98,12 +98,12 @@ namespace { AllocaInst *InvokeNum, SwitchInst *CatchSwitch); bool insertExpensiveEHSupport(Function &F); }; - - char LowerInvoke::ID = 0; - RegisterPass<LowerInvoke> - X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } +char LowerInvoke::ID = 0; +static RegisterPass<LowerInvoke> +X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); + const PassInfo *llvm::LowerInvokePassID = X.getPassInfo(); // Public Interface To the LowerInvoke pass. diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index d75880f585..9ddb2cd1d9 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -77,12 +77,12 @@ namespace { return CI1->getValue().slt(CI2->getValue()); } }; - - char LowerSwitch::ID = 0; - RegisterPass<LowerSwitch> - X("lowerswitch", "Lower SwitchInst's to branches"); } +char LowerSwitch::ID = 0; +static RegisterPass<LowerSwitch> +X("lowerswitch", "Lower SwitchInst's to branches"); + // Publically exposed interface to pass... const PassInfo *llvm::LowerSwitchID = X.getPassInfo(); // createLowerSwitchPass - Interface to this file... diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp index f9b1d8d499..e402bb9357 100644 --- a/lib/Transforms/Utils/Mem2Reg.cpp +++ b/lib/Transforms/Utils/Mem2Reg.cpp @@ -48,11 +48,11 @@ namespace { AU.addPreservedID(LowerAllocationsID); } }; - - char PromotePass::ID = 0; - RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace +char PromotePass::ID = 0; +static RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register"); + bool PromotePass::runOnFunction(Function &F) { std::vector<AllocaInst*> Allocas; |