diff options
| author | Owen Anderson <resistor@mac.com> | 2010-08-05 23:42:04 +0000 | 
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2010-08-05 23:42:04 +0000 | 
| commit | 755aceb5d0df842b5132052d474c361b5605aedb (patch) | |
| tree | db1a7ea8a289673ef5a82a05550f8546a6a029cb /llvm/lib/Transforms/Utils | |
| parent | ddb2d65c50884883fb329ad293d0ae2d6c1d6d3f (diff) | |
| download | bcm5719-llvm-755aceb5d0df842b5132052d474c361b5605aedb.tar.gz bcm5719-llvm-755aceb5d0df842b5132052d474c361b5605aedb.zip  | |
Don't use PassInfo* as a type identifier for passes.  Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.
llvm-svn: 110396
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/InstructionNamer.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/Mem2Reg.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/SSI.cpp | 2 | 
8 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp index baa114b099e..424d8785c1d 100644 --- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -36,7 +36,7 @@ STATISTIC(NumBroken, "Number of blocks inserted");  namespace {    struct BreakCriticalEdges : public FunctionPass {      static char ID; // Pass identification, replacement for typeid -    BreakCriticalEdges() : FunctionPass(&ID) {} +    BreakCriticalEdges() : FunctionPass(ID) {}      virtual bool runOnFunction(Function &F); @@ -57,7 +57,7 @@ static RegisterPass<BreakCriticalEdges>  X("break-crit-edges", "Break critical edges in CFG");  // Publically exposed interface to pass... -const PassInfo *const llvm::BreakCriticalEdgesID = &X; +char &llvm::BreakCriticalEdgesID = BreakCriticalEdges::ID;  FunctionPass *llvm::createBreakCriticalEdgesPass() {    return new BreakCriticalEdges();  } diff --git a/llvm/lib/Transforms/Utils/InstructionNamer.cpp b/llvm/lib/Transforms/Utils/InstructionNamer.cpp index 090af95c4b8..81a7101188e 100644 --- a/llvm/lib/Transforms/Utils/InstructionNamer.cpp +++ b/llvm/lib/Transforms/Utils/InstructionNamer.cpp @@ -23,7 +23,7 @@ using namespace llvm;  namespace {    struct InstNamer : public FunctionPass {      static char ID; // Pass identification, replacement for typeid -    InstNamer() : FunctionPass(&ID) {} +    InstNamer() : FunctionPass(ID) {}      void getAnalysisUsage(AnalysisUsage &Info) const {        Info.setPreservesAll(); @@ -53,7 +53,7 @@ namespace {  } -const PassInfo *const llvm::InstructionNamerID = &X; +char &llvm::InstructionNamerID = InstNamer::ID;  //===----------------------------------------------------------------------===//  //  // InstructionNamer - Give any unnamed non-void instructions "tmp" names. diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index d380e0dbc10..bf3695d2c83 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -47,7 +47,7 @@ STATISTIC(NumLCSSA, "Number of live out of a loop variables");  namespace {    struct LCSSA : public LoopPass {      static char ID; // Pass identification, replacement for typeid -    LCSSA() : LoopPass(&ID) {} +    LCSSA() : LoopPass(ID) {}      // Cached analysis information for the current function.      DominatorTree *DT; @@ -93,7 +93,7 @@ char LCSSA::ID = 0;  static RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");  Pass *llvm::createLCSSAPass() { return new LCSSA(); } -const PassInfo *const llvm::LCSSAID = &X; +char &llvm::LCSSAID = LCSSA::ID;  /// BlockDominatesAnExit - Return true if the specified block dominates at least diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 1571fe8f0b3..16902ff9150 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -65,7 +65,7 @@ STATISTIC(NumNested  , "Number of nested loops split out");  namespace {    struct LoopSimplify : public LoopPass {      static char ID; // Pass identification, replacement for typeid -    LoopSimplify() : LoopPass(&ID) {} +    LoopSimplify() : LoopPass(ID) {}      // AA - If we have an alias analysis object to update, this is it, otherwise      // this is null. @@ -110,7 +110,7 @@ static RegisterPass<LoopSimplify>  X("loopsimplify", "Canonicalize natural loops", true);  // Publically exposed interface to pass... -const PassInfo *const llvm::LoopSimplifyID = &X; +char &llvm::LoopSimplifyID = LoopSimplify::ID;  Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); }  /// runOnLoop - Run down all loops in the CFG (recursively, but we could do diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index 2696e6913f3..f239a9970d8 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -78,7 +78,7 @@ namespace {      static char ID; // Pass identification, replacement for typeid      explicit LowerInvoke(const TargetLowering *tli = NULL,                           bool useExpensiveEHSupport = ExpensiveEHSupport) -      : FunctionPass(&ID), useExpensiveEHSupport(useExpensiveEHSupport), +      : FunctionPass(ID), useExpensiveEHSupport(useExpensiveEHSupport),          TLI(tli) { }      bool doInitialization(Module &M);      bool runOnFunction(Function &F); @@ -103,7 +103,7 @@ char LowerInvoke::ID = 0;  static RegisterPass<LowerInvoke>  X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); -const PassInfo *const llvm::LowerInvokePassID = &X; +char &llvm::LowerInvokePassID = LowerInvoke::ID;  // Public Interface To the LowerInvoke pass.  FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index 468a5fe4c5e..1910fd9e520 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp @@ -34,7 +34,7 @@ namespace {    class LowerSwitch : public FunctionPass {    public:      static char ID; // Pass identification, replacement for typeid -    LowerSwitch() : FunctionPass(&ID) {}  +    LowerSwitch() : FunctionPass(ID) {}       virtual bool runOnFunction(Function &F); @@ -85,7 +85,7 @@ static RegisterPass<LowerSwitch>  X("lowerswitch", "Lower SwitchInst's to branches");  // Publically exposed interface to pass... -const PassInfo *const llvm::LowerSwitchID = &X; +char &llvm::LowerSwitchID = LowerSwitch::ID;  // createLowerSwitchPass - Interface to this file...  FunctionPass *llvm::createLowerSwitchPass() {    return new LowerSwitch(); diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp index 99203b66212..13dda65a6b0 100644 --- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp +++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp @@ -27,7 +27,7 @@ STATISTIC(NumPromoted, "Number of alloca's promoted");  namespace {    struct PromotePass : public FunctionPass {      static char ID; // Pass identification, replacement for typeid -    PromotePass() : FunctionPass(&ID) {} +    PromotePass() : FunctionPass(ID) {}      // runOnFunction - To run this pass, first we calculate the alloca      // instructions that are safe for promotion, then we promote each one. @@ -82,7 +82,7 @@ bool PromotePass::runOnFunction(Function &F) {  }  // Publically exposed interface to pass... -const PassInfo *const llvm::PromoteMemoryToRegisterID = &X; +char &llvm::PromoteMemoryToRegisterID = PromotePass::ID;  // createPromoteMemoryToRegister - Provide an entry point to create this pass.  //  FunctionPass *llvm::createPromoteMemoryToRegisterPass() { diff --git a/llvm/lib/Transforms/Utils/SSI.cpp b/llvm/lib/Transforms/Utils/SSI.cpp index 62a93e4e991..81523d3bdc8 100644 --- a/llvm/lib/Transforms/Utils/SSI.cpp +++ b/llvm/lib/Transforms/Utils/SSI.cpp @@ -399,7 +399,7 @@ INITIALIZE_PASS(SSI, "ssi",  namespace {    struct SSIEverything : public FunctionPass {      static char ID; // Pass identification, replacement for typeid -    SSIEverything() : FunctionPass(&ID) {} +    SSIEverything() : FunctionPass(ID) {}      bool runOnFunction(Function &F);  | 

