Reapply r110396, with fixes to appease the Linux buildbot gods.
authorOwen Anderson <resistor@mac.com>
Fri, 6 Aug 2010 18:33:48 +0000 (18:33 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 6 Aug 2010 18:33:48 +0000 (18:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8

213 files changed:
include/llvm/Analysis/DOTGraphTraitsPass.h
include/llvm/Analysis/Dominators.h
include/llvm/Analysis/FindUsedTypes.h
include/llvm/Analysis/IntervalPartition.h
include/llvm/Analysis/LazyValueInfo.h
include/llvm/Analysis/LibCallAliasAnalysis.h
include/llvm/Analysis/LoopDependenceAnalysis.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopPass.h
include/llvm/Analysis/Passes.h
include/llvm/Analysis/PostDominators.h
include/llvm/CallGraphSCCPass.h
include/llvm/CodeGen/CalcSpillWeights.h
include/llvm/CodeGen/LiveIntervalAnalysis.h
include/llvm/CodeGen/LiveStackAnalysis.h
include/llvm/CodeGen/LiveVariables.h
include/llvm/CodeGen/MachineFunctionPass.h
include/llvm/CodeGen/MachineLoopInfo.h
include/llvm/CodeGen/Passes.h
include/llvm/CodeGen/ProcessImplicitDefs.h
include/llvm/CodeGen/SlotIndexes.h
include/llvm/Pass.h
include/llvm/PassAnalysisSupport.h
include/llvm/PassManagers.h
include/llvm/PassRegistry.h
include/llvm/PassSupport.h
include/llvm/Target/TargetData.h
include/llvm/Transforms/IPO/InlinerPass.h
include/llvm/Transforms/Scalar.h
include/llvm/Transforms/Utils/SSI.h
include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
lib/Analysis/AliasAnalysisCounter.cpp
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/AliasDebugger.cpp
lib/Analysis/AliasSetTracker.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFGPrinter.cpp
lib/Analysis/DbgInfoPrinter.cpp
lib/Analysis/DomPrinter.cpp
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/IPA/CallGraphSCCPass.cpp
lib/Analysis/IPA/GlobalsModRef.cpp
lib/Analysis/IVUsers.cpp
lib/Analysis/InstCount.cpp
lib/Analysis/IntervalPartition.cpp
lib/Analysis/Lint.cpp
lib/Analysis/LiveValues.cpp
lib/Analysis/LoopPass.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/ModuleDebugInfoPrinter.cpp
lib/Analysis/PointerTracking.cpp
lib/Analysis/ProfileEstimatorPass.cpp
lib/Analysis/ProfileInfo.cpp
lib/Analysis/ProfileInfoLoaderPass.cpp
lib/Analysis/ProfileVerifierPass.cpp
lib/Analysis/RegionInfo.cpp
lib/Analysis/RegionPrinter.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
lib/Analysis/TypeBasedAliasAnalysis.cpp
lib/Bitcode/Writer/BitcodeWriterPass.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/BranchFolding.cpp
lib/CodeGen/CodePlacementOpt.cpp
lib/CodeGen/DeadMachineInstructionElim.cpp
lib/CodeGen/DwarfEHPrepare.cpp
lib/CodeGen/ELFWriter.cpp
lib/CodeGen/GCMetadata.cpp
lib/CodeGen/GCStrategy.cpp
lib/CodeGen/IfConversion.cpp
lib/CodeGen/LowerSubregs.cpp
lib/CodeGen/MachineCSE.cpp
lib/CodeGen/MachineDominators.cpp
lib/CodeGen/MachineFunctionAnalysis.cpp
lib/CodeGen/MachineFunctionPrinterPass.cpp
lib/CodeGen/MachineLICM.cpp
lib/CodeGen/MachineLoopInfo.cpp
lib/CodeGen/MachineModuleInfo.cpp
lib/CodeGen/MachineSink.cpp
lib/CodeGen/MachineVerifier.cpp
lib/CodeGen/OptimizeCmps.cpp
lib/CodeGen/OptimizeExts.cpp
lib/CodeGen/OptimizePHIs.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/PHIElimination.h
lib/CodeGen/PostRASchedulerList.cpp
lib/CodeGen/PreAllocSplitting.cpp
lib/CodeGen/PrologEpilogInserter.h
lib/CodeGen/RegAllocFast.cpp
lib/CodeGen/RegAllocLinearScan.cpp
lib/CodeGen/RegAllocPBQP.cpp
lib/CodeGen/RenderMachineFunction.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp
lib/CodeGen/SimpleRegisterCoalescing.h
lib/CodeGen/SjLjEHPrepare.cpp
lib/CodeGen/Splitter.h
lib/CodeGen/StackProtector.cpp
lib/CodeGen/StackSlotColoring.cpp
lib/CodeGen/StrongPHIElimination.cpp
lib/CodeGen/TailDuplication.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp
lib/CodeGen/UnreachableBlockElim.cpp
lib/CodeGen/VirtRegMap.h
lib/Target/ARM/ARMCodeEmitter.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/ARM/ARMGlobalMerge.cpp
lib/Target/ARM/ARMLoadStoreOptimizer.cpp
lib/Target/ARM/NEONMoveFix.cpp
lib/Target/ARM/NEONPreAllocPass.cpp
lib/Target/ARM/Thumb2ITBlockPass.cpp
lib/Target/ARM/Thumb2SizeReduction.cpp
lib/Target/Alpha/AlphaBranchSelector.cpp
lib/Target/Alpha/AlphaCodeEmitter.cpp
lib/Target/Alpha/AlphaLLRP.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CppBackend/CPPBackend.cpp
lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp
lib/Target/MSIL/MSILWriter.h
lib/Target/MSP430/MSP430BranchSelector.cpp
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/PIC16/PIC16MemSelOpt.cpp
lib/Target/PIC16/PIC16Passes/PIC16Cloner.h
lib/Target/PIC16/PIC16Passes/PIC16Overlay.h
lib/Target/PowerPC/PPCBranchSelector.cpp
lib/Target/PowerPC/PPCCodeEmitter.cpp
lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/Sparc/FPMover.cpp
lib/Target/TargetData.cpp
lib/Target/X86/SSEDomainFix.cpp
lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86FloatingPoint.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Transforms/Hello/Hello.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/IPO/DeadTypeElimination.cpp
lib/Transforms/IPO/ExtractGV.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/IPO/IPConstantPropagation.cpp
lib/Transforms/IPO/InlineAlways.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/LoopExtractor.cpp
lib/Transforms/IPO/LowerSetJmp.cpp
lib/Transforms/IPO/MergeFunctions.cpp
lib/Transforms/IPO/PartialInlining.cpp
lib/Transforms/IPO/PartialSpecialization.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/IPO/StripDeadPrototypes.cpp
lib/Transforms/IPO/StripSymbols.cpp
lib/Transforms/IPO/StructRetPromotion.cpp
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/Instrumentation/EdgeProfiling.cpp
lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
lib/Transforms/Scalar/ABCD.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/BasicBlockPlacement.cpp
lib/Transforms/Scalar/CodeGenPrepare.cpp
lib/Transforms/Scalar/ConstantProp.cpp
lib/Transforms/Scalar/DCE.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/GEPSplitter.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/JumpThreading.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopDeletion.cpp
lib/Transforms/Scalar/LoopIndexSplit.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Scalar/LowerAtomic.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/Reg2Mem.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp
lib/Transforms/Scalar/SimplifyLibCalls.cpp
lib/Transforms/Scalar/Sink.cpp
lib/Transforms/Scalar/TailDuplication.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/InstructionNamer.cpp
lib/Transforms/Utils/LCSSA.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LowerInvoke.cpp
lib/Transforms/Utils/LowerSwitch.cpp
lib/Transforms/Utils/Mem2Reg.cpp
lib/Transforms/Utils/SSI.cpp
lib/VMCore/Pass.cpp
lib/VMCore/PassManager.cpp
lib/VMCore/PassRegistry.cpp
lib/VMCore/PrintModulePass.cpp
lib/VMCore/Verifier.cpp
tools/bugpoint/ExtractFunction.cpp
tools/bugpoint/TestPasses.cpp
tools/bugpoint/bugpoint.cpp
tools/llvm-prof/llvm-prof.cpp
tools/opt/AnalysisWrappers.cpp
tools/opt/GraphPrinters.cpp
tools/opt/PrintSCC.cpp
tools/opt/opt.cpp
unittests/VMCore/PassManagerTest.cpp

index 4828eba5b5283f664d284d43ae53a8a9a9f0a502..d8daf5196fcaa5c506da29759339fe01b8963001 100644 (file)
@@ -22,7 +22,7 @@ template <class Analysis, bool Simple>
 struct DOTGraphTraitsViewer : public FunctionPass {
   std::string Name;
 
-  DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) {
+  DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) {
     Name = GraphName;
   }
 
@@ -48,7 +48,7 @@ struct DOTGraphTraitsPrinter : public FunctionPass {
 
   std::string Name;
 
-  DOTGraphTraitsPrinter(std::string GraphName, const void *ID)
+  DOTGraphTraitsPrinter(std::string GraphName, char &ID)
     : FunctionPass(ID) {
     Name = GraphName;
   }
index f79afdd1e9c959b026ed5168f0af7f933753aee6..73c6e6286b5b23bda1ccc15f02a4f7acee60914a 100644 (file)
@@ -702,7 +702,7 @@ public:
   static char ID; // Pass ID, replacement for typeid
   DominatorTreeBase<BasicBlock>* DT;
 
-  DominatorTree() : FunctionPass(&ID) {
+  DominatorTree() : FunctionPass(ID) {
     DT = new DominatorTreeBase<BasicBlock>(false);
   }
 
@@ -890,7 +890,7 @@ protected:
   const bool IsPostDominators;
 
 public:
-  DominanceFrontierBase(void *ID, bool isPostDom)
+  DominanceFrontierBase(char &ID, bool isPostDom)
     : FunctionPass(ID), IsPostDominators(isPostDom) {}
 
   /// getRoots - Return the root blocks of the current CFG.  This may include
@@ -1009,7 +1009,7 @@ class DominanceFrontier : public DominanceFrontierBase {
 public:
   static char ID; // Pass ID, replacement for typeid
   DominanceFrontier() :
-    DominanceFrontierBase(&ID, false) {}
+    DominanceFrontierBase(ID, false) {}
 
   BasicBlock *getRoot() const {
     assert(Roots.size() == 1 && "Should always have entry node!");
index 1337385848ed3e107d8c1951f283acfc19f7b9d3..8a78eb624973ae84330ccfa4dcac1c305ad98530 100644 (file)
@@ -26,7 +26,7 @@ class FindUsedTypes : public ModulePass {
   std::set<const Type *> UsedTypes;
 public:
   static char ID; // Pass identification, replacement for typeid
-  FindUsedTypes() : ModulePass(&ID) {}
+  FindUsedTypes() : ModulePass(ID) {}
 
   /// getTypes - After the pass has been run, return the set containing all of
   /// the types used in the module.
index c1214e7427a4a4b2a9205992d06e9a3374157482..75a5cdf1f99db7099664d5c1a60f0dd26c60dc4a 100644 (file)
@@ -48,7 +48,7 @@ class IntervalPartition : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  IntervalPartition() : FunctionPass(&ID), RootInterval(0) {}
+  IntervalPartition() : FunctionPass(ID), RootInterval(0) {}
 
   // run - Calculate the interval partition for this function
   virtual bool runOnFunction(Function &F);
index f59b2e353226d1795e83f17aaa176ece84c5016d..ac164c19c954f845bd2c4eecd2b12cbb4b3ea3e4 100644 (file)
@@ -31,7 +31,7 @@ class LazyValueInfo : public FunctionPass {
   void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT.
 public:
   static char ID;
-  LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
+  LazyValueInfo() : FunctionPass(ID), PImpl(0) {}
   ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); }
 
   /// Tristate - This is used to return true/false/dunno results.
index 37abb77dc2fadbe129cd6d05a8a94bd2684f7c1b..c9adf3f36ad74507b077735174f47ee503d40cce 100644 (file)
@@ -28,9 +28,9 @@ namespace llvm {
     LibCallInfo *LCI;
     
     explicit LibCallAliasAnalysis(LibCallInfo *LC = 0)
-      : FunctionPass(&ID), LCI(LC) {
+      : FunctionPass(ID), LCI(LC) {
     }
-    explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC)
+    explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC)
       : FunctionPass(ID), LCI(LC) {
     }
     ~LibCallAliasAnalysis();
@@ -55,8 +55,8 @@ namespace llvm {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(const void *PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index a1a563796f5a0ad8f91248acab31f603f90c5f7a..94fd9907090da437ece12f9d0f30b00e72876b2f 100644 (file)
@@ -91,7 +91,7 @@ class LoopDependenceAnalysis : public LoopPass {
 
 public:
   static char ID; // Class identification, replacement for typeinfo
-  LoopDependenceAnalysis() : LoopPass(&ID) {}
+  LoopDependenceAnalysis() : LoopPass(ID) {}
 
   /// isDependencePair - Check whether two values can possibly give rise to
   /// a data dependence: that is the case if both are instructions accessing
index 2e90a9631fb77efb962b908d01fe58e54d8595ca..462620f7e3cbb795d0514b173c54dca3d8d41207 100644 (file)
@@ -940,7 +940,7 @@ class LoopInfo : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  LoopInfo() : FunctionPass(&ID) {}
+  LoopInfo() : FunctionPass(ID) {}
 
   LoopInfoBase<BasicBlock, Loop>& getBase() { return LI; }
 
index 6f77d019b691898872adb9af7ab815407628bc5a..3e1c2a941802fa4b66c44842c0fe8e6608579f83 100644 (file)
@@ -28,8 +28,7 @@ class PMStack;
 
 class LoopPass : public Pass {
 public:
-  explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {}
-  explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {}
+  explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {}
 
   /// getPrinterPass - Get a pass to print the function corresponding
   /// to a Loop.
index e8e77960ad8fc3193bc279a5088b06df74767f7e..37425ebe8358841e2c57b872d42f3c4d539e95cc 100644 (file)
@@ -92,7 +92,7 @@ namespace llvm {
   // file.
   //
   ModulePass *createProfileLoaderPass();
-  extern const PassInfo *ProfileLoaderPassID;
+  extern char &ProfileLoaderPassID;
 
   //===--------------------------------------------------------------------===//
   //
@@ -106,7 +106,7 @@ namespace llvm {
   // instead of loading it from a previous run.
   //
   FunctionPass *createProfileEstimatorPass();
-  extern const PassInfo *ProfileEstimatorPassID;
+  extern char &ProfileEstimatorPassID;
 
   //===--------------------------------------------------------------------===//
   //
index 5552017d91800e384b4eb43efd2c445303673814..46ce8200f96632b06f239fcfd151b9eefe078934 100644 (file)
@@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass {
   static char ID; // Pass identification, replacement for typeid
   DominatorTreeBase<BasicBlock>* DT;
 
-  PostDominatorTree() : FunctionPass(&ID) {
+  PostDominatorTree() : FunctionPass(ID) {
     DT = new DominatorTreeBase<BasicBlock>(true);
   }
 
@@ -106,7 +106,7 @@ template <> struct GraphTraits<PostDominatorTree*>
 struct PostDominanceFrontier : public DominanceFrontierBase {
   static char ID;
   PostDominanceFrontier()
-    : DominanceFrontierBase(&ID, true) {}
+    : DominanceFrontierBase(ID, true) {}
 
   virtual bool runOnFunction(Function &) {
     Frontiers.clear();
index e11b9677c74af1b39d1d8a0895ff5694ba0a3c4d..5fa8b0e574a2676a627f82491be68117360a9952 100644 (file)
@@ -33,8 +33,7 @@ class CallGraphSCC;
   
 class CallGraphSCCPass : public Pass {
 public:
-  explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {}
-  explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {}
+  explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {}
 
   /// createPrinterPass - Get a pass that prints the Module
   /// corresponding to a CallGraph.
index 2fc03bd41de8fd5c24a39cc887e6c4877d4ee478..e5273c549778811a73d1a713e981a39c30903676 100644 (file)
@@ -23,7 +23,7 @@ namespace llvm {
   public:
     static char ID;
 
-    CalculateSpillWeights() : MachineFunctionPass(&ID) {}
+    CalculateSpillWeights() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;
 
index 8a59bf1428a0f9f6962b5334206847555a10dc12..b154bf1b0510488bb301d436c9b055e377149b61 100644 (file)
@@ -68,7 +68,7 @@ namespace llvm {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    LiveIntervals() : MachineFunctionPass(&ID) {}
+    LiveIntervals() : MachineFunctionPass(ID) {}
 
     // Calculate the spill weight to assign to a single instruction.
     static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth);
index c6af6a1f89ce5ebe4edbba337cc82fde6de60bb0..ad984db1899e14e075286425e418e5fe63989486 100644 (file)
@@ -39,7 +39,7 @@ namespace llvm {
     
   public:
     static char ID; // Pass identification, replacement for typeid
-    LiveStacks() : MachineFunctionPass(&ID) {}
+    LiveStacks() : MachineFunctionPass(ID) {}
 
     typedef SS2IntervalMap::iterator iterator;
     typedef SS2IntervalMap::const_iterator const_iterator;
index fc5ea6f968bd319f3cea108de1de21e305667e71..c8182e073b9c7eb27bfd132509794e733a7f9cd1 100644 (file)
@@ -46,7 +46,7 @@ class TargetRegisterInfo;
 class LiveVariables : public MachineFunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
-  LiveVariables() : MachineFunctionPass(&ID) {}
+  LiveVariables() : MachineFunctionPass(ID) {}
 
   /// VarInfo - This represents the regions where a virtual register is live in
   /// the program.  We represent this with three different pieces of
index 685e86824c31f66806882592dfaea46c3aea302f..b7bf0a36c44737064a98e20a45d2afee45cc870b 100644 (file)
@@ -31,8 +31,7 @@ class MachineFunction;
 /// override runOnMachineFunction.
 class MachineFunctionPass : public FunctionPass {
 protected:
-  explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
-  explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
+  explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {}
 
   /// runOnMachineFunction - This method must be overloaded to perform the
   /// desired machine code transformation or analysis.
index 3b3e31e02afa4ff73fde2dff1511de6db7140814..9760eba7b86e282d143b3646ea2a6724d053086b 100644 (file)
@@ -67,7 +67,7 @@ class MachineLoopInfo : public MachineFunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  MachineLoopInfo() : MachineFunctionPass(&ID) {}
+  MachineLoopInfo() : MachineFunctionPass(ID) {}
 
   LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; }
 
index 0fcdf7a691b602911251ba6ee78bf68eb85a911b..8e107ccac07a484ba97c648a0acd174d0cbc39c6 100644 (file)
@@ -43,18 +43,18 @@ namespace llvm {
 
   /// MachineLoopInfo pass - This pass is a loop analysis pass.
   /// 
-  extern const PassInfo *const MachineLoopInfoID;
+  extern char &MachineLoopInfoID;
 
   /// MachineDominators pass - This pass is a machine dominators analysis pass.
   /// 
-  extern const PassInfo *const MachineDominatorsID;
+  extern char &MachineDominatorsID;
 
   /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
   /// by inserting copy instructions.  This destroys SSA information, but is the
   /// desired input for some register allocators.  This pass is "required" by
   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
   ///
-  extern const PassInfo *const PHIEliminationID;
+  extern char &PHIEliminationID;
   
   /// StrongPHIElimination pass - This pass eliminates machine instruction PHI
   /// nodes by inserting copy instructions.  This destroys SSA information, but
@@ -62,23 +62,23 @@ namespace llvm {
   /// "required" by these register allocator like this:
   ///    AU.addRequiredID(PHIEliminationID);
   ///  This pass is still in development
-  extern const PassInfo *const StrongPHIEliminationID;
+  extern char &StrongPHIEliminationID;
 
-  extern const PassInfo *const PreAllocSplittingID;
+  extern char &PreAllocSplittingID;
 
   /// SimpleRegisterCoalescing pass.  Aggressively coalesces every register
   /// copy it can.
   ///
-  extern const PassInfo *const SimpleRegisterCoalescingID;
+  extern char &SimpleRegisterCoalescingID;
 
   /// TwoAddressInstruction pass - This pass reduces two-address instructions to
   /// use two operands. This destroys SSA information but it is desired by
   /// register allocators.
-  extern const PassInfo *const TwoAddressInstructionPassID;
+  extern char &TwoAddressInstructionPassID;
 
   /// UnreachableMachineBlockElimination pass - This pass removes unreachable
   /// machine basic blocks.
-  extern const PassInfo *const UnreachableMachineBlockElimID;
+  extern char &UnreachableMachineBlockElimID;
 
   /// DeadMachineInstructionElim pass - This pass removes dead machine
   /// instructions.
index 30477b9b80b8d447fcb6e6cf2e6c4c7407c5551d..1d743c1cba24e8523f760ecf200a03a8a52b8337 100644 (file)
@@ -31,7 +31,7 @@ namespace llvm {
   public:
     static char ID;
 
-    ProcessImplicitDefs() : MachineFunctionPass(&ID) {}
+    ProcessImplicitDefs() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;
 
index f150d853fc6e81640f06e35970a7e41f4cb08c6c..fe3b0e2d5fe2c47e703d8a1ed171c5e89e9af851 100644 (file)
@@ -475,7 +475,7 @@ namespace llvm {
   public:
     static char ID;
 
-    SlotIndexes() : MachineFunctionPass(&ID), indexListHead(0) {}
+    SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;
     virtual void releaseMemory(); 
index 5a5893140e050d4016b34c842657f071a27a7feb..e5c073cd9412e692739f71b5af5530adedac6434 100644 (file)
@@ -50,7 +50,7 @@ class raw_ostream;
 class StringRef;
 
 // AnalysisID - Use the PassInfo to identify a pass...
-typedef const PassInfo* AnalysisID;
+typedef const void* AnalysisID;
 
 /// Different types of internal pass managers. External pass managers
 /// (PassManager and FunctionPassManager) are not represented here.
@@ -82,14 +82,13 @@ enum PassKind {
 ///
 class Pass {
   AnalysisResolver *Resolver;  // Used to resolve analysis
-  intptr_t PassID;
+  const void *PassID;
   PassKind Kind;
   void operator=(const Pass&);  // DO NOT IMPLEMENT
   Pass(const Pass &);           // DO NOT IMPLEMENT
   
 public:
-  explicit Pass(PassKind K, intptr_t pid);
-  explicit Pass(PassKind K, const void *pid);
+  explicit Pass(PassKind K, char &pid);
   virtual ~Pass();
 
   
@@ -101,10 +100,10 @@ public:
   ///
   virtual const char *getPassName() const;
 
-  /// getPassInfo - Return the PassInfo data structure that corresponds to this
-  /// pass...  If the pass has not been registered, this will return null.
-  ///
-  const PassInfo *getPassInfo() const;
+  /// getPassID - Return the PassID number that corresponds to this pass.
+  virtual AnalysisID getPassID() const {
+    return PassID;
+  }
 
   /// print - Print out the internal state of the pass.  This is called by
   /// Analyze to print out the contents of an analysis.  Otherwise it is not
@@ -159,7 +158,7 @@ public:
   /// an analysis interface through multiple inheritance.  If needed, it should
   /// override this to adjust the this pointer as needed for the specified pass
   /// info.
-  virtual void *getAdjustedAnalysisPointer(const PassInfo *);
+  virtual void *getAdjustedAnalysisPointer(AnalysisID ID);
   virtual ImmutablePass *getAsImmutablePass();
   virtual PMDataManager *getAsPMDataManager();
   
@@ -170,14 +169,9 @@ public:
   // dumpPassStructure - Implement the -debug-passes=PassStructure option
   virtual void dumpPassStructure(unsigned Offset = 0);
 
-  template<typename AnalysisClass>
-  static const PassInfo *getClassPassInfo() {
-    return lookupPassInfo(intptr_t(&AnalysisClass::ID));
-  }
-
   // lookupPassInfo - Return the pass info object for the specified pass class,
   // or null if it is not known.
-  static const PassInfo *lookupPassInfo(intptr_t TI);
+  static const PassInfo *lookupPassInfo(const void *TI);
 
   // lookupPassInfo - Return the pass info object for the pass with the given
   // argument string, or null if it is not known.
@@ -200,7 +194,7 @@ public:
   /// don't have the class name available (use getAnalysisIfAvailable if you
   /// do), but it can tell you if you need to preserve the pass at least.
   ///
-  bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const;
+  bool mustPreserveAnalysisID(char &AID) const;
 
   /// getAnalysis<AnalysisType>() - This function is used by subclasses to get
   /// to the analysis information that they claim to use by overriding the
@@ -213,10 +207,10 @@ public:
   AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h
 
   template<typename AnalysisType>
-  AnalysisType &getAnalysisID(const PassInfo *PI) const;
+  AnalysisType &getAnalysisID(AnalysisID PI) const;
 
   template<typename AnalysisType>
-  AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
+  AnalysisType &getAnalysisID(AnalysisID PI, Function &F);
 };
 
 
@@ -240,8 +234,7 @@ public:
   ///  Return what kind of Pass Manager can manage this pass.
   virtual PassManagerType getPotentialPassManagerType() const;
 
-  explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {}
-  explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {}
+  explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
   // Force out-of-line virtual method.
   virtual ~ModulePass();
 };
@@ -268,8 +261,7 @@ public:
   ///
   bool runOnModule(Module &) { return false; }
 
-  explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
-  explicit ImmutablePass(const void *pid) 
+  explicit ImmutablePass(char &pid) 
   : ModulePass(pid) {}
   
   // Force out-of-line virtual method.
@@ -287,8 +279,7 @@ public:
 ///
 class FunctionPass : public Pass {
 public:
-  explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {}
-  explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {}
+  explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
 
   /// createPrinterPass - Get a function printer pass.
   Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
@@ -340,8 +331,7 @@ public:
 ///
 class BasicBlockPass : public Pass {
 public:
-  explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {}
-  explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {}
+  explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
 
   /// createPrinterPass - Get a function printer pass.
   Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
index 977d4f4e30d32894c5b8159f23f8259914cf566c..a99a1ae8711818bdd20dbcf4565823c24a0741a1 100644 (file)
@@ -49,34 +49,37 @@ public:
   // addRequired - Add the specified ID to the required set of the usage info
   // for a pass.
   //
-  AnalysisUsage &addRequiredID(AnalysisID ID);
+  AnalysisUsage &addRequiredID(const void *ID);
+  AnalysisUsage &addRequiredID(char &ID);
   template<class PassClass>
   AnalysisUsage &addRequired() {
-    return addRequiredID(Pass::getClassPassInfo<PassClass>());
+    return addRequiredID(PassClass::ID);
   }
 
-  AnalysisUsage &addRequiredTransitiveID(AnalysisID ID);
+  AnalysisUsage &addRequiredTransitiveID(char &ID);
   template<class PassClass>
   AnalysisUsage &addRequiredTransitive() {
-    AnalysisID ID = Pass::getClassPassInfo<PassClass>();
-    return addRequiredTransitiveID(ID);
+    return addRequiredTransitiveID(PassClass::ID);
   }
 
   // addPreserved - Add the specified ID to the set of analyses preserved by
   // this pass
   //
-  AnalysisUsage &addPreservedID(AnalysisID ID) {
+  AnalysisUsage &addPreservedID(const void *ID) {
     Preserved.push_back(ID);
     return *this;
   }
+  AnalysisUsage &addPreservedID(char &ID) {
+    Preserved.push_back(&ID);
+    return *this;
+  }
 
   // addPreserved - Add the specified Pass class to the set of analyses
   // preserved by this pass.
   //
   template<class PassClass>
   AnalysisUsage &addPreserved() {
-    assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
-    Preserved.push_back(Pass::getClassPassInfo<PassClass>());
+    Preserved.push_back(&PassClass::ID);
     return *this;
   }
 
@@ -85,12 +88,7 @@ public:
   // This can be useful when a pass is trivially preserved, but may not be
   // linked in. Be careful about spelling!
   //
-  AnalysisUsage &addPreserved(StringRef Arg) {
-    const PassInfo *PI = Pass::lookupPassInfo(Arg);
-    // If the pass exists, preserve it. Otherwise silently do nothing.
-    if (PI) Preserved.push_back(PI);
-    return *this;
-  }
+  AnalysisUsage &addPreserved(StringRef Arg);
 
   // setPreservesAll - Set by analyses that do not transform their input at all
   void setPreservesAll() { PreservesAll = true; }
@@ -130,7 +128,7 @@ public:
   inline PMDataManager &getPMDataManager() { return PM; }
 
   // Find pass that is implementing PI.
-  Pass *findImplPass(const PassInfo *PI) {
+  Pass *findImplPass(AnalysisID PI) {
     Pass *ResultPass = 0;
     for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
       if (AnalysisImpls[i].first == PI) {
@@ -142,10 +140,10 @@ public:
   }
 
   // Find pass that is implementing PI. Initialize pass for Function F.
-  Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F);
+  Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
 
-  void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
-    std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
+  void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
+    std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
     AnalysisImpls.push_back(pir);
   }
 
@@ -160,7 +158,7 @@ public:
 
   // AnalysisImpls - This keeps track of which passes implements the interfaces
   // that are required by the current pass (to implement getAnalysis()).
-  std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
+  std::vector<std::pair<AnalysisID, Pass*> > AnalysisImpls;
 
 private:
   // PassManager that is used to resolve analysis info
@@ -179,8 +177,7 @@ template<typename AnalysisType>
 AnalysisType *Pass::getAnalysisIfAvailable() const {
   assert(Resolver && "Pass not resident in a PassManager object!");
 
-  const PassInfo *PI = getClassPassInfo<AnalysisType>();
-  if (PI == 0) return 0;
+  const void *PI = &AnalysisType::ID;
 
   Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true);
   if (ResultPass == 0) return 0;
@@ -199,11 +196,11 @@ AnalysisType *Pass::getAnalysisIfAvailable() const {
 template<typename AnalysisType>
 AnalysisType &Pass::getAnalysis() const {
   assert(Resolver && "Pass has not been inserted into a PassManager object!");
-  return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
+  return getAnalysisID<AnalysisType>(&AnalysisType::ID);
 }
 
 template<typename AnalysisType>
-AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
+AnalysisType &Pass::getAnalysisID(AnalysisID PI) const {
   assert(PI && "getAnalysis for unregistered pass!");
   assert(Resolver&&"Pass has not been inserted into a PassManager object!");
   // PI *must* appear in AnalysisImpls.  Because the number of passes used
@@ -229,11 +226,11 @@ template<typename AnalysisType>
 AnalysisType &Pass::getAnalysis(Function &F) {
   assert(Resolver &&"Pass has not been inserted into a PassManager object!");
 
-  return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>(), F);
+  return getAnalysisID<AnalysisType>(&AnalysisType::ID, F);
 }
 
 template<typename AnalysisType>
-AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
+AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) {
   assert(PI && "getAnalysis for unregistered pass!");
   assert(Resolver && "Pass has not been inserted into a PassManager object!");
   // PI *must* appear in AnalysisImpls.  Because the number of passes used
index 81b7e7af816e4a1f32f957e7905f421f4fb0377b..1f9b9821d59f7d42fbe9a19cfa3666ce3a4848bb 100644 (file)
@@ -302,7 +302,7 @@ public:
   /// through getAnalysis interface.
   virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
 
-  virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F);
+  virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F);
 
   /// Initialize available analysis information.
   void initializeAnalysisInfo() { 
@@ -414,7 +414,7 @@ class FPPassManager : public ModulePass, public PMDataManager {
 public:
   static char ID;
   explicit FPPassManager(int Depth) 
-  : ModulePass(&ID), PMDataManager(Depth) { }
+  : ModulePass(ID), PMDataManager(Depth) { }
   
   /// 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.
index 193ecfd1b584d07668c4822e4a793e92d264eb2b..59071391520a29aaff2cf102d0865588b2f7c3d1 100644 (file)
@@ -34,7 +34,7 @@ class PassRegistry {
   mutable sys::SmartMutex<true> Lock;
   
   /// PassInfoMap - Keep track of the PassInfo object for each registered pass.
-  typedef std::map<intptr_t, const PassInfo*> MapType;
+  typedef std::map<const void*, const PassInfo*> MapType;
   MapType PassInfoMap;
   
   typedef StringMap<const PassInfo*> StringMapType;
@@ -51,14 +51,14 @@ class PassRegistry {
 public:
   static PassRegistry *getPassRegistry();
   
-  const PassInfo *getPassInfo(intptr_t TI) const;
+  const PassInfo *getPassInfo(const void *TI) const;
   const PassInfo *getPassInfo(StringRef Arg) const;
   
   void registerPass(const PassInfo &PI);
   void unregisterPass(const PassInfo &PI);
   
   /// Analysis Group Mechanisms.
-  void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID,
+  void registerAnalysisGroup(const void *InterfaceID, const void *PassID,
                              PassInfo& Registeree, bool isDefault);
   
   void enumerateWith(PassRegistrationListener *L);
index 07dc7f1d15cde7f349e048a1959085419b4ad240..ee987131726af7b20ce7eab5a96016f3b1803227 100644 (file)
@@ -41,7 +41,7 @@ public:
 private:
   const char      *const PassName;     // Nice name for Pass
   const char      *const PassArgument; // Command Line argument to run this pass
-  const intptr_t  PassID;      
+  const void *PassID;      
   const bool IsCFGOnlyPass;            // Pass only looks at the CFG.
   const bool IsAnalysis;               // True if an analysis pass.
   const bool IsAnalysisGroup;          // True if an analysis group.
@@ -52,7 +52,7 @@ private:
 public:
   /// PassInfo ctor - Do not call this directly, this should only be invoked
   /// through RegisterPass.
-  PassInfo(const char *name, const char *arg, intptr_t pi,
+  PassInfo(const char *name, const char *arg, const void *pi,
            NormalCtor_t normal = 0,
            bool isCFGOnly = false, bool is_analysis = false)
     : PassName(name), PassArgument(arg), PassID(pi), 
@@ -63,7 +63,7 @@ public:
   /// PassInfo ctor - Do not call this directly, this should only be invoked
   /// through RegisterPass. This version is for use by analysis groups; it
   /// does not auto-register the pass.
-  PassInfo(const char *name, intptr_t pi)
+  PassInfo(const char *name, const void *pi)
     : PassName(name), PassArgument(""), PassID(pi), 
       IsCFGOnlyPass(false), 
       IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) {
@@ -81,11 +81,11 @@ public:
 
   /// getTypeInfo - Return the id object for the pass...
   /// TODO : Rename
-  intptr_t getTypeInfo() const { return PassID; }
+  const void *getTypeInfo() const { return PassID; }
 
   /// Return true if this PassID implements the specified ID pointer.
-  bool isPassID(void *IDPtr) const {
-    return PassID == (intptr_t)IDPtr;
+  bool isPassID(const void *IDPtr) const {
+    return PassID == IDPtr;
   }
   
   /// isAnalysisGroup - Return true if this is an analysis group, not a normal
@@ -161,7 +161,7 @@ struct RegisterPass : public PassInfo {
   // Register Pass using default constructor...
   RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
                bool is_analysis = false)
-    : PassInfo(Name, PassArg, intptr_t(&passName::ID),
+    : PassInfo(Name, PassArg, &passName::ID,
                PassInfo::NormalCtor_t(callDefaultCtor<passName>),
                CFGOnly, is_analysis) {
     
@@ -191,8 +191,8 @@ struct RegisterPass : public PassInfo {
 class RegisterAGBase : public PassInfo {
 protected:
   RegisterAGBase(const char *Name,
-                 intptr_t InterfaceID,
-                 intptr_t PassID = 0,
+                 const void *InterfaceID,
+                 const void *PassID = 0,
                  bool isDefault = false);
 };
 
@@ -200,12 +200,12 @@ template<typename Interface, bool Default = false>
 struct RegisterAnalysisGroup : public RegisterAGBase {
   explicit RegisterAnalysisGroup(PassInfo &RPB)
     : RegisterAGBase(RPB.getPassName(),
-                     intptr_t(&Interface::ID), RPB.getTypeInfo(),
+                     &Interface::ID, RPB.getTypeInfo(),
                      Default) {
   }
 
   explicit RegisterAnalysisGroup(const char *Name)
-    : RegisterAGBase(Name, intptr_t(&Interface::ID)) {
+    : RegisterAGBase(Name, &Interface::ID) {
   }
 };
 
index cc88dae9fa689c2b5b778def250e78680bc4d2c6..f72461f803b2fa523669ba4afce2f794ba56a99c 100644 (file)
@@ -110,7 +110,7 @@ public:
   
   /// Constructs a TargetData from a specification string. See init().
   explicit TargetData(StringRef TargetDescription)
-    : ImmutablePass(&ID) {
+    : ImmutablePass(ID) {
     init(TargetDescription);
   }
 
@@ -118,7 +118,7 @@ public:
   explicit TargetData(const Module *M);
 
   TargetData(const TargetData &TD) :
-    ImmutablePass(&ID),
+    ImmutablePass(ID),
     LittleEndian(TD.isLittleEndian()),
     PointerMemSize(TD.PointerMemSize),
     PointerABIAlign(TD.PointerABIAlign),
index 6af7ed7bdbfcacbb8122a61c780717090c85037e..3ac4c591c94f5d280887cf95ce0fb41e9927d6c5 100644 (file)
@@ -30,8 +30,8 @@ namespace llvm {
 /// perform the inlining operations that do not depend on the policy.
 ///
 struct Inliner : public CallGraphSCCPass {
-  explicit Inliner(void *ID);
-  explicit Inliner(void *ID, int Threshold);
+  explicit Inliner(char &ID);
+  explicit Inliner(char &ID, int Threshold);
 
   /// getAnalysisUsage - For this class, we declare that we require and preserve
   /// the call graph.  If the derived class implements this method, it should
index 4d1d8636f612065bf83d237ab169c51e7e4563ba..bd5b16999f79523576c15a775e771a97dcbc9b83 100644 (file)
@@ -149,7 +149,7 @@ Pass *createLoopIndexSplitPass();
 //   ret i32 %Y
 //
 FunctionPass *createPromoteMemoryToRegisterPass();
-extern const PassInfo *const PromoteMemoryToRegisterID;
+extern char &PromoteMemoryToRegisterID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -158,7 +158,7 @@ extern const PassInfo *const PromoteMemoryToRegisterID;
 // hacking easier.
 //
 FunctionPass *createDemoteRegisterToMemoryPass();
-extern const PassInfo *const DemoteRegisterToMemoryID;
+extern char &DemoteRegisterToMemoryID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -202,7 +202,7 @@ FunctionPass *createCFGSimplificationPass();
 // (set, immediate dominators, tree, and frontier) information.
 //
 FunctionPass *createBreakCriticalEdgesPass();
-extern const PassInfo *const BreakCriticalEdgesID;
+extern char &BreakCriticalEdgesID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -213,7 +213,7 @@ extern const PassInfo *const BreakCriticalEdgesID;
 //   AU.addRequiredID(LoopSimplifyID);
 //
 Pass *createLoopSimplifyPass();
-extern const PassInfo *const LoopSimplifyID;
+extern char &LoopSimplifyID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -228,7 +228,7 @@ FunctionPass *createTailCallEliminationPass();
 // chained binary branch instructions.
 //
 FunctionPass *createLowerSwitchPass();
-extern const PassInfo *const LowerSwitchID;
+extern char &LowerSwitchID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -243,7 +243,7 @@ extern const PassInfo *const LowerSwitchID;
 FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0);
 FunctionPass *createLowerInvokePass(const TargetLowering *TLI,
                                     bool useExpensiveEHSupport);
-extern const PassInfo *const LowerInvokePassID;
+extern char &LowerInvokePassID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -258,7 +258,7 @@ FunctionPass *createBlockPlacementPass();
 // optimizations.
 //
 Pass *createLCSSAPass();
-extern const PassInfo *const LCSSAID;
+extern char &LCSSAID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -304,7 +304,7 @@ FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0);
 // InstructionNamer - Give any unnamed non-void instructions "tmp" names.
 //
 FunctionPass *createInstructionNamerPass();
-extern const PassInfo *const InstructionNamerID;
+extern char &InstructionNamerID;
   
 //===----------------------------------------------------------------------===//
 //
index 198fc827bb0b34ac079c44c3de897077af3139d6..864e1197a9ffef6f8f1b06dacb02c6d18f0d997c 100644 (file)
@@ -39,7 +39,7 @@ namespace llvm {
     public:
       static char ID; // Pass identification, replacement for typeid.
       SSI() :
-        FunctionPass(&ID) {
+        FunctionPass(ID) {
       }
 
       void getAnalysisUsage(AnalysisUsage &AU) const;
index c2d09935e76cff77f522e1e0f984f011afc88c4d..a5060e6f5860500b2ae7bdb948355b6f957a27a1 100644 (file)
@@ -26,7 +26,7 @@ struct UnifyFunctionExitNodes : public FunctionPass {
   BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
 public:
   static char ID; // Pass identification, replacement for typeid
-  UnifyFunctionExitNodes() : FunctionPass(&ID),
+  UnifyFunctionExitNodes() : FunctionPass(ID),
                              ReturnBlock(0), UnwindBlock(0) {}
 
   // We can preserve non-critical-edgeness when we unify function exit nodes
index 7631e3655f3d6b2c2b4f8570f99d7ba8a2d461b7..b17804186a63a341e06952e1f88ce1e27a1728bb 100644 (file)
@@ -34,7 +34,7 @@ namespace {
     Module *M;
   public:
     static char ID; // Class identification, replacement for typeinfo
-    AliasAnalysisCounter() : ModulePass(&ID) {
+    AliasAnalysisCounter() : ModulePass(ID) {
       No = May = Must = 0;
       NoMR = JustRef = JustMod = MR = 0;
     }
@@ -87,8 +87,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index 76a452e2e7daf09c5ff1b605d623533d28235a41..ce363cbc7bbd6140f41d669b434a6476c05d4695 100644 (file)
@@ -50,7 +50,7 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    AAEval() : FunctionPass(&ID) {}
+    AAEval() : FunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<AliasAnalysis>();
index 8209bb624a2dd011cd2e253270210cff397d1a11..b9fe64608c01c49323fa2b21b021f5d9007dd668 100644 (file)
@@ -39,7 +39,7 @@ namespace {
     
   public:
     static char ID; // Class identification, replacement for typeinfo
-    AliasDebugger() : ModulePass(&ID) {}
+    AliasDebugger() : ModulePass(ID) {}
 
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);                 // set up super class
@@ -83,8 +83,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index 7e11ce6360b0a4d366e85e495dd715ea432914fb..46d8ee6fab31944934894fdaf25185b90c5b2cee 100644 (file)
@@ -579,7 +579,7 @@ namespace {
     AliasSetTracker *Tracker;
   public:
     static char ID; // Pass identification, replacement for typeid
-    AliasSetPrinter() : FunctionPass(&ID) {}
+    AliasSetPrinter() : FunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index ec58a423521fafd4a7f9a8037879783074bf094e..27c24c7f711ef197c7264118d0d2fcd170135e60 100644 (file)
@@ -137,8 +137,8 @@ namespace {
   ///
   struct NoAA : public ImmutablePass, public AliasAnalysis {
     static char ID; // Class identification, replacement for typeinfo
-    NoAA() : ImmutablePass(&ID) {}
-    explicit NoAA(void *PID) : ImmutablePass(PID) { }
+    NoAA() : ImmutablePass(ID) {}
+    explicit NoAA(char &PID) : ImmutablePass(PID) { }
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     }
@@ -176,8 +176,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(const void *ID) {
+      if (ID == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
@@ -222,7 +222,7 @@ namespace {
   /// derives from the NoAA class.
   struct BasicAliasAnalysis : public NoAA {
     static char ID; // Class identification, replacement for typeinfo
-    BasicAliasAnalysis() : NoAA(&ID) {}
+    BasicAliasAnalysis() : NoAA(ID) {}
 
     virtual AliasResult alias(const Value *V1, unsigned V1Size,
                               const Value *V2, unsigned V2Size) {
@@ -259,8 +259,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(const void *ID) {
+      if (ID == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index da2f0a6dbf0c31917b78133476d10e188339f061..f28b2dc787d82048116557b885caca9aec2db36c 100644 (file)
@@ -25,7 +25,7 @@ using namespace llvm;
 namespace {
   struct CFGViewer : public FunctionPass {
     static char ID; // Pass identifcation, replacement for typeid
-    CFGViewer() : FunctionPass(&ID) {}
+    CFGViewer() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F) {
       F.viewCFG();
@@ -46,7 +46,7 @@ INITIALIZE_PASS(CFGViewer, "view-cfg", "View CFG of function", false, true);
 namespace {
   struct CFGOnlyViewer : public FunctionPass {
     static char ID; // Pass identifcation, replacement for typeid
-    CFGOnlyViewer() : FunctionPass(&ID) {}
+    CFGOnlyViewer() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F) {
       F.viewCFGOnly();
@@ -68,8 +68,8 @@ INITIALIZE_PASS(CFGOnlyViewer, "view-cfg-only",
 namespace {
   struct CFGPrinter : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    CFGPrinter() : FunctionPass(&ID) {}
-    explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
+    CFGPrinter() : FunctionPass(ID) {}
+    explicit CFGPrinter(char &pid) : FunctionPass(pid) {}
 
     virtual bool runOnFunction(Function &F) {
       std::string Filename = "cfg." + F.getNameStr() + ".dot";
@@ -101,8 +101,8 @@ P1("dot-cfg", "Print CFG of function to 'dot' file", false, true);
 namespace {
   struct CFGOnlyPrinter : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    CFGOnlyPrinter() : FunctionPass(&ID) {}
-    explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {}
+    CFGOnlyPrinter() : FunctionPass(ID) {}
+    explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {}
     virtual bool runOnFunction(Function &F) {
       std::string Filename = "cfg." + F.getNameStr() + ".dot";
       errs() << "Writing '" << Filename << "'...";
index aef79787715b9d05d4e63b24967cf8fe7c9bac0d..bdd9a26feacb19e8fabc4213959bb5bd6ca96865 100644 (file)
@@ -40,7 +40,7 @@ namespace {
     void printVariableDeclaration(const Value *V);
   public:
     static char ID; // Pass identification
-    PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {}
+    PrintDbgInfo() : FunctionPass(ID), Out(outs()) {}
 
     virtual bool runOnFunction(Function &F);
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
index 83e39f1e6fcb8191b3c9a2760b3ea7761a60792b..9f340942f2ccb6926938210728ee41d4c453c013 100644 (file)
@@ -86,27 +86,27 @@ namespace {
 struct DomViewer
   : public DOTGraphTraitsViewer<DominatorTree, false> {
   static char ID;
-  DomViewer() : DOTGraphTraitsViewer<DominatorTree, false>("dom", &ID){}
+  DomViewer() : DOTGraphTraitsViewer<DominatorTree, false>("dom", ID){}
 };
 
 struct DomOnlyViewer
   : public DOTGraphTraitsViewer<DominatorTree, true> {
   static char ID;
-  DomOnlyViewer() : DOTGraphTraitsViewer<DominatorTree, true>("domonly", &ID){}
+  DomOnlyViewer() : DOTGraphTraitsViewer<DominatorTree, true>("domonly", ID){}
 };
 
 struct PostDomViewer
   : public DOTGraphTraitsViewer<PostDominatorTree, false> {
   static char ID;
   PostDomViewer() :
-    DOTGraphTraitsViewer<PostDominatorTree, false>("postdom", &ID){}
+    DOTGraphTraitsViewer<PostDominatorTree, false>("postdom", ID){}
 };
 
 struct PostDomOnlyViewer
   : public DOTGraphTraitsViewer<PostDominatorTree, true> {
   static char ID;
   PostDomOnlyViewer() :
-    DOTGraphTraitsViewer<PostDominatorTree, true>("postdomonly", &ID){}
+    DOTGraphTraitsViewer<PostDominatorTree, true>("postdomonly", ID){}
 };
 } // end anonymous namespace
 
@@ -133,27 +133,27 @@ namespace {
 struct DomPrinter
   : public DOTGraphTraitsPrinter<DominatorTree, false> {
   static char ID;
-  DomPrinter() : DOTGraphTraitsPrinter<DominatorTree, false>("dom", &ID) {}
+  DomPrinter() : DOTGraphTraitsPrinter<DominatorTree, false>("dom", ID) {}
 };
 
 struct DomOnlyPrinter
   : public DOTGraphTraitsPrinter<DominatorTree, true> {
   static char ID;
-  DomOnlyPrinter() : DOTGraphTraitsPrinter<DominatorTree, true>("domonly", &ID) {}
+  DomOnlyPrinter() : DOTGraphTraitsPrinter<DominatorTree, true>("domonly", ID) {}
 };
 
 struct PostDomPrinter
   : public DOTGraphTraitsPrinter<PostDominatorTree, false> {
   static char ID;
   PostDomPrinter() :
-    DOTGraphTraitsPrinter<PostDominatorTree, false>("postdom", &ID) {}
+    DOTGraphTraitsPrinter<PostDominatorTree, false>("postdom", ID) {}
 };
 
 struct PostDomOnlyPrinter
   : public DOTGraphTraitsPrinter<PostDominatorTree, true> {
   static char ID;
   PostDomOnlyPrinter() :
-    DOTGraphTraitsPrinter<PostDominatorTree, true>("postdomonly", &ID) {}
+    DOTGraphTraitsPrinter<PostDominatorTree, true>("postdomonly", ID) {}
 };
 } // end anonymous namespace
 
index 1af0055ce541151460e43daf4e5c428d59e12055..b3635283fda58b1aa9a178d66b3ec1ce4c9511fd 100644 (file)
@@ -42,7 +42,7 @@ class BasicCallGraph : public ModulePass, public CallGraph {
 
 public:
   static char ID; // Class identification, replacement for typeinfo
-  BasicCallGraph() : ModulePass(&ID), Root(0), 
+  BasicCallGraph() : ModulePass(ID), Root(0), 
     ExternalCallingNode(0), CallsExternalNode(0) {}
 
   // runOnModule - Compute the call graph for the specified module.
@@ -86,8 +86,8 @@ public:
   /// an analysis interface through multiple inheritance.  If needed, it should
   /// override this to adjust the this pointer as needed for the specified pass
   /// info.
-  virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-    if (PI->isPassID(&CallGraph::ID))
+  virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+    if (PI == &CallGraph::ID)
       return (CallGraph*)this;
     return this;
   }
index 5c4b2c3a7933cc87c509b630ba4634ef87d7d200..b7a27cb288d92b564b457bec01a9c23c882c45db 100644 (file)
@@ -45,7 +45,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
 public:
   static char ID;
   explicit CGPassManager(int Depth) 
-    : ModulePass(&ID), PMDataManager(Depth) { }
+    : ModulePass(ID), PMDataManager(Depth) { }
 
   /// 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.
@@ -582,9 +582,9 @@ namespace {
     
   public:
     static char ID;
-    PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {}
+    PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {}
     PrintCallGraphPass(const std::string &B, raw_ostream &o)
-      : CallGraphSCCPass(&ID), Banner(B), Out(o) {}
+      : CallGraphSCCPass(ID), Banner(B), Out(o) {}
     
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index 769e4b177ec5412e1636b94a81d710ea75ffb3a1..43a61d0f60acd110eb9d1bab3caeb118b1928a50 100644 (file)
@@ -88,7 +88,7 @@ namespace {
 
   public:
     static char ID;
-    GlobalsModRef() : ModulePass(&ID) {}
+    GlobalsModRef() : ModulePass(ID) {}
 
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);                 // set up super class
@@ -150,8 +150,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index e2b67e8365e44efb8d42cf69487f17cf573ac050..bd43026015b7b97d1e5037b3d0b1f8fb73752ca2 100644 (file)
@@ -140,7 +140,7 @@ IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand) {
 }
 
 IVUsers::IVUsers()
- : LoopPass(&ID) {
+ : LoopPass(ID) {
 }
 
 void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const {
index 6133b8827b38b28707fb529ee562cb008acb1dfe..dcbcac005a2fc1c1a0bdbc214cd1993ac082725d 100644 (file)
@@ -51,7 +51,7 @@ namespace {
     }
   public:
     static char ID; // Pass identification, replacement for typeid
-    InstCount() : FunctionPass(&ID) {}
+    InstCount() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F);
 
index 0f11e34b600b2b765105eb8f9aa82ee82bc993c8..1c9e14884316b14a5622054a11913726801e2660 100644 (file)
@@ -91,7 +91,7 @@ bool IntervalPartition::runOnFunction(Function &F) {
 // distinguish it from a copy constructor.  Always pass in false for now.
 //
 IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
-  : FunctionPass(&ID) {
+  : FunctionPass(ID) {
   assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
 
   // Pass false to intervals_begin because we take ownership of it's memory
index fe01fd7b222987863265643a177e131cc8026f9a..a9d972435f5fb8bbcea035b8d3d586f3283127fa 100644 (file)
@@ -108,7 +108,7 @@ namespace {
     raw_string_ostream MessagesStr;
 
     static char ID; // Pass identification, replacement for typeid
-    Lint() : FunctionPass(&ID), MessagesStr(Messages) {}
+    Lint() : FunctionPass(ID), MessagesStr(Messages) {}
 
     virtual bool runOnFunction(Function &F);
 
index 3cc58c4feef6b3494006bf3182eab3d2af036e5e..0225f4fa254867b218e8b81d1d7d2f5ca7fa7c4e 100644 (file)
@@ -25,7 +25,7 @@ char LiveValues::ID = 0;
 INITIALIZE_PASS(LiveValues, "live-values",
                 "Value Liveness Analysis", false, true);
 
-LiveValues::LiveValues() : FunctionPass(&ID) {}
+LiveValues::LiveValues() : FunctionPass(ID) {}
 
 void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired<DominatorTree>();
index 2727d2f9465c13102724455a981e0b755465d56e..717e0169b78f5311bbe7467358fc06426e676860 100644 (file)
@@ -30,9 +30,9 @@ private:
 
 public:
   static char ID;
-  PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {}
+  PrintLoopPass() : LoopPass(ID), Out(dbgs()) {}
   PrintLoopPass(const std::string &B, raw_ostream &o)
-      : LoopPass(&ID), Banner(B), Out(o) {}
+      : LoopPass(ID), Banner(B), Out(o) {}
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
@@ -59,7 +59,7 @@ char PrintLoopPass::ID = 0;
 char LPPassManager::ID = 0;
 
 LPPassManager::LPPassManager(int Depth) 
-  : FunctionPass(&ID), PMDataManager(Depth) { 
+  : FunctionPass(ID), PMDataManager(Depth) { 
   skipThisLoop = false;
   redoThisLoop = false;
   LI = NULL;
index e003d643691231cce97f760b468cda724b96f0c4..d18d5ce0ea4cbcedb1dcc855643170a269082bd9 100644 (file)
@@ -50,7 +50,7 @@ INITIALIZE_PASS(MemoryDependenceAnalysis, "memdep",
                 "Memory Dependence Analysis", false, true);
 
 MemoryDependenceAnalysis::MemoryDependenceAnalysis()
-: FunctionPass(&ID), PredCache(0) {
+: FunctionPass(ID), PredCache(0) {
 }
 MemoryDependenceAnalysis::~MemoryDependenceAnalysis() {
 }
index cf8988a403cf0d3bfb45c3bd6f01867a13eab71a..2cc1c2aa005ca9e0af89e44147a9338bcd36da96 100644 (file)
@@ -30,7 +30,7 @@ namespace {
     DebugInfoFinder Finder;
   public:
     static char ID; // Pass identification, replacement for typeid
-    ModuleDebugInfoPrinter() : ModulePass(&ID) {}
+    ModuleDebugInfoPrinter() : ModulePass(ID) {}
 
     virtual bool runOnModule(Module &M);
 
index 03d3059fdbb63f918ddfd63f7b80a1ef3f9f08d7..07f46824700a8e0afb02717466fd067d6eb0c128 100644 (file)
@@ -28,7 +28,7 @@
 using namespace llvm;
 
 char PointerTracking::ID = 0;
-PointerTracking::PointerTracking() : FunctionPass(&ID) {}
+PointerTracking::PointerTracking() : FunctionPass(ID) {}
 
 bool PointerTracking::runOnFunction(Function &F) {
   predCache.clear();
index da4ce47692624b0eea0d36e8514e6982407e2ca4..062461a87cb0df38c42f2b38c25a5d5c57f08cac 100644 (file)
@@ -39,7 +39,7 @@ namespace {
   public:
     static char ID; // Class identification, replacement for typeinfo
     explicit ProfileEstimatorPass(const double execcount = 0)
-      : FunctionPass(&ID), ExecCount(execcount) {
+      : FunctionPass(ID), ExecCount(execcount) {
       if (execcount == 0) ExecCount = LoopWeight;
     }
 
@@ -59,8 +59,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&ProfileInfo::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &ProfileInfo::ID)
         return (ProfileInfo*)this;
       return this;
     }
@@ -78,7 +78,7 @@ X("profile-estimator", "Estimate profiling information", false, true);
 static RegisterAnalysisGroup<ProfileInfo> Y(X);
 
 namespace llvm {
-  const PassInfo *ProfileEstimatorPassID = &X;
+  char &ProfileEstimatorPassID = ProfileEstimatorPass::ID;
 
   FunctionPass *createProfileEstimatorPass() {
     return new ProfileEstimatorPass();
index eb33e78af7800417238f477728a017c3147fc9b7..fc7f28662c017b1670d5a42895730da815832389 100644 (file)
@@ -1076,14 +1076,14 @@ raw_ostream& operator<<(raw_ostream &O, std::pair<const MachineBasicBlock *, con
 namespace {
   struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
     static char ID; // Class identification, replacement for typeinfo
-    NoProfileInfo() : ImmutablePass(&ID) {}
+    NoProfileInfo() : ImmutablePass(ID) {}
     
     /// getAdjustedAnalysisPointer - This method is used when a pass implements
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&ProfileInfo::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &ProfileInfo::ID)
         return (ProfileInfo*)this;
       return this;
     }
index 8ea4ecf54f98f6a8510b55e670afcd50ad63aa4f..b6434e72340426686e7fdf58fce4434cc3d0ed09 100644 (file)
@@ -45,7 +45,7 @@ namespace {
   public:
     static char ID; // Class identification, replacement for typeinfo
     explicit LoaderPass(const std::string &filename = "")
-      : ModulePass(&ID), Filename(filename) {
+      : ModulePass(ID), Filename(filename) {
       if (filename.empty()) Filename = ProfileInfoFilename;
     }
 
@@ -67,8 +67,8 @@ namespace {
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&ProfileInfo::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &ProfileInfo::ID)
         return (ProfileInfo*)this;
       return this;
     }
@@ -84,7 +84,7 @@ X("profile-loader", "Load profile information from llvmprof.out", false, true);
 
 static RegisterAnalysisGroup<ProfileInfo> Y(X);
 
-const PassInfo *llvm::ProfileLoaderPassID = &X;
+char &llvm::ProfileLoaderPassID = LoaderPass::ID;
 
 ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
 
index dc1f28a95aee9a741bd272789e3f79628e61d66b..3f01b2d592bc4205604d1d6402f3c66df5d2d6b3 100644 (file)
@@ -59,10 +59,10 @@ namespace llvm {
   public:
     static char ID; // Class identification, replacement for typeinfo
 
-    explicit ProfileVerifierPassT () : FunctionPass(&ID) {
+    explicit ProfileVerifierPassT () : FunctionPass(ID) {
       DisableAssertions = ProfileVerifierDisableAssertions;
     }
-    explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID), 
+    explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), 
                                               DisableAssertions(da) {
     }
 
index 5c9985223162041907131fa90b109094fa4e8989..27cee76e081cf47ec975eaded15a2d472f9426ea 100644 (file)
@@ -589,7 +589,7 @@ void RegionInfo::releaseMemory() {
   TopLevelRegion = 0;
 }
 
-RegionInfo::RegionInfo() : FunctionPass(&ID) {
+RegionInfo::RegionInfo() : FunctionPass(ID) {
   TopLevelRegion = 0;
 }
 
index 67ce05a52f3a27ed38a698055dff11c97a0afc3f..fee5c1bae97646fbbea01a5c4437b5b9a751c112 100644 (file)
@@ -121,7 +121,7 @@ namespace {
 struct RegionViewer
   : public DOTGraphTraitsViewer<RegionInfo, false> {
   static char ID;
-  RegionViewer() : DOTGraphTraitsViewer<RegionInfo, false>("reg", &ID){}
+  RegionViewer() : DOTGraphTraitsViewer<RegionInfo, false>("reg", ID){}
 };
 
 char RegionViewer::ID = 0;
@@ -131,7 +131,7 @@ INITIALIZE_PASS(RegionViewer, "view-regions", "View regions of function",
 struct RegionOnlyViewer
   : public DOTGraphTraitsViewer<RegionInfo, true> {
   static char ID;
-  RegionOnlyViewer() : DOTGraphTraitsViewer<RegionInfo, true>("regonly", &ID){}
+  RegionOnlyViewer() : DOTGraphTraitsViewer<RegionInfo, true>("regonly", ID){}
 };
 
 char RegionOnlyViewer::ID = 0;
@@ -143,7 +143,7 @@ struct RegionPrinter
   : public DOTGraphTraitsPrinter<RegionInfo, false> {
   static char ID;
   RegionPrinter() :
-    DOTGraphTraitsPrinter<RegionInfo, false>("reg", &ID) {}
+    DOTGraphTraitsPrinter<RegionInfo, false>("reg", ID) {}
 };
 } //end anonymous namespace
 
@@ -157,7 +157,7 @@ struct RegionOnlyPrinter
   : public DOTGraphTraitsPrinter<RegionInfo, true> {
   static char ID;
   RegionOnlyPrinter() :
-    DOTGraphTraitsPrinter<RegionInfo, true>("reg", &ID) {}
+    DOTGraphTraitsPrinter<RegionInfo, true>("reg", ID) {}
 };
 
 }
index 9aaafafe052342a5b09a265b2cb8eeb72a8227b5..fb5acb91aee0a21d172a8618cdc62c26ca890697 100644 (file)
@@ -5742,7 +5742,7 @@ ScalarEvolution::SCEVCallbackVH::SCEVCallbackVH(Value *V, ScalarEvolution *se)
 //===----------------------------------------------------------------------===//
 
 ScalarEvolution::ScalarEvolution()
-  : FunctionPass(&ID), FirstUnknown(0) {
+  : FunctionPass(ID), FirstUnknown(0) {
 }
 
 bool ScalarEvolution::runOnFunction(Function &F) {
index 91ae98919d40acdaa0b04a3bdd33a3c9d5333d9d..93b2a8b06fbe9a8a8d8df7ff3a02ffb28e9f85c5 100644 (file)
@@ -34,14 +34,14 @@ namespace {
 
   public:
     static char ID; // Class identification, replacement for typeinfo
-    ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {}
+    ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {}
 
     /// getAdjustedAnalysisPointer - This method is used when a pass implements
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index 3e71f226a051d3ec888144f370dde4d58d79dd7e..bbfdcec3f9b4b76ca09d3bdd2ffaa889b59dc688 100644 (file)
@@ -82,14 +82,14 @@ namespace {
                                  public AliasAnalysis {
   public:
     static char ID; // Class identification, replacement for typeinfo
-    TypeBasedAliasAnalysis() : ImmutablePass(&ID) {}
+    TypeBasedAliasAnalysis() : ImmutablePass(ID) {}
 
     /// getAdjustedAnalysisPointer - This method is used when a pass implements
     /// an analysis interface through multiple inheritance.  If needed, it
     /// should override this to adjust the this pointer as needed for the
     /// specified pass info.
-    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
-      if (PI->isPassID(&AliasAnalysis::ID))
+    virtual void *getAdjustedAnalysisPointer(const void *PI) {
+      if (PI == &AliasAnalysis::ID)
         return (AliasAnalysis*)this;
       return this;
     }
index 3a0d3ce0be994066dbf8e834cd2d52e9df834349..91e115cba6cc44915a9edbaa904ce77af50cdaf0 100644 (file)
@@ -21,7 +21,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit WriteBitcodePass(raw_ostream &o)
-      : ModulePass(&ID), OS(o) {}
+      : ModulePass(ID), OS(o) {}
     
     const char *getPassName() const { return "Bitcode Writer"; }
     
index 1ba63100956a35a2263963ae5c05df0252908ea7..6e2098d6f5433bd9e3481396e6ad0b0b1c8382d7 100644 (file)
@@ -91,7 +91,7 @@ static unsigned getGVAlignmentLog2(const GlobalValue *GV, const TargetData &TD,
 
 
 AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer)
-  : MachineFunctionPass(&ID),
+  : MachineFunctionPass(ID),
     TM(tm), MAI(tm.getMCAsmInfo()),
     OutContext(Streamer.getContext()),
     OutStreamer(Streamer),
index 7f98df0d22ea4318f0bc4256771df7de03717975..cb81aa3c88ce6a03c8d1d0eca35288c93d51d0b6 100644 (file)
@@ -65,7 +65,7 @@ namespace {
   public:
     static char ID;
     explicit BranchFolderPass(bool defaultEnableTailMerge)
-      : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {}
+      : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const { return "Control Flow Optimizer"; }
index e0e315c6c677fdd91fe6be3d0349365d50834bb3..91a9536e7757c250634194021496e691f4937fb5 100644 (file)
@@ -36,7 +36,7 @@ namespace {
 
   public:
     static char ID;
-    CodePlacementOpt() : MachineFunctionPass(&ID) {}
+    CodePlacementOpt() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const {
index 2f5b6dd31bc87446d5d36f70998a25492163947e..138b83d4b667c83d51eef7e9a7366f9faae00c65 100644 (file)
@@ -36,7 +36,7 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    DeadMachineInstructionElim() : MachineFunctionPass(&ID) {}
+    DeadMachineInstructionElim() : MachineFunctionPass(ID) {}
 
   private:
     bool isDead(const MachineInstr *MI) const;
index dfa9622a20a3a86593282ec8f328401f01f8265d..57f45ec199d480fea54bdc456fafe14f45a4cce0 100644 (file)
@@ -160,7 +160,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid.
     DwarfEHPrepare(const TargetMachine *tm, bool fast) :
-      FunctionPass(&ID), TM(tm), TLI(TM->getTargetLowering()),
+      FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()),
       CompileFast(fast),
       ExceptionValueIntrinsic(0), SelectorIntrinsic(0),
       URoR(0), EHCatchAllValue(0), RewindFunction(0) {}
index 8e4b98647fd5cab3b48d511a5502539af3f6c2f3..d14728d8a36c9bec06a7436a88e710688c965610 100644 (file)
@@ -63,7 +63,7 @@ char ELFWriter::ID = 0;
 //===----------------------------------------------------------------------===//
 
 ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm)
-  : MachineFunctionPass(&ID), O(o), TM(tm),
+  : MachineFunctionPass(ID), O(o), TM(tm),
     OutContext(*new MCContext(*TM.getMCAsmInfo())),
     TLOF(TM.getTargetLowering()->getObjFileLowering()),
     is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64),
index 32bc7d785b60869d61d170a4162d349cba374a85..0f6e882a7be43dadb34885cc6c22021b99826728 100644 (file)
@@ -30,8 +30,8 @@ namespace {
     raw_ostream &OS;
     
   public:
-    Printer() : FunctionPass(&ID), OS(errs()) {}
-    explicit Printer(raw_ostream &OS) : FunctionPass(&ID), OS(OS) {}
+    Printer() : FunctionPass(ID), OS(errs()) {}
+    explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {}
 
     
     const char *getPassName() const;
@@ -70,7 +70,7 @@ GCFunctionInfo::~GCFunctionInfo() {}
 char GCModuleInfo::ID = 0;
 
 GCModuleInfo::GCModuleInfo()
-  : ImmutablePass(&ID) {}
+  : ImmutablePass(ID) {}
 
 GCModuleInfo::~GCModuleInfo() {
   clear();
@@ -189,7 +189,7 @@ FunctionPass *llvm::createGCInfoDeleter() {
   return new Deleter();
 }
 
-Deleter::Deleter() : FunctionPass(&ID) {}
+Deleter::Deleter() : FunctionPass(ID) {}
 
 const char *Deleter::getPassName() const {
   return "Delete Garbage Collector Information";
index b27a420a243efd3224baa92c031a76a8b42ad8ff..719fa194d8da132313dfbe7fb178ae2dcc8007e1 100644 (file)
@@ -130,7 +130,7 @@ FunctionPass *llvm::createGCLoweringPass() {
 char LowerIntrinsics::ID = 0;
 
 LowerIntrinsics::LowerIntrinsics()
-  : FunctionPass(&ID) {}
+  : FunctionPass(ID) {}
 
 const char *LowerIntrinsics::getPassName() const {
   return "Lower Garbage Collection Instructions";
@@ -318,7 +318,7 @@ FunctionPass *llvm::createGCMachineCodeAnalysisPass() {
 char MachineCodeAnalysis::ID = 0;
 
 MachineCodeAnalysis::MachineCodeAnalysis()
-  : MachineFunctionPass(&ID) {}
+  : MachineFunctionPass(ID) {}
 
 const char *MachineCodeAnalysis::getPassName() const {
   return "Analyze Machine Code For Garbage Collection";
index 6c064a74cd048a31cde9f7ab14b00f4e5214c4f7..0ea30d7a7929ddac9907116b3b862a5cdfca0336 100644 (file)
@@ -154,7 +154,7 @@ namespace {
     int FnNum;
   public:
     static char ID;
-    IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {}
+    IfConverter() : MachineFunctionPass(ID), FnNum(-1) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const { return "If Converter"; }
index dfd4eaeca660397b4209692e2fddcea6df6b1efd..a1f1a078d613a6428878492b3a97d57c01172905 100644 (file)
@@ -36,7 +36,7 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {}
+    LowerSubregsInstructionPass() : MachineFunctionPass(ID) {}
     
     const char *getPassName() const {
       return "Subregister lowering instruction pass";
index ef4919239b99b52252f3d4d86313e8c7effa2a34..60642d46223794e544550d26fd3f1689a17c21f9 100644 (file)
@@ -41,7 +41,7 @@ namespace {
     MachineRegisterInfo *MRI;
   public:
     static char ID; // Pass identification
-    MachineCSE() : MachineFunctionPass(&ID), LookAheadLimit(5), CurrVN(0) {}
+    MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     
index b5f8fbba99debdfc190349329a2b70aecb1c0f0c..36c9d66965a3a8cd64d74656dca4570164ab9dd4 100644 (file)
@@ -27,7 +27,7 @@ char MachineDominatorTree::ID = 0;
 static RegisterPass<MachineDominatorTree>
 E("machinedomtree", "MachineDominator Tree Construction", true);
 
-const PassInfo *const llvm::MachineDominatorsID = &E;
+char &llvm::MachineDominatorsID = MachineDominatorTree::ID;
 
 void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesAll();
@@ -41,7 +41,7 @@ bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) {
 }
 
 MachineDominatorTree::MachineDominatorTree()
-    : MachineFunctionPass(&ID) {
+    : MachineFunctionPass(ID) {
   DT = new DominatorTreeBase<MachineBasicBlock>(false);
 }
 
index 07a0f45c0f481aa31c13a7b2f7feada680ed5150..4f84b952e0612ed77792752f5dc6710f0d2f91ce 100644 (file)
@@ -20,14 +20,14 @@ using namespace llvm;
 // a default constructor.
 static PassInfo
 X("Machine Function Analysis", "machine-function-analysis",
-  intptr_t(&MachineFunctionAnalysis::ID), 0,
+   &MachineFunctionAnalysis::ID, 0,
   /*CFGOnly=*/false, /*is_analysis=*/true);
 
 char MachineFunctionAnalysis::ID = 0;
 
 MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm,
                                                  CodeGenOpt::Level OL) :
-  FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) {
+  FunctionPass(ID), TM(tm), OptLevel(OL), MF(0) {
 }
 
 MachineFunctionAnalysis::~MachineFunctionAnalysis() {
index 547c4febc8dae745740e0cd82f05b7c42bf1a014..2aaa798a02c19d9f4968f9e85b549143551efc6b 100644 (file)
@@ -29,7 +29,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
   const std::string Banner;
 
   MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) 
-      : MachineFunctionPass(&ID), OS(os), Banner(banner) {}
+      : MachineFunctionPass(ID), OS(os), Banner(banner) {}
 
   const char *getPassName() const { return "MachineFunction Printer"; }
 
index 63b145e24557706e35fc20e1cbd41c4ae96448af..1a74b747e9f2a45e1d137649aa8d4ee12f0a4e54 100644 (file)
@@ -74,10 +74,10 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     MachineLICM() :
-      MachineFunctionPass(&ID), PreRegAlloc(true) {}
+      MachineFunctionPass(ID), PreRegAlloc(true) {}
 
     explicit MachineLICM(bool PreRA) :
-      MachineFunctionPass(&ID), PreRegAlloc(PreRA) {}
+      MachineFunctionPass(ID), PreRegAlloc(PreRA) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 269538b31d0b9442c64ee33b7a367d55430a7ec0..039edf26a2b7738032226b148ef0066f139bed79 100644 (file)
@@ -33,7 +33,7 @@ char MachineLoopInfo::ID = 0;
 static RegisterPass<MachineLoopInfo>
 X("machine-loops", "Machine Natural Loop Construction", true);
 
-const PassInfo *const llvm::MachineLoopInfoID = &X;
+char &llvm::MachineLoopInfoID = MachineLoopInfo::ID;
 
 bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
   releaseMemory();
index d2e3bf74641a2fda85c95b07acaccd8353fb67a2..b647a4dcc5308f82625c74a7180a05f00ae3723f 100644 (file)
@@ -254,7 +254,7 @@ void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) {
 //===----------------------------------------------------------------------===//
 
 MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
-: ImmutablePass(&ID), Context(MAI),
+: ImmutablePass(ID), Context(MAI),
   ObjFileMMI(0),
   CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){
   // Always emit some info, by default "no personality" info.
@@ -264,7 +264,7 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
 }
 
 MachineModuleInfo::MachineModuleInfo()
-: ImmutablePass(&ID), Context(*(MCAsmInfo*)0) {
+: ImmutablePass(ID), Context(*(MCAsmInfo*)0) {
   assert(0 && "This MachineModuleInfo constructor should never be called, MMI "
          "should always be explicitly constructed by LLVMTargetMachine");
   abort();
index d1f91f271b9b9a2cf9655dd526c5b5add9b3b776..1c83176db96ce1ca81edac946cab317bcaeb602e 100644 (file)
@@ -44,7 +44,7 @@ namespace {
 
   public:
     static char ID; // Pass identification
-    MachineSinking() : MachineFunctionPass(&ID) {}
+    MachineSinking() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 0f3cc8b2dd9f4e0b917c4603229f8e31245b864c..7e06894fa6bb164b2df9f9748deaa0a89e96dabc 100644 (file)
@@ -195,7 +195,7 @@ namespace {
     static char ID; // Pass ID, replacement for typeid
 
     MachineVerifierPass()
-      : MachineFunctionPass(&ID) {}
+      : MachineFunctionPass(ID) {}
 
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index cd396cc2eae477d822fef1e82dd89aa3bc508719..5b524cd6414d506750001538ff2bce566886f8a7 100644 (file)
@@ -46,7 +46,7 @@ namespace {
 
   public:
     static char ID; // Pass identification
-    OptimizeCmps() : MachineFunctionPass(&ID) {}
+    OptimizeCmps() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 586b84c5768ef2ba9bf5d4ec7a8b2bb9d3f7c73a..288f58b50832144ee5d5af2208ba55248920eda6 100644 (file)
@@ -43,7 +43,7 @@ namespace {
 
   public:
     static char ID; // Pass identification
-    OptimizeExts() : MachineFunctionPass(&ID) {}
+    OptimizeExts() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index d27cc42319c3faad3e709e89b23af963accb82b6..edb4eea71b8a72032f1d1a3ec5ddb06ce36de287 100644 (file)
@@ -33,7 +33,7 @@ namespace {
 
   public:
     static char ID; // Pass identification
-    OptimizePHIs() : MachineFunctionPass(&ID) {}
+    OptimizePHIs() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index ea6b094d7efe415ca7a2afc1791c975be17843fe..7bf0aa23af384d43a363c9220b8439f6afaaf5f9 100644 (file)
@@ -40,7 +40,7 @@ char PHIElimination::ID = 0;
 static RegisterPass<PHIElimination>
 X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
 
-const PassInfo *const llvm::PHIEliminationID = &X;
+char &llvm::PHIEliminationID = PHIElimination::ID;
 
 void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addPreserved<LiveVariables>();
index 7dedf0318a8a67ca296044054a3d12bb437892cf..f183de6149ccbbb5f567ef3ae28bce28ddf95ad1 100644 (file)
@@ -25,7 +25,7 @@ namespace llvm {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    PHIElimination() : MachineFunctionPass(&ID) {}
+    PHIElimination() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &Fn);
     
index 3005ec1075b6a2dc72b8cc8b3dde964351a1bf6f..f0bd6d1372be79f12649df0875a50d8340d4f421 100644 (file)
@@ -85,7 +85,7 @@ namespace {
   public:
     static char ID;
     PostRAScheduler(CodeGenOpt::Level ol) :
-      MachineFunctionPass(&ID), OptLevel(ol) {}
+      MachineFunctionPass(ID), OptLevel(ol) {}
 
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
index 4cbd53a834ebd21ddcac14a42a2c779dce52adf5..82df6c2379312eb95f274ce3a58922c96979fbb0 100644 (file)
@@ -92,7 +92,7 @@ namespace {
   public:
     static char ID;
     PreAllocSplitting()
-      : MachineFunctionPass(&ID) {}
+      : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
@@ -206,7 +206,7 @@ char PreAllocSplitting::ID = 0;
 static RegisterPass<PreAllocSplitting>
 X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting");
 
-const PassInfo *const llvm::PreAllocSplittingID = &X;
+char &llvm::PreAllocSplittingID = PreAllocSplitting::ID;
 
 /// findSpillPoint - Find a gap as far away from the given MI that's suitable
 /// for spilling the current live interval. The index must be before any
index aa95773596cfef28a8787c4276ebb88845627614..e56c36fe908c2f59b13c4197b23c4c0c08fa3f0a 100644 (file)
@@ -36,7 +36,7 @@ namespace llvm {
   class PEI : public MachineFunctionPass {
   public:
     static char ID;
-    PEI() : MachineFunctionPass(&ID) {}
+    PEI() : MachineFunctionPass(ID) {}
 
     const char *getPassName() const {
       return "Prolog/Epilog Insertion & Frame Finalization";
index 9dff74b5dd99ef91fe2ef528c7f0f95d84a4779f..1367a22e8066151e7534a4cea57a944460c91fce 100644 (file)
@@ -47,7 +47,7 @@ namespace {
   class RAFast : public MachineFunctionPass {
   public:
     static char ID;
-    RAFast() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1),
+    RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1),
                isBulkSpilling(false) {}
   private:
     const TargetMachine *TM;
index d10b5d630682a9205c4146455f74098b16e74ebe..c9c51b361d3685faa972e4dd3d47c1db526019c3 100644 (file)
@@ -90,7 +90,7 @@ namespace {
  
   struct RALinScan : public MachineFunctionPass {
     static char ID;
-    RALinScan() : MachineFunctionPass(&ID) {
+    RALinScan() : MachineFunctionPass(ID) {
       // Initialize the queue to record recently-used registers.
       if (NumRecentlyUsedRegs > 0)
         RecentRegs.resize(NumRecentlyUsedRegs, 0);
index 594618891de1c21b8ec5056bbd7672c86eb67774..0dd921482696271d7a9589fece30c9baf5cb0db0 100644 (file)
@@ -84,7 +84,7 @@ namespace {
     static char ID;
 
     /// Construct a PBQP register allocator.
-    PBQPRegAlloc() : MachineFunctionPass(&ID) {}
+    PBQPRegAlloc() : MachineFunctionPass(ID) {}
 
     /// Return the pass name.
     virtual const char* getPassName() const {
index 4d22b34d55865928c10d7818b8cb855c2a26e026..71a613bedafeab937fac4a9da5c4b98739dc9d0d 100644 (file)
@@ -198,7 +198,7 @@ namespace llvm {
   public:
     static char ID;
 
-    RenderMachineFunction() : MachineFunctionPass(&ID) {}
+    RenderMachineFunction() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;
 
index 1731be2be9581494b2a33c6bcb6ae2d2e18add3e..700d2cb2e87d775156d791e221d40aee8394265e 100644 (file)
@@ -171,7 +171,7 @@ TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
 //===----------------------------------------------------------------------===//
 
 SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) :
-  MachineFunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()),
+  MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()),
   FuncInfo(new FunctionLoweringInfo(TLI)),
   CurDAG(new SelectionDAG(tm)),
   SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)),
index 7bf559fae2873af75c9abf20a8a2a8a506870aac..fd6ffcecd14033d4eadebe5f2aa1792b954ea9aa 100644 (file)
@@ -65,7 +65,7 @@ X("simple-register-coalescing", "Simple Register Coalescing");
 // Declare that we implement the RegisterCoalescer interface
 static RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
 
-const PassInfo *const llvm::SimpleRegisterCoalescingID = &X;
+char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID;
 
 void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesCFG();
index e154da60affa27603f536e6d6266813b4cdc6e2c..321cef8a38dd7edc0c6aaf80eabdc18a8919721d 100644 (file)
@@ -64,7 +64,7 @@ namespace llvm {
 
   public:
     static char ID; // Pass identifcation, replacement for typeid
-    SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {}
+    SimpleRegisterCoalescing() : MachineFunctionPass(ID) {}
 
     struct InstrSlots {
       enum {
index e90869d600dd69c2e72b578959d6b2d67d9b9887..b637980f885c35a7d56573343e78d6bfd4026699 100644 (file)
@@ -58,7 +58,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit SjLjEHPass(const TargetLowering *tli = NULL)
-      : FunctionPass(&ID), TLI(tli) { }
+      : FunctionPass(ID), TLI(tli) { }
     bool doInitialization(Module &M);
     bool runOnFunction(Function &F);
 
index 2b0645dfdcd715343995ea4571ad69bfc1e1e316..a726a7b834fbe203f4bc3e65bd6ecbcc6853b539 100644 (file)
@@ -36,7 +36,7 @@ namespace llvm {
   public:
     static char ID;
 
-    LoopSplitter() : MachineFunctionPass(&ID) {}
+    LoopSplitter() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;
 
index ff20f11e6e6c70c62b0757a126f436f3d88fa884..9f51778da756241d7e43b761edfa97de37fee038 100644 (file)
@@ -62,9 +62,9 @@ namespace {
     bool RequiresStackProtector() const;
   public:
     static char ID;             // Pass identification, replacement for typeid.
-    StackProtector() : FunctionPass(&ID), TLI(0) {}
+    StackProtector() : FunctionPass(ID), TLI(0) {}
     StackProtector(const TargetLowering *tli)
-      : FunctionPass(&ID), TLI(tli) {}
+      : FunctionPass(ID), TLI(tli) {}
 
     virtual bool runOnFunction(Function &Fn);
   };
index 7da3d17a54179b4778c3e1469d6fd14ca9deb755..dab6bc3924d64c224952d5e09eb559d335af5c4e 100644 (file)
@@ -95,9 +95,9 @@ namespace {
   public:
     static char ID; // Pass identification
     StackSlotColoring() :
-      MachineFunctionPass(&ID), ColorWithRegs(false), NextColor(-1) {}
+      MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {}
     StackSlotColoring(bool RegColor) :
-      MachineFunctionPass(&ID), ColorWithRegs(RegColor), NextColor(-1) {}
+      MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {}
     
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
index 59315cf67282b27c1eac9af63b2fab2dc1329e60..5e2d414a3ee182fb5591e5f14f35cdd74cdf0f43 100644 (file)
@@ -39,7 +39,7 @@ using namespace llvm;
 namespace {
   struct StrongPHIElimination : public MachineFunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    StrongPHIElimination() : MachineFunctionPass(&ID) {}
+    StrongPHIElimination() : MachineFunctionPass(ID) {}
 
     // Waiting stores, for each MBB, the set of copies that need to
     // be inserted into that MBB
@@ -154,7 +154,7 @@ static RegisterPass<StrongPHIElimination>
 X("strong-phi-node-elimination",
   "Eliminate PHI nodes for register allocation, intelligently");
 
-const PassInfo *const llvm::StrongPHIEliminationID = &X;
+char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID;
 
 /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree
 /// of the given MachineFunction.  These numbers are then used in other parts
index aac8a0a20686e3ccc439c2cbba0da39969e9bbcd..a815b364d54e758ed2f78bd9ca14da676a56aa1a 100644 (file)
@@ -69,7 +69,7 @@ namespace {
   public:
     static char ID;
     explicit TailDuplicatePass(bool PreRA) :
-      MachineFunctionPass(&ID), PreRegAlloc(PreRA) {}
+      MachineFunctionPass(ID), PreRegAlloc(PreRA) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const { return "Tail Duplication"; }
index 9c280faea0ed9b942e8b8266085c357595c3203f..2e17ebcf8a5cb6779c4a1ecf4da3aa9001494737 100644 (file)
@@ -138,7 +138,7 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    TwoAddressInstructionPass() : MachineFunctionPass(&ID) {}
+    TwoAddressInstructionPass() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
@@ -162,7 +162,7 @@ char TwoAddressInstructionPass::ID = 0;
 static RegisterPass<TwoAddressInstructionPass>
 X("twoaddressinstruction", "Two-Address instruction pass");
 
-const PassInfo *const llvm::TwoAddressInstructionPassID = &X;
+char &llvm::TwoAddressInstructionPassID = TwoAddressInstructionPass::ID;
 
 /// Sink3AddrInstruction - A two-address instruction has been converted to a
 /// three-address instruction to avoid clobbering a register. Try to sink it
index be1fd23e2fccdf6904b6256fb2737b6f0e6b1d35..ade2ab4ffabf06bbb04e20d508d319c55237ce51 100644 (file)
@@ -43,7 +43,7 @@ namespace {
     virtual bool runOnFunction(Function &F);
   public:
     static char ID; // Pass identification, replacement for typeid
-    UnreachableBlockElim() : FunctionPass(&ID) {}
+    UnreachableBlockElim() : FunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addPreserved<ProfileInfo>();
@@ -100,7 +100,7 @@ namespace {
     MachineModuleInfo *MMI;
   public:
     static char ID; // Pass identification, replacement for typeid
-    UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {}
+    UnreachableMachineBlockElim() : MachineFunctionPass(ID) {}
   };
 }
 char UnreachableMachineBlockElim::ID = 0;
@@ -109,7 +109,7 @@ static RegisterPass<UnreachableMachineBlockElim>
 Y("unreachable-mbb-elimination",
   "Remove unreachable machine basic blocks");
 
-const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y;
+char &llvm::UnreachableMachineBlockElimID = UnreachableMachineBlockElim::ID;
 
 void UnreachableMachineBlockElim::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addPreserved<MachineLoopInfo>();
index 87a9b2a7c46f9b31e5eaf0dae3f41520f859721a..8b6082d18193285a244f99ba3898d88d931c7dd5 100644 (file)
@@ -139,7 +139,7 @@ namespace llvm {
 
   public:
     static char ID;
-    VirtRegMap() : MachineFunctionPass(&ID), Virt2PhysMap(NO_PHYS_REG),
+    VirtRegMap() : MachineFunctionPass(ID), Virt2PhysMap(NO_PHYS_REG),
                    Virt2StackSlotMap(NO_STACK_SLOT), 
                    Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0),
                    Virt2SplitKillMap(SlotIndex()), ReMatMap(NULL),
index 93f617db64fdd02d634709e15d489033fe9cbf96..089d1c51598f41c9ccfa6b2e4db36abbfc9596f3 100644 (file)
@@ -65,7 +65,7 @@ namespace {
     static char ID;
   public:
     ARMCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce)
-      : MachineFunctionPass(&ID), JTI(0),
+      : MachineFunctionPass(ID), JTI(0),
         II((const ARMInstrInfo *)tm.getInstrInfo()),
         TD(tm.getTargetData()), TM(tm),
         MCE(mce), MCPEs(0), MJTEs(0),
index 63d57b61b462097ebf260d40204707e0c72368fa..118b2de7f4f36cd9b4d919aa7e3ff6cc05d92656 100644 (file)
@@ -173,7 +173,7 @@ namespace {
     bool isThumb2;
   public:
     static char ID;
-    ARMConstantIslands() : MachineFunctionPass(&ID) {}
+    ARMConstantIslands() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 70ed67713e2648a5b1bba31b80482fbde739a04f..e5f8a638eb67212ad5286ef946cd30ebad71d9ff 100644 (file)
@@ -26,7 +26,7 @@ namespace {
   class ARMExpandPseudo : public MachineFunctionPass {
   public:
     static char ID;
-    ARMExpandPseudo() : MachineFunctionPass(&ID) {}
+    ARMExpandPseudo() : MachineFunctionPass(ID) {}
 
     const TargetInstrInfo *TII;
     const TargetRegisterInfo *TRI;
index af7298a24394480b1b792c912d7d92a037da9fc1..85b0c6c248d0291b2ee004baf100476ac6e2a354 100644 (file)
@@ -78,7 +78,7 @@ namespace {
   public:
     static char ID;             // Pass identification, replacement for typeid.
     explicit ARMGlobalMerge(const TargetLowering *tli)
-      : FunctionPass(&ID), TLI(tli) {}
+      : FunctionPass(ID), TLI(tli) {}
 
     virtual bool doInitialization(Module &M);
     virtual bool runOnFunction(Function& F);
index f80e316d23e8568c95aec74e64bb1879e9873feb..db580fbf7b163b60694b2d6025b255ca162e479d 100644 (file)
@@ -57,7 +57,7 @@ STATISTIC(NumSTRD2STR,  "Number of strd instructions turned back into str's");
 namespace {
   struct ARMLoadStoreOpt : public MachineFunctionPass {
     static char ID;
-    ARMLoadStoreOpt() : MachineFunctionPass(&ID) {}
+    ARMLoadStoreOpt() : MachineFunctionPass(ID) {}
 
     const TargetInstrInfo *TII;
     const TargetRegisterInfo *TRI;
@@ -1268,7 +1268,7 @@ bool ARMLoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
 namespace {
   struct ARMPreAllocLoadStoreOpt : public MachineFunctionPass{
     static char ID;
-    ARMPreAllocLoadStoreOpt() : MachineFunctionPass(&ID) {}
+    ARMPreAllocLoadStoreOpt() : MachineFunctionPass(ID) {}
 
     const TargetData *TD;
     const TargetInstrInfo *TII;
index bbdd3c7f7c3e09553a1c72b4827fd11d90f95d64..97e54bfaed9e7a4178f3154dedeb9170237ce6af 100644 (file)
@@ -24,7 +24,7 @@ STATISTIC(NumVMovs, "Number of reg-reg moves converted");
 namespace {
   struct NEONMoveFixPass : public MachineFunctionPass {
     static char ID;
-    NEONMoveFixPass() : MachineFunctionPass(&ID) {}
+    NEONMoveFixPass() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &Fn);
 
index f67717cdd56f5da4668ac36338b9972e9468b697..006a25fb15c0a3b583e0024411a827c4a409485c 100644 (file)
@@ -23,7 +23,7 @@ namespace {
 
   public:
     static char ID;
-    NEONPreAllocPass() : MachineFunctionPass(&ID) {}
+    NEONPreAllocPass() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 445b6a3a09b1573f252cb1da7711b88859662176..45e693744b806ab4608581fa980f33807303ae43 100644 (file)
@@ -27,7 +27,7 @@ namespace {
 
   public:
     static char ID;
-    Thumb2ITBlockPass() : MachineFunctionPass(&ID) {}
+    Thumb2ITBlockPass() : MachineFunctionPass(ID) {}
 
     const Thumb2InstrInfo *TII;
     const TargetRegisterInfo *TRI;
index ba392f36d946424fab03cc0fbc615b943dab1acb..1451c53112f531aea42303dd48662c53d7985db3 100644 (file)
@@ -173,7 +173,7 @@ namespace {
   char Thumb2SizeReduce::ID = 0;
 }
 
-Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(&ID) {
+Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(ID) {
   for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) {
     unsigned FromOpc = ReduceTable[i].WideOpc;
     if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second)
index 001656e0121a783b58ea780dce140f91c25d64b6..37681170953698354b43a5cbdf09ef96ccc2879a 100644 (file)
@@ -22,7 +22,7 @@ using namespace llvm;
 namespace {
   struct AlphaBSel : public MachineFunctionPass {
     static char ID;
-    AlphaBSel() : MachineFunctionPass(&ID) {}
+    AlphaBSel() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &Fn);
 
index a6c6f52704f6bf522a6186c99c6653a187e68a4a..3aec07035d74c83254b8418bde60de2c6323fa4d 100644 (file)
@@ -34,7 +34,7 @@ namespace {
   public:
     static char ID;
 
-    AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(&ID),
+    AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(ID),
     MCE(mce) {}
 
     /// getBinaryCodeForInstr - This function, generated by the
index 34be470f03e30b830365e945b79175b6d0e8e286..85fbfd1affe21edf87ea4373d6589098bbcdccd3 100644 (file)
@@ -39,7 +39,7 @@ namespace {
 
     static char ID;
     AlphaLLRPPass(AlphaTargetMachine &tm) 
-      : MachineFunctionPass(&ID), TM(tm) { }
+      : MachineFunctionPass(ID), TM(tm) { }
 
     virtual const char *getPassName() const {
       return "Alpha NOP inserter";
index 3b4d0a604cf17b94994c66e3e6de55d93a5cf735..46f584cb1b5fdcdbe30d5ed460efc6e94cde4565 100644 (file)
@@ -73,7 +73,7 @@ namespace {
   public:
     static char ID;
     CBackendNameAllUsedStructsAndMergeFunctions() 
-      : ModulePass(&ID) {}
+      : ModulePass(ID) {}
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<FindUsedTypes>();
     }
@@ -110,7 +110,7 @@ namespace {
   public:
     static char ID;
     explicit CWriter(formatted_raw_ostream &o)
-      : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0), 
+      : FunctionPass(ID), Out(o), IL(0), Mang(0), LI(0), 
         TheModule(0), TAsm(0), TCtx(0), TD(0), OpaqueCounter(0),
         NextAnonValueNumber(0) {
       FPCounter = 0;
index 396b569f9d0728f4d94af323d8e260ed102a7d7b..3e21cd1de447456e8e704d5aded340618b18e988 100644 (file)
@@ -104,7 +104,7 @@ namespace {
   public:
     static char ID;
     explicit CppWriter(formatted_raw_ostream &o) :
-      ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){}
+      ModulePass(ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){}
 
     virtual const char *getPassName() const { return "C++ backend"; }
 
index 42fea250733270e9126c147f908b7a89736a1163..b551b79b291ed44788960249df3c0f4281785196 100644 (file)
@@ -32,7 +32,7 @@ namespace {
 
     static char ID;
     Filler(TargetMachine &tm) 
-      : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
+      : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
 
     virtual const char *getPassName() const {
       return "MBlaze Delay Slot Filler";
index 92a3abe5c0a7459e076475c6135ef759229367a2..87440e22987e247ce408575bb88a6b63ecc3d960 100644 (file)
@@ -40,7 +40,7 @@ namespace llvm {
     static char ID;
     MSILModule(const std::set<const Type *>*& _UsedTypes,
                const TargetData*& _TD)
-      : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {}
+      : ModulePass(ID), UsedTypes(_UsedTypes), TD(_TD) {}
 
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<FindUsedTypes>();
@@ -86,7 +86,7 @@ namespace llvm {
     DenseMap<const Value*, unsigned> AnonValueNumbers;
     unsigned NextAnonValueNumber;
 
-    MSILWriter(formatted_raw_ostream &o) : FunctionPass(&ID), Out(o),
+    MSILWriter(formatted_raw_ostream &o) : FunctionPass(ID), Out(o),
          NextAnonValueNumber(0) {
       UniqID = 0;
     }
index 529fd931f65a5494afd3a6752f8329e215631719..b1d6966caebd3525dc2f3278fc54823aa2cc6773 100644 (file)
@@ -30,7 +30,7 @@ STATISTIC(NumExpanded, "Number of branches expanded to long format");
 namespace {
   struct MSP430BSel : public MachineFunctionPass {
     static char ID;
-    MSP430BSel() : MachineFunctionPass(&ID) {}
+    MSP430BSel() : MachineFunctionPass(ID) {}
 
     /// BlockSizes - The sizes of the basic blocks in the function.
     std::vector<unsigned> BlockSizes;
index a2b615d8add2aa929154020778fa38a40b639590..597ea0d6c20720ec04f22f386f29df1a1ec246f8 100644 (file)
@@ -32,7 +32,7 @@ namespace {
 
     static char ID;
     Filler(TargetMachine &tm) 
-      : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
+      : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
 
     virtual const char *getPassName() const {
       return "Mips Delay Slot Filler";
index 241170b11c2ad223eb68f41635bc6dcdff6471aa..b6aa38f765ea79ea1ed213f6850ccf0a4f577d3a 100644 (file)
@@ -38,7 +38,7 @@ using namespace llvm;
 namespace {
   struct MemSelOpt : public MachineFunctionPass {
     static char ID;
-    MemSelOpt() : MachineFunctionPass(&ID) {}
+    MemSelOpt() : MachineFunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addPreservedID(MachineLoopInfoID);
index e8b5aa45cdca9dde86570321c1e03ed51ce85b12..e7d67ce09629a2c9dfc1933273ba54bf222287a0 100644 (file)
@@ -35,7 +35,7 @@ namespace llvm {
   class PIC16Cloner : public ModulePass { 
   public:
     static char ID; // Class identification 
-    PIC16Cloner() : ModulePass(&ID)  {}
+    PIC16Cloner() : ModulePass(ID)  {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<CallGraph>();
index 5a2551fabcda94acf88059dd6ca0d30d039dcd68..2f611e65de1fdbb9015fd11627b8bc77c3d1872c 100644 (file)
@@ -39,7 +39,7 @@ namespace  llvm {
     unsigned IndirectCallColor;
   public:
     static char ID; // Class identification 
-    PIC16Overlay() : ModulePass(&ID) {
+    PIC16Overlay() : ModulePass(ID) {
       OverlayStr = "Overlay=";
       InterruptDepth = PIC16OVERLAY::StartInterruptColor;
       IndirectCallColor = PIC16OVERLAY::StartIndirectCallColor;
index 8c427a1c78ba6c71225608be856b22989941c2bf..df24e96b8e889c0a6e87779d1ca0a51eb534c41f 100644 (file)
@@ -31,7 +31,7 @@ STATISTIC(NumExpanded, "Number of branches expanded to long format");
 namespace {
   struct PPCBSel : public MachineFunctionPass {
     static char ID;
-    PPCBSel() : MachineFunctionPass(&ID) {}
+    PPCBSel() : MachineFunctionPass(ID) {}
 
     /// BlockSizes - The sizes of the basic blocks in the function.
     std::vector<unsigned> BlockSizes;
index d03cf05a9ce8b23c41ff443e29189441e8fdb4e9..df9ab52389ba85f2af71a0a43f5a0bfd792c86bf 100644 (file)
@@ -45,7 +45,7 @@ namespace {
   public:
     
     PPCCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce)
-      : MachineFunctionPass(&ID), TM(tm), MCE(mce) {}
+      : MachineFunctionPass(ID), TM(tm), MCE(mce) {}
 
     /// getBinaryCodeForInstr - This function, generated by the
     /// CodeEmitterGenerator using TableGen, produces the binary encoding for
index 9e148ada8853ed4ff107bbd46908a190e9445c47..aae5da8560056bcf6b405dfde9cff94817e9bf10 100644 (file)
@@ -32,7 +32,7 @@ namespace {
 
     static char ID;
     Filler(TargetMachine &tm) 
-      : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
+      : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
 
     virtual const char *getPassName() const {
       return "SPARC Delay Slot Filler";
index 88b0927b355009e83075a87e93930c4add781e21..1423b1e64d66e7ce1d178e14d3a7feca9383590b 100644 (file)
@@ -36,7 +36,7 @@ namespace {
     
     static char ID;
     explicit FPMover(TargetMachine &tm) 
-      : MachineFunctionPass(&ID), TM(tm) { }
+      : MachineFunctionPass(ID), TM(tm) { }
 
     virtual const char *getPassName() const {
       return "Sparc Double-FP Move Fixer";
index 65f514c26474e8e021f122b7465dab6f9d5ba9da..406d288d1839e4f591f030bcb8a830198f6c358c 100644 (file)
@@ -226,13 +226,13 @@ void TargetData::init(StringRef Desc) {
 ///
 /// @note This has to exist, because this is a pass, but it should never be
 /// used.
-TargetData::TargetData() : ImmutablePass(&ID) {
+TargetData::TargetData() : ImmutablePass(ID) {
   report_fatal_error("Bad TargetData ctor used.  "
                     "Tool did not specify a TargetData to use?");
 }
 
 TargetData::TargetData(const Module *M) 
-  : ImmutablePass(&ID) {
+  : ImmutablePass(ID) {
   init(M->getDataLayout());
 }
 
index dab070e1febda496750e9d7de9b8cb0cdffc7da7..13680c592e01b274dbfca95729fa68147ba43598 100644 (file)
@@ -115,7 +115,7 @@ class SSEDomainFixPass : public MachineFunctionPass {
   unsigned Distance;
 
 public:
-  SSEDomainFixPass() : MachineFunctionPass(&ID) {}
+  SSEDomainFixPass() : MachineFunctionPass(ID) {}
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
index 4fd034e53ed4cdddece1d6e61bb80160d865596b..ef2255de19c33e201cce05d34ff62b6162df91f1 100644 (file)
@@ -53,12 +53,12 @@ namespace {
   public:
     static char ID;
     explicit Emitter(X86TargetMachine &tm, CodeEmitter &mce)
-      : MachineFunctionPass(&ID), II(0), TD(0), TM(tm), 
+      : MachineFunctionPass(ID), II(0), TD(0), TM(tm), 
       MCE(mce), PICBaseOffset(0), Is64BitMode(false),
       IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
     Emitter(X86TargetMachine &tm, CodeEmitter &mce,
             const X86InstrInfo &ii, const TargetData &td, bool is64)
-      : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm), 
+      : MachineFunctionPass(ID), II(&ii), TD(&td), TM(tm), 
       MCE(mce), PICBaseOffset(0), Is64BitMode(is64),
       IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
 
index a58c590147867716fe126d544328e9b50ea622cd..cd23a7d6b2de52f92b19b37543bc52bbbc8ce0ae 100644 (file)
@@ -50,7 +50,7 @@ STATISTIC(NumFP  , "Number of floating point instructions");
 namespace {
   struct FPS : public MachineFunctionPass {
     static char ID;
-    FPS() : MachineFunctionPass(&ID) {
+    FPS() : MachineFunctionPass(ID) {
       // This is really only to keep valgrind quiet.
       // The logic in isLive() is too much for it.
       memset(Stack, 0, sizeof(Stack));
index 98323fa7b07f11514aadaa1e13df6d536055d8a0..4ee0c0af835381fd942c9d822956cae53a313626 100644 (file)
@@ -3029,7 +3029,7 @@ namespace {
   /// global base register for x86-32.
   struct CGBR : public MachineFunctionPass {
     static char ID;
-    CGBR() : MachineFunctionPass(&ID) {}
+    CGBR() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF) {
       const X86TargetMachine *TM =
index afb07405b709ae97d3f2a503ded7c48fdb415137..746e3fa7b5ce8c10594a2ee11df8574cfa59e45b 100644 (file)
@@ -1557,7 +1557,7 @@ unsigned getX86SubSuperRegister(unsigned Reg, EVT VT, bool High) {
 namespace {
   struct MSAH : public MachineFunctionPass {
     static char ID;
-    MSAH() : MachineFunctionPass(&ID) {}
+    MSAH() : MachineFunctionPass(ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF) {
       const X86TargetMachine *TM =
index bf59c044733fa0861546a11c654eaf8479b7e9c3..838d5505490f5841dc2fd1b09cb0ea09d13ab861 100644 (file)
@@ -25,7 +25,7 @@ namespace {
   // Hello - The first implementation, without getAnalysisUsage.
   struct Hello : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    Hello() : FunctionPass(&ID) {}
+    Hello() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F) {
       ++HelloCounter;
@@ -43,7 +43,7 @@ namespace {
   // Hello2 - The second implementation with getAnalysisUsage implemented.
   struct Hello2 : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    Hello2() : FunctionPass(&ID) {}
+    Hello2() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F) {
       ++HelloCounter;
index 4cd4e17f3d2dee1fc185abe5a33ad1f419b9a661..0c77e1fd8cff4f7dfdcc155515d62cd41201a13d 100644 (file)
@@ -67,7 +67,7 @@ namespace {
     virtual bool runOnSCC(CallGraphSCC &SCC);
     static char ID; // Pass identification, replacement for typeid
     explicit ArgPromotion(unsigned maxElements = 3)
-      : CallGraphSCCPass(&ID), maxElements(maxElements) {}
+      : CallGraphSCCPass(ID), maxElements(maxElements) {}
 
     /// A vector used to hold the indices of a single GEP instruction
     typedef std::vector<uint64_t> IndicesVector;
index 5c6bc868c936bda86203b5411de5b609cad2b4f5..75282fae18bc531bc5a981faccdce66a6ddc311e 100644 (file)
@@ -31,7 +31,7 @@ STATISTIC(NumMerged, "Number of global constants merged");
 namespace {
   struct ConstantMerge : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
-    ConstantMerge() : ModulePass(&ID) {}
+    ConstantMerge() : ModulePass(ID) {}
 
     // run - For this pass, process all of the globals in the module,
     // eliminating duplicate constants.
index 7202f50a362efcb93671dbc3a6e593b5e0cb0904..47df235424e2fc18af75d74be3dd814f29f762c8 100644 (file)
@@ -122,11 +122,11 @@ namespace {
 
   protected:
     // DAH uses this to specify a different ID.
-    explicit DAE(void *ID) : ModulePass(ID) {}
+    explicit DAE(char &ID) : ModulePass(ID) {}
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    DAE() : ModulePass(&ID) {}
+    DAE() : ModulePass(ID) {}
 
     bool runOnModule(Module &M);
 
@@ -159,7 +159,7 @@ namespace {
   /// by bugpoint.
   struct DAH : public DAE {
     static char ID;
-    DAH() : DAE(&ID) {}
+    DAH() : DAE(ID) {}
 
     virtual bool ShouldHackArguments() const { return true; }
   };
index 5ff80f72cf463c6de449ccfd02a3be94ce2b6190..5dc50c5bef32fe0ad67ed4d3de1d80de54e73c92 100644 (file)
@@ -26,7 +26,7 @@ STATISTIC(NumKilled, "Number of unused typenames removed from symtab");
 namespace {
   struct DTE : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
-    DTE() : ModulePass(&ID) {}
+    DTE() : ModulePass(ID) {}
 
     // doPassInitialization - For this pass, it removes global symbol table
     // entries for primitive types.  These are never used for linking in GCC and
index 7f67e48ade839a890a4995f2b3d9c64320dfa77b..9eb690d9474d58f1b7bd4c5719ea72d2185c7a1a 100644 (file)
@@ -35,7 +35,7 @@ namespace {
     ///
     explicit GVExtractorPass(std::vector<GlobalValue*>& GVs, bool deleteS = true,
                              bool relinkCallees = false)
-      : ModulePass(&ID), Named(GVs), deleteStuff(deleteS),
+      : ModulePass(ID), Named(GVs), deleteStuff(deleteS),
         reLink(relinkCallees) {}
 
     bool runOnModule(Module &M) {
index d5c35ea59d60e1c108baddc42b63d427f068a73d..6165ba023f7377b757a618200fa347675dc1c485 100644 (file)
@@ -41,7 +41,7 @@ STATISTIC(NumNoAlias, "Number of function returns marked noalias");
 namespace {
   struct FunctionAttrs : public CallGraphSCCPass {
     static char ID; // Pass identification, replacement for typeid
-    FunctionAttrs() : CallGraphSCCPass(&ID) {}
+    FunctionAttrs() : CallGraphSCCPass(ID) {}
 
     // runOnSCC - Analyze the SCC, performing the transformation if possible.
     bool runOnSCC(CallGraphSCC &SCC);
index 129cb7c46e0b1ad914ad101a416f3964d0168cac..aa18601b9aecaf8a2cb17315df28332257426b1f 100644 (file)
@@ -31,7 +31,7 @@ STATISTIC(NumVariables, "Number of global variables removed");
 namespace {
   struct GlobalDCE : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
-    GlobalDCE() : ModulePass(&ID) {}
+    GlobalDCE() : ModulePass(ID) {}
 
     // run - Do the GlobalDCE pass on the specified module, optionally updating
     // the specified callgraph to reflect the changes.
index 9ea98ec4775f67c518f035d9fd2fff2d355137a6..a77af549caa131579abb709f240966e921926781 100644 (file)
@@ -59,7 +59,7 @@ namespace {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     }
     static char ID; // Pass identification, replacement for typeid
-    GlobalOpt() : ModulePass(&ID) {}
+    GlobalOpt() : ModulePass(ID) {}
 
     bool runOnModule(Module &M);
 
index 762935e38c2456e9a90ebf8706a92be71aad78d4..1b3cf7810cc68f6db9332d941f49f652cf2485eb 100644 (file)
@@ -35,7 +35,7 @@ namespace {
   ///
   struct IPCP : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
-    IPCP() : ModulePass(&ID) {}
+    IPCP() : ModulePass(ID) {}
 
     bool runOnModule(Module &M);
   private:
index 43b50fcb3d57642f473886b9aaf7b809cae98192..ecc60ad069325917b045542bba4ea9fe0613dcab 100644 (file)
@@ -36,7 +36,7 @@ namespace {
     InlineCostAnalyzer CA;
   public:
     // Use extremely low threshold. 
-    AlwaysInliner() : Inliner(&ID, -2000000000) {}
+    AlwaysInliner() : Inliner(ID, -2000000000) {}
     static char ID; // Pass identification, replacement for typeid
     InlineCost getInlineCost(CallSite CS) {
       return CA.getInlineCost(CS, NeverInline);
index e609fb6867ff4aba9513069e31e8a80528f10f5b..9c6637dfe5ad6bc5de2b58e80750746d35116acf 100644 (file)
@@ -33,8 +33,8 @@ namespace {
     SmallPtrSet<const Function*, 16> NeverInline; 
     InlineCostAnalyzer CA;
   public:
-    SimpleInliner() : Inliner(&ID) {}
-    SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {}
+    SimpleInliner() : Inliner(ID) {}
+    SimpleInliner(int Threshold) : Inliner(ID, Threshold) {}
     static char ID; // Pass identification, replacement for typeid
     InlineCost getInlineCost(CallSite CS) {
       return CA.getInlineCost(CS, NeverInline);
index 876e80e53718556ce1559a68e9fff044bbac3431..4983e8e13a3ee72aa87c4cd95facaf82494213f1 100644 (file)
@@ -48,10 +48,10 @@ HintThreshold("inlinehint-threshold", cl::Hidden, cl::init(325),
 // Threshold to use when optsize is specified (and there is no -inline-limit).
 const int OptSizeThreshold = 75;
 
-Inliner::Inliner(void *ID) 
+Inliner::Inliner(char &ID) 
   : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {}
 
-Inliner::Inliner(void *ID, int Threshold) 
+Inliner::Inliner(char &ID, int Threshold) 
   : CallGraphSCCPass(ID), InlineThreshold(Threshold) {}
 
 /// getAnalysisUsage - For this class, we declare that we require and preserve
index 1f861e02e2d0e4f0bef7e955cf9b57a7c7942b64..a1d919fd8a042050525b4b4a7f42249c66f8b5d7 100644 (file)
@@ -67,7 +67,7 @@ INITIALIZE_PASS(InternalizePass, "internalize",
                 "Internalize Global Symbols", false, false);
 
 InternalizePass::InternalizePass(bool AllButMain)
-  : ModulePass(&ID), AllButMain(AllButMain){
+  : ModulePass(ID), AllButMain(AllButMain){
   if (!APIFile.empty())           // If a filename is specified, use it.
     LoadFile(APIFile.c_str());
   if (!APIList.empty())           // If a list is specified, use it as well.
@@ -75,7 +75,7 @@ InternalizePass::InternalizePass(bool AllButMain)
 }
 
 InternalizePass::InternalizePass(const std::vector<const char *>&exportList)
-  : ModulePass(&ID), AllButMain(false){
+  : ModulePass(ID), AllButMain(false){
   for(std::vector<const char *>::const_iterator itr = exportList.begin();
         itr != exportList.end(); itr++) {
     ExternalNames.insert(*itr);
index fd60adfc507d33510dc553427089622d3b02cbca..f88dff67d7c9831851ef207cec04b5970cf34c6f 100644 (file)
@@ -37,7 +37,7 @@ namespace {
     unsigned NumLoops;
 
     explicit LoopExtractor(unsigned numLoops = ~0) 
-      : LoopPass(&ID), NumLoops(numLoops) {}
+      : LoopPass(ID), NumLoops(numLoops) {}
 
     virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
 
@@ -147,7 +147,7 @@ namespace {
     std::vector<std::pair<std::string, std::string> > BlocksToNotExtractByName;
   public:
     static char ID; // Pass identification, replacement for typeid
-    BlockExtractorPass() : ModulePass(&ID) {
+    BlockExtractorPass() : ModulePass(ID) {
       if (!BlockFile.empty())
         LoadFile(BlockFile.c_str());
     }
index fa19ea1fa46573be1364d7269f4f2eca9a5a8f71..6c715de04b76365784f302451e0c20132b10e9bc 100644 (file)
@@ -109,7 +109,7 @@ namespace {
     bool IsTransformableFunction(StringRef Name);
   public:
     static char ID; // Pass identification, replacement for typeid
-    LowerSetJmp() : ModulePass(&ID) {}
+    LowerSetJmp() : ModulePass(ID) {}
 
     void visitCallInst(CallInst& CI);
     void visitInvokeInst(InvokeInst& II);
index 3c4e2ef74ce5ef970df8ed70eff659fe116b4716..21e9d6ad424ba50d8d90720b55e6a578681e2e14 100644 (file)
@@ -75,7 +75,7 @@ namespace {
   ///
   struct MergeFunctions : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
-    MergeFunctions() : ModulePass(&ID) {}
+    MergeFunctions() : ModulePass(ID) {}
 
     bool runOnModule(Module &M);
   };
index e4a8fc58c2e69d98d15fb29007b13624f858ba5b..eba7b3ae4d135638c99023f537c9f5537a7a5565 100644 (file)
@@ -30,7 +30,7 @@ namespace {
   struct PartialInliner : public ModulePass {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const { }
     static char ID; // Pass identification, replacement for typeid
-    PartialInliner() : ModulePass(&ID) {}
+    PartialInliner() : ModulePass(ID) {}
     
     bool runOnModule(Module& M);
     
index d46879f5093f826a4b7c1d31009eeec446d98388..17245c7acd3b59e6465ccdac4277ec27a56b8dc4 100644 (file)
@@ -50,7 +50,7 @@ namespace {
     int scanDistribution(Function&, int, std::map<Constant*, int>&);
   public :
     static char ID; // Pass identification, replacement for typeid
-    PartSpec() : ModulePass(&ID) {}
+    PartSpec() : ModulePass(ID) {}
     bool runOnModule(Module &M);
   };
 }
index 7d2968e024bccabb096fd192c1d74097cf1ead88..09ac76f979649efb1169f46cbdaee4d89f7b26c4 100644 (file)
@@ -37,7 +37,7 @@ STATISTIC(NumUnreach, "Number of noreturn calls optimized");
 namespace {
   struct PruneEH : public CallGraphSCCPass {
     static char ID; // Pass identification, replacement for typeid
-    PruneEH() : CallGraphSCCPass(&ID) {}
+    PruneEH() : CallGraphSCCPass(ID) {}
 
     // runOnSCC - Analyze the SCC, performing the transformation if possible.
     bool runOnSCC(CallGraphSCC &SCC);
index 32722f1e1e8b0d429757105cbc193f1f57e483ee..ee10ad0b8ba265196e516f23df5d4a59aeaddfc0 100644 (file)
@@ -29,7 +29,7 @@ namespace {
 class StripDeadPrototypesPass : public ModulePass {
 public:
   static char ID; // Pass identification, replacement for typeid
-  StripDeadPrototypesPass() : ModulePass(&ID) { }
+  StripDeadPrototypesPass() : ModulePass(ID) { }
   virtual bool runOnModule(Module &M);
 };
 
index 55674614bce235ba2693d01f59a7d816b29ae126..c6c4fde0a2bdd2d2ba0900bda22025a1db84e485 100644 (file)
@@ -39,7 +39,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit StripSymbols(bool ODI = false) 
-      : ModulePass(&ID), OnlyDebugInfo(ODI) {}
+      : ModulePass(ID), OnlyDebugInfo(ODI) {}
 
     virtual bool runOnModule(Module &M);
 
@@ -52,7 +52,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit StripNonDebugSymbols()
-      : ModulePass(&ID) {}
+      : ModulePass(ID) {}
 
     virtual bool runOnModule(Module &M);
 
@@ -65,7 +65,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit StripDebugDeclare()
-      : ModulePass(&ID) {}
+      : ModulePass(ID) {}
 
     virtual bool runOnModule(Module &M);
 
@@ -78,7 +78,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit StripDeadDebugInfo()
-      : ModulePass(&ID) {}
+      : ModulePass(ID) {}
 
     virtual bool runOnModule(Module &M);
 
index 56896466c931eee0ee652bcaa70d0d879dd44653..aa470b954d6a5ad53fd635608cecba1238b5d7df 100644 (file)
@@ -50,7 +50,7 @@ namespace {
 
     virtual bool runOnSCC(CallGraphSCC &SCC);
     static char ID; // Pass identification, replacement for typeid
-    SRETPromotion() : CallGraphSCCPass(&ID) {}
+    SRETPromotion() : CallGraphSCCPass(ID) {}
 
   private:
     CallGraphNode *PromoteReturn(CallGraphNode *CGN);
index 24e052881a9d4378d752b27bdf46c01258c31ea3..6f9609cf997ba05352c3e460662ad5b0945d093a 100644 (file)
@@ -81,7 +81,7 @@ public:
   BuilderTy *Builder;
       
   static char ID; // Pass identification, replacement for typeid
-  InstCombiner() : FunctionPass(&ID), TD(0), Builder(0) {}
+  InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {}
 
 public:
   virtual bool runOnFunction(Function &F);
index e5cd1f0ef423b20e140a2705996404901cf08d1d..a77d70cd1c1bc45ea0d86c68c937bb560ca902c4 100644 (file)
@@ -34,7 +34,7 @@ namespace {
     bool runOnModule(Module &M);
   public:
     static char ID; // Pass identification, replacement for typeid
-    EdgeProfiler() : ModulePass(&ID) {}
+    EdgeProfiler() : ModulePass(ID) {}
 
     virtual const char *getPassName() const {
       return "Edge Profiler";
index a6de60d2935744517508d8462b5f8c06125b369a..8eec9872812dc7a6478f1d7b7790960083b44de0 100644 (file)
@@ -36,7 +36,7 @@ namespace {
     bool runOnModule(Module &M);
   public:
     static char ID; // Pass identification, replacement for typeid
-    OptimalEdgeProfiler() : ModulePass(&ID) {}
+    OptimalEdgeProfiler() : ModulePass(ID) {}
 
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequiredID(ProfileEstimatorPassID);
index 20f90839c97da186d2f245f3fad3a1eaaf3d36d7..03187620d3d415e8d680e91b3f79acee91a8eaa1 100644 (file)
@@ -49,7 +49,7 @@ namespace {
 class ABCD : public FunctionPass {
  public:
   static char ID;  // Pass identification, replacement for typeid.
-  ABCD() : FunctionPass(&ID) {}
+  ABCD() : FunctionPass(ID) {}
 
   void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<SSI>();
index 4df1c7c8b8a0600715d3a8386db8252a3cb7ed87..ada086e9db766404980eca3732d9fb027cb95984 100644 (file)
@@ -33,7 +33,7 @@ STATISTIC(NumRemoved, "Number of instructions removed");
 namespace {
   struct ADCE : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    ADCE() : FunctionPass(&ID) {}
+    ADCE() : FunctionPass(ID) {}
     
     virtual bool runOnFunction(Function& F);
     
index 89fb64c58bfc724ad502cc8040f50dcab8cfcb8c..b144678c6a0eda03a7b9324329787f1e5f043ace 100644 (file)
@@ -41,7 +41,7 @@ STATISTIC(NumMoved, "Number of basic blocks moved");
 namespace {
   struct BlockPlacement : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    BlockPlacement() : FunctionPass(&ID) {}
+    BlockPlacement() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F);
 
index 0c14b521cadc0866281aee4414515dd814ccb381..823caceb2f854f2fd5a358bbaf7e138f740ca4f3 100644 (file)
@@ -54,7 +54,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit CodeGenPrepare(const TargetLowering *tli = 0)
-      : FunctionPass(&ID), TLI(tli) {}
+      : FunctionPass(ID), TLI(tli) {}
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
index 0e9d68cbe66741db29de6cfde9690de382986a54..a0ea369d0cadd06cfab1cb132d12365485ceb7c1 100644 (file)
@@ -34,7 +34,7 @@ STATISTIC(NumInstKilled, "Number of instructions killed");
 namespace {
   struct ConstantPropagation : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    ConstantPropagation() : FunctionPass(&ID) {}
+    ConstantPropagation() : FunctionPass(ID) {}
 
     bool runOnFunction(Function &F);
 
index 6baeceb5ee213edb49f141fba119de74c8a050b7..87ea8038356ae6b3b207bd30f57d27515307859a 100644 (file)
@@ -35,7 +35,7 @@ namespace {
   //
   struct DeadInstElimination : public BasicBlockPass {
     static char ID; // Pass identification, replacement for typeid
-    DeadInstElimination() : BasicBlockPass(&ID) {}
+    DeadInstElimination() : BasicBlockPass(ID) {}
     virtual bool runOnBasicBlock(BasicBlock &BB) {
       bool Changed = false;
       for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) {
@@ -70,7 +70,7 @@ namespace {
   //
   struct DCE : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    DCE() : FunctionPass(&ID) {}
+    DCE() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F);
 
index ce15f48958d37adb4860bc4b53e83c519a520a19..c8fd9d9fa5561b487f0b0f95cd9c7f4f5f539e25 100644 (file)
@@ -40,7 +40,7 @@ namespace {
     TargetData *TD;
 
     static char ID; // Pass identification, replacement for typeid
-    DSE() : FunctionPass(&ID) {}
+    DSE() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F) {
       bool Changed = false;
index 5894f8ff443541da96f4672660eb70b11b56f896..53dd06d24bb5b01cb34e30fb0f70a0043fa06982 100644 (file)
@@ -27,7 +27,7 @@ namespace {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
   public:
     static char ID; // Pass identification, replacement for typeid
-    explicit GEPSplitter() : FunctionPass(&ID) {}
+    explicit GEPSplitter() : FunctionPass(ID) {}
   };
 }
 
index 646aec317ed669276693c06728fbdc6cbc9d652e..42afd6d5dbca3e1c49359ef1dd755a990b99f710 100644 (file)
@@ -665,7 +665,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit GVN(bool noloads = false)
-      : FunctionPass(&ID), NoLoads(noloads), MD(0) { }
+      : FunctionPass(ID), NoLoads(noloads), MD(0) { }
 
   private:
     bool NoLoads;
index 13c6a972602f27540b2d0be1bd7e6efb70389016..af2eafc47cbf346f3811addb05bff5498a9a0714 100644 (file)
@@ -77,7 +77,7 @@ namespace {
   public:
 
     static char ID; // Pass identification, replacement for typeid
-    IndVarSimplify() : LoopPass(&ID) {}
+    IndVarSimplify() : LoopPass(ID) {}
 
     virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
 
index c826d66813d71b4a89173f44597b1cfe592525ae..c2caf48b76169ab455aeb23c274d40340257ad35 100644 (file)
@@ -79,7 +79,7 @@ namespace {
 #endif
   public:
     static char ID; // Pass identification
-    JumpThreading() : FunctionPass(&ID) {}
+    JumpThreading() : FunctionPass(ID) {}
 
     bool runOnFunction(Function &F);
     
index da9f0b1e395458b82cfb09e0aecb9ddb4ba3c1f8..964a3b2a9a52306a99e8c5a91197f0de11fe3e81 100644 (file)
@@ -66,7 +66,7 @@ DisablePromotion("disable-licm-promotion", cl::Hidden,
 namespace {
   struct LICM : public LoopPass {
     static char ID; // Pass identification, replacement for typeid
-    LICM() : LoopPass(&ID) {}
+    LICM() : LoopPass(ID) {}
 
     virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
 
index bd0e20718611c12d7da74aef2874681987e4130f..543dfc1cba0960402cac3c1794f60198b5591443 100644 (file)
@@ -28,7 +28,7 @@ namespace {
   class LoopDeletion : public LoopPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopDeletion() : LoopPass(&ID) {}
+    LoopDeletion() : LoopPass(ID) {}
     
     // Possibly eliminate loop L if it is dead.
     bool runOnLoop(Loop* L, LPPassManager& LPM);
index 4f1ac77c8de37ad04f94c99235f595d3eb99372e..a4336743a8f010e1b0156eae4242813496b82ef9 100644 (file)
@@ -74,7 +74,7 @@ namespace {
   class LoopIndexSplit : public LoopPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopIndexSplit() : LoopPass(&ID) {}
+    LoopIndexSplit() : LoopPass(ID) {}
 
     // Index split Loop L. Return true if loop is split.
     bool runOnLoop(Loop *L, LPPassManager &LPM);
index 6fecbb3a2806c92865ad39a1a313d5560fe67f5f..1e4bfa94be56946c08d2c6c7108f72531bda44b2 100644 (file)
@@ -35,7 +35,7 @@ namespace {
   class LoopRotate : public LoopPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopRotate() : LoopPass(&ID) {}
+    LoopRotate() : LoopPass(ID) {}
 
     // Rotate Loop L as many times as possible. Return true if
     // loop is rotated at least once.
index fd11e00df264945eb621cf67c1132ae32405aa16..f7b22a0966b370493d8ee17e231f9519c1f95a6d 100644 (file)
@@ -3751,7 +3751,7 @@ Pass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
 }
 
 LoopStrengthReduce::LoopStrengthReduce(const TargetLowering *tli)
-  : LoopPass(&ID), TLI(tli) {}
+  : LoopPass(ID), TLI(tli) {}
 
 void LoopStrengthReduce::getAnalysisUsage(AnalysisUsage &AU) const {
   // We split critical edges, so we change the CFG.  However, we do update
index 37ab3b0b5bcab2959cf9b8aff7c414bd895e1507..4ed2d4568724162fd148f85ce073857fd7851746 100644 (file)
@@ -43,7 +43,7 @@ namespace {
   class LoopUnroll : public LoopPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopUnroll() : LoopPass(&ID) {}
+    LoopUnroll() : LoopPass(ID) {}
 
     /// A magic value for use with the Threshold parameter to indicate
     /// that the loop unroll should be performed regardless of how much
index f30d1e850ee53b73d4dda46745d653c1aab29b68..717917e2cea9f7115bac50cc3d146bd639069ddc 100644 (file)
@@ -92,7 +92,7 @@ namespace {
   public:
     static char ID; // Pass ID, replacement for typeid
     explicit LoopUnswitch(bool Os = false) : 
-      LoopPass(&ID), OptimizeForSize(Os), redoLoop(false), 
+      LoopPass(ID), OptimizeForSize(Os), redoLoop(false), 
       currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL),
       loopPreheader(NULL) {}
 
index 6184da20afc346b995f32c1b520db7df056e8285..d51c212c5a45976eaab3d9789711241ad806ed37 100644 (file)
@@ -138,7 +138,7 @@ bool LowerAtomicIntrinsic(CallInst *CI) {
 
 struct LowerAtomic : public BasicBlockPass {
   static char ID;
-  LowerAtomic() : BasicBlockPass(&ID) {}
+  LowerAtomic() : BasicBlockPass(ID) {}
   bool runOnBasicBlock(BasicBlock &BB) {
     bool Changed = false;
     for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) {
index 7c0563b17588ed4d58349208b874a420a6cb71c6..24fae423d2f703584bd09e12caf895ec86e28a9c 100644 (file)
@@ -304,7 +304,7 @@ namespace {
     bool runOnFunction(Function &F);
   public:
     static char ID; // Pass identification, replacement for typeid
-    MemCpyOpt() : FunctionPass(&ID) {}
+    MemCpyOpt() : FunctionPass(ID) {}
 
   private:
     // This transformation requires dominator postdominator info
index e686c52fd8a01b9231e040b86e6f20a459da9823..b8afcc12d927d165e3e6aa82763932cdf73b96cc 100644 (file)
@@ -77,7 +77,7 @@ namespace {
     bool MadeChange;
   public:
     static char ID; // Pass identification, replacement for typeid
-    Reassociate() : FunctionPass(&ID) {}
+    Reassociate() : FunctionPass(ID) {}
 
     bool runOnFunction(Function &F);
 
index 13222ac22004e27f0c9336322b62ce0c4a9ce3f6..cf32930dd64cace0a0b7800f0746f405bfcc7bfa 100644 (file)
@@ -36,7 +36,7 @@ STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted");
 namespace {
   struct RegToMem : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    RegToMem() : FunctionPass(&ID) {}
+    RegToMem() : FunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequiredID(BreakCriticalEdgesID);
@@ -124,7 +124,7 @@ bool RegToMem::runOnFunction(Function &F) {
 
 // createDemoteRegisterToMemory - Provide an entry point to create this pass.
 //
-const PassInfo *const llvm::DemoteRegisterToMemoryID = &X;
+char &llvm::DemoteRegisterToMemoryID = RegToMem::ID;
 FunctionPass *llvm::createDemoteRegisterToMemoryPass() {
   return new RegToMem();
 }
index 82294dcd5fb3f4a36e30070282f86c9e82135970..5cf0abca4ccca0b8732c1be91c28324fe49cc4fb 100644 (file)
@@ -1586,7 +1586,7 @@ namespace {
   ///
   struct SCCP : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    SCCP() : FunctionPass(&ID) {}
+    SCCP() : FunctionPass(ID) {}
 
     // runOnFunction - Run the Sparse Conditional Constant Propagation
     // algorithm, and return true if the function was modified.
@@ -1702,7 +1702,7 @@ namespace {
   ///
   struct IPSCCP : public ModulePass {
     static char ID;
-    IPSCCP() : ModulePass(&ID) {}
+    IPSCCP() : ModulePass(ID) {}
     bool runOnModule(Module &M);
   };
 } // end anonymous namespace
index fa0a6972025eb011ecae5d112b982715db2554ca..68c2df1691e19c725c8ce8d4c18f50d732b61152 100644 (file)
@@ -51,7 +51,7 @@ STATISTIC(NumGlobals,   "Number of allocas copied from constant global");
 namespace {
   struct SROA : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    explicit SROA(signed T = -1) : FunctionPass(&ID) {
+    explicit SROA(signed T = -1) : FunctionPass(ID) {
       if (T == -1)
         SRThreshold = 128;
       else
index dad8f2aaec0acf1051925c3abbd2fa29872b1efe..df6ef2ee75b61860bd7f45658883b9a64222cc16 100644 (file)
@@ -42,7 +42,7 @@ STATISTIC(NumSimpl, "Number of blocks simplified");
 namespace {
   struct CFGSimplifyPass : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    CFGSimplifyPass() : FunctionPass(&ID) {}
+    CFGSimplifyPass() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F);
   };
index f8828842e0d426a40ad154298843f4556bb0289b..3ec70ec2e024f44ed49cc6cfc010a26d54cce349 100644 (file)
@@ -32,7 +32,7 @@ namespace {
     const TargetData *TD;
   public:
     static char ID; // Pass identification
-    SimplifyHalfPowrLibCalls() : FunctionPass(&ID) {}
+    SimplifyHalfPowrLibCalls() : FunctionPass(ID) {}
 
     bool runOnFunction(Function &F);
 
index 1fdd6f144a795607420d86576a3cf8a02a109208..d7ce53f3671530bbea4ec5f3429f14bcce1b4c41 100644 (file)
@@ -1237,7 +1237,7 @@ namespace {
     bool Modified;  // This is only used by doInitialization.
   public:
     static char ID; // Pass identification
-    SimplifyLibCalls() : FunctionPass(&ID), StrCpy(false), StrCpyChk(true) {}
+    SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) {}
     void InitOptimizations();
     bool runOnFunction(Function &F);
 
index 2448312673ba50a6e7c3c56ae923ef3aac2686b7..95d3dedfb62dbeece1b669f79499c7b9ae2befa5 100644 (file)
@@ -35,7 +35,7 @@ namespace {
 
   public:
     static char ID; // Pass identification
-    Sinking() : FunctionPass(&ID) {}
+    Sinking() : FunctionPass(ID) {}
     
     virtual bool runOnFunction(Function &F);
     
index 006ce90b376437238d20307267fff90356b1eb2e..2e437ac778c8c32b0a4f9d291f45b4e3a3158b4a 100644 (file)
@@ -49,7 +49,7 @@ namespace {
     bool runOnFunction(Function &F);
   public:
     static char ID; // Pass identification, replacement for typeid
-    TailDup() : FunctionPass(&ID) {}
+    TailDup() : FunctionPass(ID) {}
 
   private:
     inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned);
index 5b105e4c0c25c3f7065e81123e6dbacf80311ccd..e197b528f8ee0e9b9a20b64673b091e60386f89c 100644 (file)
@@ -72,7 +72,7 @@ STATISTIC(NumAccumAdded, "Number of accumulators introduced");
 namespace {
   struct TailCallElim : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    TailCallElim() : FunctionPass(&ID) {}
+    TailCallElim() : FunctionPass(ID) {}
 
     virtual bool runOnFunction(Function &F);
 
index baa114b099e579182101f9565ae0007fa085ea94..424d8785c1de972e97a11d32146b8f322a1f6513 100644 (file)
@@ -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();
 }
index 090af95c4b87b7734e0153dfe17d789004246dc4..81a7101188e2f15bfaa0057c34e85f000e76fd21 100644 (file)
@@ -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.
index d380e0dbc10fcb1a059a94fcf02e2aecdb094c2f..bf3695d2c8344d54a6c4b5065e329e46b8218626 100644 (file)
@@ -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
index 1571fe8f0b36ed70af9871939dcd9f6b276eea7b..16902ff91505cdf0182ad9286549175f698dc4df 100644 (file)
@@ -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
index 2696e6913f3bfa54fd04966bdd5f46ed1536e131..f239a9970d834be2b5869bc9d38b530a338f1a28 100644 (file)
@@ -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) {
index 468a5fe4c5e5dc709083bceec5088fb6d15c2e9e..1910fd9e5205a589f7884a1b309f02b83bcca041 100644 (file)
@@ -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();
index 99203b662120eaa697ee6a243d2b76122d810010..13dda65a6b088e3158fa4f9de8cb17ebe32cd2e7 100644 (file)
@@ -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() {
index 62a93e4e99110f10247679877e4a1920a4a60aea..81523d3bdc8a85643461c3872959a0f918ae1e50 100644 (file)
@@ -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);
 
index 5a176d59f9b868ac927d991ccc3a8fd365311fb9..fb23fbfbe15e5f52590074541ee216eb855f6636 100644 (file)
@@ -36,14 +36,7 @@ using namespace llvm;
 // Pass Implementation
 //
 
-Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) {
-  assert(pid && "pid cannot be 0");
-}
-
-Pass::Pass(PassKind K, const void *pid)
-  : Resolver(0), PassID((intptr_t)pid), Kind(K) {
-  assert(pid && "pid cannot be 0");
-}
+Pass::Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { }
 
 // Force out-of-line virtual method.
 Pass::~Pass() { 
@@ -62,8 +55,8 @@ PassManagerType ModulePass::getPotentialPassManagerType() const {
   return PMT_ModulePassManager;
 }
 
-bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
-  return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0;
+bool Pass::mustPreserveAnalysisID(char &AID) const {
+  return Resolver->getAnalysisIfAvailable(&AID, true) != 0;
 }
 
 // dumpPassStructure - Implement the -debug-passes=Structure option
@@ -76,7 +69,9 @@ void Pass::dumpPassStructure(unsigned Offset) {
 /// Registration templates, but can be overloaded directly.
 ///
 const char *Pass::getPassName() const {
-  if (const PassInfo *PI = getPassInfo())
+  AnalysisID AID =  getPassID();
+  const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID);
+  if (PI)
     return PI->getPassName();
   return "Unnamed pass: implement Pass::getPassName()";
 }
@@ -102,7 +97,7 @@ void Pass::verifyAnalysis() const {
   // By default, don't do anything.
 }
 
-void *Pass::getAdjustedAnalysisPointer(const PassInfo *) {
+void *Pass::getAdjustedAnalysisPointer(AnalysisID AID) {
   return this;
 }
 
@@ -234,13 +229,7 @@ PassManagerType BasicBlockPass::getPotentialPassManagerType() const {
   return PMT_BasicBlockPassManager; 
 }
 
-// getPassInfo - Return the PassInfo data structure that corresponds to this
-// pass...
-const PassInfo *Pass::getPassInfo() const {
-  return lookupPassInfo(PassID);
-}
-
-const PassInfo *Pass::lookupPassInfo(intptr_t TI) {
+const PassInfo *Pass::lookupPassInfo(const void *TI) {
   return PassRegistry::getPassRegistry()->getPassInfo(TI);
 }
 
@@ -262,8 +251,8 @@ Pass *PassInfo::createPass() const {
 
 // RegisterAGBase implementation
 //
-RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID,
-                               intptr_t PassID, bool isDefault)
+RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID,
+                               const void *PassID, bool isDefault)
     : PassInfo(Name, InterfaceID) {
   PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID,
                                                          *this, isDefault);
@@ -306,7 +295,7 @@ namespace {
     
     void passEnumerate(const PassInfo *P) {
       if (P->isCFGOnlyPass())
-        CFGOnlyList.push_back(P);
+        CFGOnlyList.push_back(P->getTypeInfo());
     }
   };
 }
@@ -326,15 +315,25 @@ void AnalysisUsage::setPreservesCFG() {
   GetCFGOnlyPasses(Preserved).enumeratePasses();
 }
 
-AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) {
-  assert(ID && "Pass class not registered!");
-  Required.push_back(ID);
+AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) {
+  const PassInfo *PI = Pass::lookupPassInfo(Arg);
+  // If the pass exists, preserve it. Otherwise silently do nothing.
+  if (PI) Preserved.push_back(PI->getTypeInfo());
   return *this;
 }
 
-AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) {
-  assert(ID && "Pass class not registered!");
+AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) {
   Required.push_back(ID);
-  RequiredTransitive.push_back(ID);
+  return *this;
+}
+
+AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) {
+  Required.push_back(&ID);
+  return *this;
+}
+
+AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) {
+  Required.push_back(&ID);
+  RequiredTransitive.push_back(&ID);
   return *this;
 }
index 296b0d13a710b8bcf1ced3582e924611e21b4d49..675fb2cafe9a7e27905ecf32360e0d6068a75e01 100644 (file)
@@ -82,15 +82,17 @@ PrintAfterAll("print-after-all",
 /// This is a helper to determine whether to print IR before or
 /// after a pass.
 
-static bool ShouldPrintBeforeOrAfterPass(Pass *P,
+static bool ShouldPrintBeforeOrAfterPass(const void *PassID,
                                          PassOptionList &PassesToPrint) {
-  for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) {
-    const llvm::PassInfo *PassInf = PassesToPrint[i];
-    if (PassInf && P->getPassInfo())
-      if (PassInf->getPassArgument() ==
-          P->getPassInfo()->getPassArgument()) {
-        return true;
-      }
+  if (const llvm::PassInfo *PI =
+      PassRegistry::getPassRegistry()->getPassInfo(PassID)) {
+    for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) {
+      const llvm::PassInfo *PassInf = PassesToPrint[i];
+      if (PassInf)
+        if (PassInf->getPassArgument() == PI->getPassArgument()) {
+          return true;
+        }
+    }
   }
   return false;
 }
@@ -98,14 +100,14 @@ static bool ShouldPrintBeforeOrAfterPass(Pass *P,
 
 /// This is a utility to check whether a pass should have IR dumped
 /// before it.
-static bool ShouldPrintBeforePass(Pass *P) {
-  return PrintBeforeAll || ShouldPrintBeforeOrAfterPass(P, PrintBefore);
+static bool ShouldPrintBeforePass(const void *PassID) {
+  return PrintBeforeAll || ShouldPrintBeforeOrAfterPass(PassID, PrintBefore);
 }
 
 /// This is a utility to check whether a pass should have IR dumped
 /// after it.
-static bool ShouldPrintAfterPass(Pass *P) {
-  return PrintAfterAll || ShouldPrintBeforeOrAfterPass(P, PrintAfter);
+static bool ShouldPrintAfterPass(const void *PassID) {
+  return PrintAfterAll || ShouldPrintBeforeOrAfterPass(PassID, PrintAfter);
 }
 
 } // End of llvm namespace
@@ -163,7 +165,7 @@ class BBPassManager : public PMDataManager, public FunctionPass {
 public:
   static char ID;
   explicit BBPassManager(int Depth) 
-    : PMDataManager(Depth), FunctionPass(&ID) {}
+    : PMDataManager(Depth), FunctionPass(ID) {}
 
   /// Execute all of the passes scheduled for execution.  Keep track of
   /// whether any of the passes modifies the function, and if so, return true.
@@ -224,7 +226,7 @@ private:
 public:
   static char ID;
   explicit FunctionPassManagerImpl(int Depth) : 
-    Pass(PT_PassManager, &ID), PMDataManager(Depth), 
+    Pass(PT_PassManager, ID), PMDataManager(Depth), 
     PMTopLevelManager(TLM_Function), wasRun(false) { }
 
   /// add - Add a pass to the queue of passes to run.  This passes ownership of
@@ -298,7 +300,7 @@ class MPPassManager : public Pass, public PMDataManager {
 public:
   static char ID;
   explicit MPPassManager(int Depth) :
-    Pass(PT_PassManager, &ID), PMDataManager(Depth) { }
+    Pass(PT_PassManager, ID), PMDataManager(Depth) { }
 
   // Delete on the fly managers.
   virtual ~MPPassManager() {
@@ -332,7 +334,7 @@ public:
   /// Return function pass corresponding to PassInfo PI, that is 
   /// required by module pass MP. Instantiate analysis pass, by using
   /// its runOnFunction() for function F.
-  virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F);
+  virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F);
 
   virtual const char *getPassName() const {
     return "Module Pass Manager";
@@ -383,7 +385,7 @@ class PassManagerImpl : public Pass,
 public:
   static char ID;
   explicit PassManagerImpl(int Depth) :
-    Pass(PT_PassManager, &ID), PMDataManager(Depth),
+    Pass(PT_PassManager, ID), PMDataManager(Depth),
                                PMTopLevelManager(TLM_Pass) { }
 
   /// add - Add a pass to the queue of passes to run.  This passes ownership of
@@ -568,8 +570,9 @@ void PMTopLevelManager::schedulePass(Pass *P) {
   // If P is an analysis pass and it is available then do not
   // generate the analysis again. Stale analysis info should not be
   // available at this point.
-  if (P->getPassInfo() &&
-      P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo())) {
+  const PassInfo *PI =
+    PassRegistry::getPassRegistry()->getPassInfo(P->getPassID());
+  if (PI && PI->isAnalysis() && findAnalysisPass(P->getPassID())) {
     delete P;
     return;
   }
@@ -586,7 +589,8 @@ void PMTopLevelManager::schedulePass(Pass *P) {
       
       Pass *AnalysisPass = findAnalysisPass(*I);
       if (!AnalysisPass) {
-        AnalysisPass = (*I)->createPass();
+        const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I);
+        AnalysisPass = PI->createPass();
         if (P->getPotentialPassManagerType () ==
             AnalysisPass->getPotentialPassManagerType())
           // Schedule analysis pass that is managed by the same pass manager.
@@ -632,16 +636,21 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
 
   for (SmallVector<ImmutablePass *, 8>::iterator I = ImmutablePasses.begin(),
          E = ImmutablePasses.end(); P == NULL && I != E; ++I) {
-    const PassInfo *PI = (*I)->getPassInfo();
+    AnalysisID PI = (*I)->getPassID();
     if (PI == AID)
       P = *I;
 
     // If Pass not found then check the interfaces implemented by Immutable Pass
     if (!P) {
+      const PassInfo *PassInf =
+        PassRegistry::getPassRegistry()->getPassInfo(PI);
       const std::vector<const PassInfo*> &ImmPI =
-        PI->getInterfacesImplemented();
-      if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end())
-        P = *I;
+        PassInf->getInterfacesImplemented();
+      for (std::vector<const PassInfo*>::const_iterator II = ImmPI.begin(),
+           EE = ImmPI.end(); II != EE; ++II) {
+        if ((*II)->getTypeInfo() == AID)
+          P = *I;
+      }
     }
   }
 
@@ -724,16 +733,19 @@ PMTopLevelManager::~PMTopLevelManager() {
 
 /// Augement AvailableAnalysis by adding analysis made available by pass P.
 void PMDataManager::recordAvailableAnalysis(Pass *P) {
-  const PassInfo *PI = P->getPassInfo();
-  if (PI == 0) return;
+  AnalysisID PI = P->getPassID();
   
   AvailableAnalysis[PI] = P;
+  
+  assert(AvailableAnalysis.size());
 
   //This pass is the current implementation of all of the interfaces it
   //implements as well.
-  const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
+  const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI);
+  if (PInf == 0) return;
+  const std::vector<const PassInfo*> &II = PInf->getInterfacesImplemented();
   for (unsigned i = 0, e = II.size(); i != e; ++i)
-    AvailableAnalysis[II[i]] = P;
+    AvailableAnalysis[II[i]->getTypeInfo()] = P;
 }
 
 // Return true if P preserves high level analysis used by other
@@ -749,7 +761,7 @@ bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
     Pass *P1 = *I;
     if (P1->getAsImmutablePass() == 0 &&
         std::find(PreservedSet.begin(), PreservedSet.end(),
-                  P1->getPassInfo()) == 
+                  P1->getPassID()) == 
            PreservedSet.end())
       return false;
   }
@@ -799,7 +811,7 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
       AvailableAnalysis.erase(Info);
     }
   }
-
+  
   // Check inherited analysis also. If P is not preserving analysis
   // provided by parent manager then remove it here.
   for (unsigned Index = 0; Index < PMT_Last; ++Index) {
@@ -861,16 +873,17 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
     P->releaseMemory();
   }
 
-  if (const PassInfo *PI = P->getPassInfo()) {
+  AnalysisID PI = P->getPassID();
+  if (const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI)) {
     // Remove the pass itself (if it is not already removed).
     AvailableAnalysis.erase(PI);
 
     // Remove all interfaces this pass implements, for which it is also
     // listed as the available implementation.
-    const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
+    const std::vector<const PassInfo*> &II = PInf->getInterfacesImplemented();
     for (unsigned i = 0, e = II.size(); i != e; ++i) {
       std::map<AnalysisID, Pass*>::iterator Pos =
-        AvailableAnalysis.find(II[i]);
+        AvailableAnalysis.find(II[i]->getTypeInfo());
       if (Pos != AvailableAnalysis.end() && Pos->second == P)
         AvailableAnalysis.erase(Pos);
     }
@@ -941,7 +954,8 @@ void PMDataManager::add(Pass *P, bool ProcessAnalysis) {
   for (SmallVector<AnalysisID, 8>::iterator 
          I = ReqAnalysisNotAvailable.begin(), 
          E = ReqAnalysisNotAvailable.end() ;I != E; ++I) {
-    Pass *AnalysisPass = (*I)->createPass();
+    const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I);
+    Pass *AnalysisPass = PI->createPass();
     this->addLowerLevelRequiredPass(P, AnalysisPass);
   }
 
@@ -1044,7 +1058,8 @@ void PMDataManager::dumpPassArguments() const {
     if (PMDataManager *PMD = (*I)->getAsPMDataManager())
       PMD->dumpPassArguments();
     else
-      if (const PassInfo *PI = (*I)->getPassInfo())
+      if (const PassInfo *PI =
+            PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID()))
         if (!PI->isAnalysisGroup())
           dbgs() << " -" << PI->getPassArgument();
   }
@@ -1116,7 +1131,8 @@ void PMDataManager::dumpAnalysisUsage(StringRef Msg, const Pass *P,
   dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:";
   for (unsigned i = 0; i != Set.size(); ++i) {
     if (i) dbgs() << ',';
-    dbgs() << ' ' << Set[i]->getPassName();
+    const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]);
+    dbgs() << ' ' << PInf->getPassName();
   }
   dbgs() << '\n';
 }
@@ -1147,7 +1163,7 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
   llvm_unreachable("Unable to schedule pass");
 }
 
-Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
+Pass *PMDataManager::getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F) {
   assert(0 && "Unable to find on the fly pass");
   return NULL;
 }
@@ -1166,7 +1182,7 @@ Pass *AnalysisResolver::getAnalysisIfAvailable(AnalysisID ID, bool dir) const {
   return PM.findAnalysisPass(ID, dir);
 }
 
-Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI, 
+Pass *AnalysisResolver::findImplPass(Pass *P, AnalysisID AnalysisPI, 
                                      Function &F) {
   return PM.getOnTheFlyPass(P, AnalysisPI, F);
 }
@@ -1288,15 +1304,16 @@ void FunctionPassManager::addImpl(Pass *P) {
 /// This implies that all passes MUST be allocated with 'new'.
 void FunctionPassManager::add(Pass *P) { 
   // If this is a not a function pass, don't add a printer for it.
+  const void *PassID = P->getPassID();
   if (P->getPassKind() == PT_Function)
-    if (ShouldPrintBeforePass(P))
+    if (ShouldPrintBeforePass(PassID))
       addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump Before ")
                                    + P->getPassName() + " ***"));
 
   addImpl(P);
 
   if (P->getPassKind() == PT_Function)
-    if (ShouldPrintAfterPass(P))
+    if (ShouldPrintAfterPass(PassID))
       addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump After ")
                                    + P->getPassName() + " ***"));
 }
@@ -1561,7 +1578,7 @@ void MPPassManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
 /// Return function pass corresponding to PassInfo PI, that is 
 /// required by module pass MP. Instantiate analysis pass, by using
 /// its runOnFunction() for function F.
-Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F){
+Pass* MPPassManager::getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F){
   FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP];
   assert(FPP && "Unable to find on the fly pass");
   
@@ -1614,13 +1631,14 @@ void PassManager::addImpl(Pass *P) {
 /// will be destroyed as well, so there is no need to delete the pass.  This
 /// implies that all passes MUST be allocated with 'new'.
 void PassManager::add(Pass *P) {
-  if (ShouldPrintBeforePass(P))
+  const void* PassID = P->getPassID();
+  if (ShouldPrintBeforePass(PassID))
     addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump Before ")
                                  + P->getPassName() + " ***"));
 
   addImpl(P);
 
-  if (ShouldPrintAfterPass(P))
+  if (ShouldPrintAfterPass(PassID))
     addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump After ")
                                  + P->getPassName() + " ***"));
 }
index 844d82660b4241dcb988fdc1788c485b7c70e0e6..21dba56aad728725c2558fda00eb1098840d9e96 100644 (file)
@@ -60,7 +60,7 @@ ManagedCleanup<&cleanupPassRegistry> registryCleanup ATTRIBUTE_USED;
 
 }
 
-const PassInfo *PassRegistry::getPassInfo(intptr_t TI) const {
+const PassInfo *PassRegistry::getPassInfo(const void *TI) const {
   sys::SmartScopedLock<true> Guard(Lock);
   MapType::const_iterator I = PassInfoMap.find(TI);
   return I != PassInfoMap.end() ? I->second : 0;
@@ -108,8 +108,8 @@ void PassRegistry::enumerateWith(PassRegistrationListener *L) {
 
 
 /// Analysis Group Mechanisms.
-void PassRegistry::registerAnalysisGroup(intptr_t InterfaceID, 
-                                         intptr_t PassID,
+void PassRegistry::registerAnalysisGroup(const void *InterfaceID, 
+                                         const void *PassID,
                                          PassInfo& Registeree,
                                          bool isDefault) {
   PassInfo *InterfaceInfo =  const_cast<PassInfo*>(getPassInfo(InterfaceID));
index 7baacf71ceb4e459030288d1a3c0914bb262a3eb..415309e52fa9c54aba59467f1ae6bdc453da51d1 100644 (file)
@@ -28,10 +28,10 @@ namespace {
     bool DeleteStream;      // Delete the ostream in our dtor?
   public:
     static char ID;
-    PrintModulePass() : ModulePass(&ID), Out(&dbgs()), 
+    PrintModulePass() : ModulePass(ID), Out(&dbgs()), 
       DeleteStream(false) {}
     PrintModulePass(const std::string &B, raw_ostream *o, bool DS)
-        : ModulePass(&ID), Banner(B), Out(o), DeleteStream(DS) {}
+        : ModulePass(ID), Banner(B), Out(o), DeleteStream(DS) {}
     
     ~PrintModulePass() {
       if (DeleteStream) delete Out;
@@ -53,10 +53,10 @@ namespace {
     bool DeleteStream;      // Delete the ostream in our dtor?
   public:
     static char ID;
-    PrintFunctionPass() : FunctionPass(&ID), Banner(""), Out(&dbgs()), 
+    PrintFunctionPass() : FunctionPass(ID), Banner(""), Out(&dbgs()), 
                           DeleteStream(false) {}
     PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS)
-      : FunctionPass(&ID), Banner(B), Out(o), DeleteStream(DS) {}
+      : FunctionPass(ID), Banner(B), Out(o), DeleteStream(DS) {}
     
     inline ~PrintFunctionPass() {
       if (DeleteStream) delete Out;
index 4de1282caf9b3edd80f9ef429141b0331107abd5..52fd134d488d3ba6cad86c14b7ef492557d08d37 100644 (file)
@@ -72,7 +72,7 @@ namespace {  // Anonymous namespace for class
   struct PreVerifier : public FunctionPass {
     static char ID; // Pass ID, replacement for typeid
 
-    PreVerifier() : FunctionPass(&ID) { }
+    PreVerifier() : FunctionPass(ID) { }
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
@@ -104,7 +104,7 @@ namespace {  // Anonymous namespace for class
 char PreVerifier::ID = 0;
 static RegisterPass<PreVerifier>
 PreVer("preverify", "Preliminary module verification");
-static const PassInfo *const PreVerifyID = &PreVer;
+char &PreVerifyID = PreVerifier::ID;
 
 namespace {
   class TypeSet : public AbstractTypeUser {
@@ -182,20 +182,20 @@ namespace {
     SmallPtrSet<MDNode *, 32> MDNodes;
 
     Verifier()
-      : FunctionPass(&ID), 
+      : FunctionPass(ID), 
       Broken(false), RealPass(true), action(AbortProcessAction),
       Mod(0), Context(0), DT(0), MessagesStr(Messages) {}
     explicit Verifier(VerifierFailureAction ctn)
-      : FunctionPass(&ID), 
+      : FunctionPass(ID), 
       Broken(false), RealPass(true), action(ctn), Mod(0), Context(0), DT(0),
       MessagesStr(Messages) {}
     explicit Verifier(bool AB)
-      : FunctionPass(&ID), 
+      : FunctionPass(ID), 
       Broken(false), RealPass(true),
       action( AB ? AbortProcessAction : PrintMessageAction), Mod(0),
       Context(0), DT(0), MessagesStr(Messages) {}
     explicit Verifier(DominatorTree &dt)
-      : FunctionPass(&ID), 
+      : FunctionPass(ID), 
       Broken(false), RealPass(false), action(PrintMessageAction), Mod(0),
       Context(0), DT(&dt), MessagesStr(Messages) {}
 
index 6913fd06a938ee2122734d5d96c0a6e0d22fa81a..bbdc728890db566e84d0d10d2747fbfe9bc9537b 100644 (file)
@@ -100,7 +100,8 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I,
 }
 
 static const PassInfo *getPI(Pass *P) {
-  const PassInfo *PI = P->getPassInfo();
+  const void *ID = P->getPassID();
+  const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
   delete P;
   return PI;
 }
index 900bf632a83bb1552d527469c1b3cb27bf8d6d39..4ae23f5b762428d4faada3663a74de58f940516f 100644 (file)
@@ -27,7 +27,7 @@ namespace {
   class CrashOnCalls : public BasicBlockPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    CrashOnCalls() : BasicBlockPass(&ID) {}
+    CrashOnCalls() : BasicBlockPass(ID) {}
   private:
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
@@ -54,7 +54,7 @@ namespace {
   class DeleteCalls : public BasicBlockPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    DeleteCalls() : BasicBlockPass(&ID) {}
+    DeleteCalls() : BasicBlockPass(ID) {}
   private:
     bool runOnBasicBlock(BasicBlock &BB) {
       for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
index ba5234bdc89d52f7659eddef22ce4db3d696ed8c..b4bc455db122ac1c13df59ad1547d92bcef49b29 100644 (file)
@@ -90,7 +90,8 @@ namespace {
     AddToDriver(BugDriver &_D) : D(_D) {}
     
     virtual void add(Pass *P) {
-      const PassInfo *PI = P->getPassInfo();
+      const void *ID = P->getPassID();
+      const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
       D.addPasses(&PI, &PI + 1);
     }
   };
index 88adeb43e6de35390d500cef99c5e8d58786a563..0c6c4d7bb7826a4f9e657248252a192f342b15d5 100644 (file)
@@ -128,7 +128,7 @@ namespace {
   public:
     static char ID; // Class identification, replacement for typeinfo.
     explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL) 
-      : ModulePass(&ID), PIL(_PIL) {}
+      : ModulePass(ID), PIL(_PIL) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index a4891d8d767c1689211c1c6c1aafe7b2c9854a82..2fe5d226ec761658ac2e5aeda4805166eeab5c41 100644 (file)
@@ -31,7 +31,7 @@ namespace {
   /// or handle in alias analyses.
   struct ExternalFunctionsPassedConstants : public ModulePass {
     static char ID; // Pass ID, replacement for typeid
-    ExternalFunctionsPassedConstants() : ModulePass(&ID) {}
+    ExternalFunctionsPassedConstants() : ModulePass(ID) {}
     virtual bool runOnModule(Module &M) {
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
         if (!I->isDeclaration()) continue;
@@ -74,7 +74,7 @@ namespace {
 
   struct CallGraphPrinter : public ModulePass {
     static char ID; // Pass ID, replacement for typeid
-    CallGraphPrinter() : ModulePass(&ID) {}
+    CallGraphPrinter() : ModulePass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index e7c6d1e6af8579fadf56656d1a860ccddd838d16..fa4339a0554e6eeca5b026d7dc8a3de59acb81d8 100644 (file)
@@ -65,7 +65,7 @@ namespace llvm {
 namespace {
   struct CallGraphPrinter : public ModulePass {
     static char ID; // Pass ID, replacement for typeid
-    CallGraphPrinter() : ModulePass(&ID) {}
+    CallGraphPrinter() : ModulePass(ID) {}
 
     virtual bool runOnModule(Module &M) {
       WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis<CallGraph>());
@@ -93,7 +93,7 @@ namespace {
   class DomInfoPrinter : public FunctionPass {
   public:
     static char ID; // Pass identification, replacement for typeid
-    DomInfoPrinter() : FunctionPass(&ID) {}
+    DomInfoPrinter() : FunctionPass(ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
index ea486ca2900057c5490e9965900b78da6b849040..067c2038f76a90bc57fba12617b34559545517da 100644 (file)
@@ -36,7 +36,7 @@ using namespace llvm;
 namespace {
   struct CFGSCC : public FunctionPass {
     static char ID;  // Pass identification, replacement for typeid
-    CFGSCC() : FunctionPass(&ID) {}
+    CFGSCC() : FunctionPass(ID) {}
     bool runOnFunction(Function& func);
 
     void print(raw_ostream &O, const Module* = 0) const { }
@@ -48,7 +48,7 @@ namespace {
 
   struct CallGraphSCC : public ModulePass {
     static char ID;  // Pass identification, replacement for typeid
-    CallGraphSCC() : ModulePass(&ID) {}
+    CallGraphSCC() : ModulePass(ID) {}
 
     // run - Print out SCCs in the call graph for the specified module.
     bool runOnModule(Module &M);
index 0878737d34bc5068fd51f53b7a50fb38eb6183f9..f6b829fde935366d0fe0662aa698cb5379ffe515 100644 (file)
@@ -139,7 +139,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
   static char ID;
   const PassInfo *PassToPrint;
   CallGraphSCCPassPrinter(const PassInfo *PI) :
-    CallGraphSCCPass(&ID), PassToPrint(PI) {}
+    CallGraphSCCPass(ID), PassToPrint(PI) {}
 
   virtual bool runOnSCC(CallGraphSCC &SCC) {
     if (!Quiet) {
@@ -148,7 +148,8 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
       for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
         Function *F = (*I)->getFunction();
         if (F)
-          getAnalysisID<Pass>(PassToPrint).print(outs(), F->getParent());
+          getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), 
+                F->getParent());
       }
     }
     // Get and print pass...
@@ -158,7 +159,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
   virtual const char *getPassName() const { return "'Pass' Printer"; }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredID(PassToPrint);
+    AU.addRequiredID(PassToPrint->getTypeInfo());
     AU.setPreservesAll();
   }
 };
@@ -168,13 +169,13 @@ char CallGraphSCCPassPrinter::ID = 0;
 struct ModulePassPrinter : public ModulePass {
   static char ID;
   const PassInfo *PassToPrint;
-  ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID),
+  ModulePassPrinter(const PassInfo *PI) : ModulePass(ID),
                                           PassToPrint(PI) {}
 
   virtual bool runOnModule(Module &M) {
     if (!Quiet) {
       outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
-      getAnalysisID<Pass>(PassToPrint).print(outs(), &M);
+      getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), &M);
     }
 
     // Get and print pass...
@@ -184,7 +185,7 @@ struct ModulePassPrinter : public ModulePass {
   virtual const char *getPassName() const { return "'Pass' Printer"; }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredID(PassToPrint);
+    AU.addRequiredID(PassToPrint->getTypeInfo());
     AU.setPreservesAll();
   }
 };
@@ -193,7 +194,7 @@ char ModulePassPrinter::ID = 0;
 struct FunctionPassPrinter : public FunctionPass {
   const PassInfo *PassToPrint;
   static char ID;
-  FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID),
+  FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID),
                                             PassToPrint(PI) {}
 
   virtual bool runOnFunction(Function &F) {
@@ -202,14 +203,15 @@ struct FunctionPassPrinter : public FunctionPass {
               << "' for function '" << F.getName() << "':\n";
     }
     // Get and print pass...
-    getAnalysisID<Pass>(PassToPrint).print(outs(), F.getParent());
+    getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(),
+            F.getParent());
     return false;
   }
 
   virtual const char *getPassName() const { return "FunctionPass Printer"; }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredID(PassToPrint);
+    AU.addRequiredID(PassToPrint->getTypeInfo());
     AU.setPreservesAll();
   }
 };
@@ -220,12 +222,12 @@ struct LoopPassPrinter : public LoopPass {
   static char ID;
   const PassInfo *PassToPrint;
   LoopPassPrinter(const PassInfo *PI) :
-    LoopPass(&ID), PassToPrint(PI) {}
+    LoopPass(ID), PassToPrint(PI) {}
 
   virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
     if (!Quiet) {
       outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
-      getAnalysisID<Pass>(PassToPrint).print(outs(),
+      getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(),
                                   L->getHeader()->getParent()->getParent());
     }
     // Get and print pass...
@@ -235,7 +237,7 @@ struct LoopPassPrinter : public LoopPass {
   virtual const char *getPassName() const { return "'Pass' Printer"; }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredID(PassToPrint);
+    AU.addRequiredID(PassToPrint->getTypeInfo());
     AU.setPreservesAll();
   }
 };
@@ -246,7 +248,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
   const PassInfo *PassToPrint;
   static char ID;
   BasicBlockPassPrinter(const PassInfo *PI)
-    : BasicBlockPass(&ID), PassToPrint(PI) {}
+    : BasicBlockPass(ID), PassToPrint(PI) {}
 
   virtual bool runOnBasicBlock(BasicBlock &BB) {
     if (!Quiet) {
@@ -255,14 +257,15 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
     }
 
     // Get and print pass...
-    getAnalysisID<Pass>(PassToPrint).print(outs(), BB.getParent()->getParent());
+    getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), 
+            BB.getParent()->getParent());
     return false;
   }
 
   virtual const char *getPassName() const { return "BasicBlockPass Printer"; }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredID(PassToPrint);
+    AU.addRequiredID(PassToPrint->getTypeInfo());
     AU.setPreservesAll();
   }
 };
index cabfc44602cf00a95b34a77dffd143f9d1994bf7..96ee5b45896060d4b8abd7ecf26898907d2702f6 100644 (file)
@@ -40,7 +40,7 @@ namespace llvm {
     public:
       static char run;
       static char ID;
-      ModuleNDNM() : ModulePass(&ID) {}
+      ModuleNDNM() : ModulePass(ID) {}
       virtual bool runOnModule(Module &M) {
         run++;
         return false;
@@ -56,7 +56,7 @@ namespace llvm {
     public:
       static char run;
       static char ID;
-      ModuleNDM() : ModulePass(&ID) {}
+      ModuleNDM() : ModulePass(ID) {}
       virtual bool runOnModule(Module &M) {
         run++;
         return true;
@@ -70,7 +70,7 @@ namespace llvm {
     public:
       static char run;
       static char ID;
-      ModuleNDM2() : ModulePass(&ID) {}
+      ModuleNDM2() : ModulePass(ID) {}
       virtual bool runOnModule(Module &M) {
         run++;
         return true;
@@ -83,7 +83,7 @@ namespace llvm {
     public:
       static char run;
       static char ID;
-      ModuleDNM() : ModulePass(&ID) {}
+      ModuleDNM() : ModulePass(ID) {}
       virtual bool runOnModule(Module &M) {
         EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
         run++;
@@ -119,7 +119,7 @@ namespace llvm {
         EXPECT_TRUE(finalized);
         EXPECT_EQ(run, runc);
       }
-      PassTestBase() : P(&ID), allocated(0) {
+      PassTestBase() : P(ID), allocated(0) {
         initialized = false;
         finalized = false;
         runc = 0;
@@ -253,7 +253,7 @@ namespace llvm {
     struct OnTheFlyTest: public ModulePass {
     public:
       static char ID;
-      OnTheFlyTest() : ModulePass(&ID) {}
+      OnTheFlyTest() : ModulePass(ID) {}
       virtual bool runOnModule(Module &M) {
         EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
         for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) {