diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
commit | d0fde30ce850b78371fd1386338350591f9ff494 (patch) | |
tree | 83bb73e83f54fc8e1e474d116250ae2779562f7e /lib/Transforms/Scalar | |
parent | 0d723acf15b0326e2df09ecb614b02a617f536e4 (diff) | |
download | external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.zip external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.gz external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.bz2 |
Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/ADCE.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/ConstantProp.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/CorrelatedExprs.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/DCE.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 16 | ||||
-rw-r--r-- | lib/Transforms/Scalar/GCSE.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/PRE.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Scalar/PiNodeInsertion.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/Reassociate.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SimplifyCFG.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SymbolStripping.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/TailDuplication.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Scalar/TailRecursionElimination.cpp | 4 |
18 files changed, 82 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 2735f95..e45b273 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -28,6 +28,8 @@ #include "Support/STLExtras.h" #include <algorithm> +namespace llvm { + namespace { Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed"); Statistic<> NumInstRemoved ("adce", "Number of instructions removed"); @@ -456,3 +458,5 @@ bool ADCE::doADCE() { return MadeChanges; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index ceef34e..66e7896 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -27,6 +27,8 @@ #include "Support/Statistic.h" #include <set> +namespace llvm { + namespace { Statistic<> NumInstKilled("constprop", "Number of instructions killed"); @@ -73,3 +75,5 @@ bool ConstantPropagation::runOnFunction(Function &F) { } return Changed; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/CorrelatedExprs.cpp b/lib/Transforms/Scalar/CorrelatedExprs.cpp index aad9b7f..a0358b5 100644 --- a/lib/Transforms/Scalar/CorrelatedExprs.cpp +++ b/lib/Transforms/Scalar/CorrelatedExprs.cpp @@ -42,6 +42,8 @@ #include "Support/Statistic.h" #include <algorithm> +namespace llvm { + namespace { Statistic<> NumSetCCRemoved("cee", "Number of setcc instruction eliminated"); Statistic<> NumOperandsCann("cee", "Number of operands canonicalized"); @@ -1314,3 +1316,5 @@ void Relation::print(std::ostream &OS) const { void Relation::dump() const { print(std::cerr); } void ValueInfo::dump() const { print(std::cerr, 0); } void RegionInfo::dump() const { print(std::cerr); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index e3fc8de..3e63cad 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -24,6 +24,8 @@ #include "Support/Statistic.h" #include <set> +namespace llvm { + namespace { Statistic<> DIEEliminated("die", "Number of insts removed"); Statistic<> DCEEliminated("dce", "Number of insts removed"); @@ -57,7 +59,6 @@ Pass *createDeadInstEliminationPass() { } - //===----------------------------------------------------------------------===// // DeadCodeElimination pass implementation // @@ -124,3 +125,5 @@ bool DCE::runOnFunction(Function &F) { Pass *createDeadCodeEliminationPass() { return new DCE(); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index d6aee14..e110cda 100644 --- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -25,6 +25,8 @@ #include "llvm/Pass.h" #include "Support/Statistic.h" +namespace llvm { + namespace { Statistic<> NumAdded("lowerrefs", "# of getelementptr instructions added"); @@ -36,13 +38,6 @@ namespace { RegisterOpt<DecomposePass> X("lowerrefs", "Decompose multi-dimensional " "structure/array references"); -FunctionPass -*createDecomposeMultiDimRefsPass() -{ - return new DecomposePass(); -} - - // runOnBasicBlock - Entry point for array or structure references with multiple // indices. // @@ -57,6 +52,11 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB) return changed; } +FunctionPass +*createDecomposeMultiDimRefsPass() +{ + return new DecomposePass(); +} // Function: DecomposeArrayRef() // @@ -134,3 +134,5 @@ DecomposeArrayRef(GetElementPtrInst* GEP) return true; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index e1654e5..b00d300 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/lib/Transforms/Scalar/GCSE.cpp @@ -23,6 +23,8 @@ #include "Support/Statistic.h" #include <algorithm> +namespace llvm { + namespace { Statistic<> NumInstRemoved("gcse", "Number of instructions removed"); Statistic<> NumLoadRemoved("gcse", "Number of loads removed"); @@ -56,7 +58,6 @@ namespace { // createGCSEPass - The public interface to this file... FunctionPass *createGCSEPass() { return new GCSE(); } - // GCSE::runOnFunction - This is the main transformation entry point for a // function. // @@ -269,3 +270,5 @@ Instruction *GCSE::EliminateCSE(Instruction *I, Instruction *Other) { return Ret; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 1744fe4..0777a1e 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -26,6 +26,8 @@ #include "Support/Statistic.h" #include "Support/STLExtras.h" +namespace llvm { + namespace { Statistic<> NumRemoved ("indvars", "Number of aux indvars removed"); Statistic<> NumInserted("indvars", "Number of canonical indvars added"); @@ -217,3 +219,5 @@ namespace { Pass *createIndVarSimplifyPass() { return new InductionVariableSimplify(); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 07736b5..8522b61 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -49,6 +49,8 @@ #include "Support/Statistic.h" #include <algorithm> +namespace llvm { + namespace { Statistic<> NumCombined ("instcombine", "Number of insts combined"); Statistic<> NumConstProp("instcombine", "Number of constant folds"); @@ -2196,3 +2198,5 @@ bool InstCombiner::runOnFunction(Function &F) { Pass *createInstructionCombiningPass() { return new InstCombiner(); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 0f582c1..be635df 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -44,6 +44,8 @@ #include "llvm/Assembly/Writer.h" #include <algorithm> +namespace llvm { + namespace { cl::opt<bool> DisablePromotion("disable-licm-promotion", cl::Hidden, @@ -466,3 +468,5 @@ void LICM::findPromotableValuesInLoop( } } } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/PRE.cpp b/lib/Transforms/Scalar/PRE.cpp index fad5789..770cd44 100644 --- a/lib/Transforms/Scalar/PRE.cpp +++ b/lib/Transforms/Scalar/PRE.cpp @@ -36,10 +36,12 @@ #include "Support/Statistic.h" #include "Support/hash_set" +namespace llvm { + namespace { Statistic<> NumExprsEliminated("pre", "Number of expressions constantified"); Statistic<> NumRedundant ("pre", "Number of redundant exprs eliminated"); - Statistic<> NumInserted ("pre", "Number of expressions inserted"); + static Statistic<> NumInserted ("pre", "Number of expressions inserted"); struct PRE : public FunctionPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -630,3 +632,5 @@ bool PRE::ProcessExpression(Instruction *Expr) { return Changed; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/PiNodeInsertion.cpp b/lib/Transforms/Scalar/PiNodeInsertion.cpp index b5011af..89ec20e 100644 --- a/lib/Transforms/Scalar/PiNodeInsertion.cpp +++ b/lib/Transforms/Scalar/PiNodeInsertion.cpp @@ -42,6 +42,8 @@ #include "llvm/Support/CFG.h" #include "Support/Statistic.h" +namespace llvm { + namespace { Statistic<> NumInserted("pinodes", "Number of Pi nodes inserted"); @@ -182,3 +184,5 @@ bool PiNodeInserter::insertPiNodeFor(Value *V, BasicBlock *Succ, Value *Rep) { return true; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index befdcfe..9e22ec4 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -34,6 +34,8 @@ #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" +namespace llvm { + namespace { Statistic<> NumLinear ("reassociate","Number of insts linearized"); Statistic<> NumChanged("reassociate","Number of insts reassociated"); @@ -58,6 +60,7 @@ namespace { RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions"); } +// Public interface to the Reassociate pass FunctionPass *createReassociatePass() { return new Reassociate(); } void Reassociate::BuildRankMap(Function &F) { @@ -291,3 +294,5 @@ bool Reassociate::runOnFunction(Function &F) { ValueRankMap.clear(); return Changed; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 01e3e26..44a553a 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -33,6 +33,8 @@ #include <algorithm> #include <set> +namespace llvm { + // InstVal class - This class represents the different lattice values that an // instruction may occupy. It is a simple class with value semantics. // @@ -253,7 +255,6 @@ private: // createSCCPPass - This is the public interface to this file... -// Pass *createSCCPPass() { return new SCCP(); } @@ -585,3 +586,5 @@ void SCCP::visitGetElementPtrInst(GetElementPtrInst &I) { markConstant(&I, ConstantExpr::getGetElementPtr(Ptr, Operands)); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 9342a5c..d291190 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -32,6 +32,8 @@ #include "Support/Statistic.h" #include "Support/StringExtras.h" +namespace llvm { + namespace { Statistic<> NumReplaced("scalarrepl", "Number of allocas broken up"); Statistic<> NumPromoted("scalarrepl", "Number of allocas promoted"); @@ -61,6 +63,7 @@ namespace { RegisterOpt<SROA> X("scalarrepl", "Scalar Replacement of Aggregates"); } +// Public interface to the ScalarReplAggregates pass Pass *createScalarReplAggregatesPass() { return new SROA(); } @@ -298,3 +301,5 @@ bool SROA::isSafeAllocaToPromote(AllocationInst *AI) { } return true; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/SimplifyCFG.cpp b/lib/Transforms/Scalar/SimplifyCFG.cpp index 224d6c5..5a8d428 100644 --- a/lib/Transforms/Scalar/SimplifyCFG.cpp +++ b/lib/Transforms/Scalar/SimplifyCFG.cpp @@ -26,6 +26,8 @@ #include "Support/Statistic.h" #include <set> +namespace llvm { + namespace { Statistic<> NumSimpl("cfgsimplify", "Number of blocks simplified"); @@ -35,6 +37,7 @@ namespace { RegisterOpt<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG"); } +// Public interface to the CFGSimplification pass FunctionPass *createCFGSimplificationPass() { return new CFGSimplifyPass(); } @@ -100,3 +103,5 @@ bool CFGSimplifyPass::runOnFunction(Function &F) { return Changed; } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp index 58395c5..9e058e7 100644 --- a/lib/Transforms/Scalar/SymbolStripping.cpp +++ b/lib/Transforms/Scalar/SymbolStripping.cpp @@ -26,6 +26,8 @@ #include "llvm/SymbolTable.h" #include "llvm/Pass.h" +namespace llvm { + static bool StripSymbolTable(SymbolTable &SymTab) { bool RemovedSymbol = false; @@ -74,3 +76,5 @@ Pass *createSymbolStrippingPass() { Pass *createFullSymbolStrippingPass() { return new FullSymbolStripping(); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index d0a7765..07a3b1e 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -31,6 +31,8 @@ #include "Support/Debug.h" #include "Support/Statistic.h" +namespace llvm { + namespace { Statistic<> NumEliminated("tailduplicate", "Number of unconditional branches eliminated"); @@ -53,6 +55,7 @@ namespace { RegisterOpt<TailDup> X("tailduplicate", "Tail Duplication"); } +// Public interface to the Tail Duplication pass Pass *createTailDuplicationPass() { return new TailDup(); } /// runOnFunction - Top level algorithm - Loop over each unconditional branch in @@ -339,3 +342,5 @@ Value *TailDup::GetValueOutBlock(BasicBlock *BB, Value *OrigVal, return GetValueInBlock(BB, OrigVal, ValueMap, OutValueMap); } + +} // End llvm namespace diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index d07f4e8..dbe91a7 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -33,6 +33,8 @@ #include "llvm/Pass.h" #include "Support/Statistic.h" +namespace llvm { + namespace { Statistic<> NumEliminated("tailcallelim", "Number of tail calls removed"); @@ -42,6 +44,7 @@ namespace { RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination"); } +// Public interface to the TailCallElimination pass FunctionPass *createTailCallEliminationPass() { return new TailCallElim(); } @@ -105,3 +108,4 @@ bool TailCallElim::runOnFunction(Function &F) { return MadeChange; } +} // End llvm namespace |