From e1f9be27bc9426678f8b84b1bcc98084e479828b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 4 Sep 2008 17:05:41 +0000 Subject: [PATCH] Tidy up several unbeseeming casts from pointer to intptr_t. llvm-svn: 55779 --- include/llvm/Analysis/Dominators.h | 6 +++--- include/llvm/Analysis/FindUsedTypes.h | 2 +- include/llvm/Analysis/IntervalPartition.h | 2 +- include/llvm/Analysis/LoopPass.h | 1 + include/llvm/Analysis/MemoryDependenceAnalysis.h | 2 +- include/llvm/Analysis/PostDominators.h | 4 ++-- include/llvm/Analysis/ScalarEvolution.h | 2 +- include/llvm/CallGraphSCCPass.h | 1 + include/llvm/CodeGen/LiveIntervalAnalysis.h | 2 +- include/llvm/CodeGen/LiveStackAnalysis.h | 2 +- include/llvm/CodeGen/LiveVariables.h | 2 +- include/llvm/CodeGen/MachineFunctionPass.h | 1 + include/llvm/Transforms/IPO/InlinerPass.h | 4 ++-- include/llvm/Transforms/RSProfiling.h | 2 +- include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h | 2 +- lib/Analysis/AliasAnalysisCounter.cpp | 2 +- lib/Analysis/AliasAnalysisEvaluator.cpp | 2 +- lib/Analysis/AliasDebugger.cpp | 2 +- lib/Analysis/AliasSetTracker.cpp | 2 +- lib/Analysis/BasicAliasAnalysis.cpp | 6 +++--- lib/Analysis/CFGPrinter.cpp | 10 +++++----- lib/Analysis/IPA/Andersens.cpp | 2 +- lib/Analysis/IPA/CallGraph.cpp | 2 +- lib/Analysis/IPA/CallGraphSCCPass.cpp | 2 +- lib/Analysis/IPA/GlobalsModRef.cpp | 2 +- lib/Analysis/InstCount.cpp | 2 +- lib/Analysis/IntervalPartition.cpp | 2 +- lib/Analysis/LoopPass.cpp | 2 +- lib/Analysis/ProfileInfo.cpp | 2 +- lib/Analysis/ProfileInfoLoaderPass.cpp | 2 +- lib/Bitcode/Writer/BitcodeWriterPass.cpp | 2 +- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +- lib/CodeGen/BranchFolding.cpp | 2 +- lib/CodeGen/ELFWriter.cpp | 2 +- lib/CodeGen/GCMetadata.cpp | 2 +- lib/CodeGen/GCStrategy.cpp | 2 +- lib/CodeGen/IfConversion.cpp | 2 +- lib/CodeGen/LoopAligner.cpp | 2 +- lib/CodeGen/LowerSubregs.cpp | 2 +- lib/CodeGen/MachOWriter.cpp | 2 +- lib/CodeGen/MachineFunction.cpp | 4 ++-- lib/CodeGen/MachineLICM.cpp | 2 +- lib/CodeGen/MachineModuleInfo.cpp | 4 ++-- lib/CodeGen/MachineSink.cpp | 2 +- lib/CodeGen/PHIElimination.cpp | 2 +- lib/CodeGen/PostRASchedulerList.cpp | 2 +- lib/CodeGen/PrologEpilogInserter.cpp | 2 +- lib/CodeGen/RegAllocBigBlock.cpp | 2 +- lib/CodeGen/RegAllocLinearScan.cpp | 2 +- lib/CodeGen/RegAllocLocal.cpp | 3 +-- lib/CodeGen/RegAllocSimple.cpp | 2 +- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- lib/CodeGen/SimpleRegisterCoalescing.h | 2 +- lib/CodeGen/StackSlotColoring.cpp | 2 +- lib/CodeGen/StrongPHIElimination.cpp | 2 +- lib/CodeGen/TwoAddressInstructionPass.cpp | 2 +- lib/CodeGen/UnreachableBlockElim.cpp | 4 ++-- lib/Target/ARM/ARMCodeEmitter.cpp | 4 ++-- lib/Target/ARM/ARMConstantIslandPass.cpp | 2 +- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 2 +- lib/Target/Alpha/AlphaBranchSelector.cpp | 2 +- lib/Target/Alpha/AlphaCodeEmitter.cpp | 4 ++-- lib/Target/Alpha/AlphaLLRP.cpp | 2 +- lib/Target/CBackend/CBackend.cpp | 4 ++-- lib/Target/CppBackend/CPPBackend.cpp | 2 +- lib/Target/IA64/IA64Bundling.cpp | 2 +- lib/Target/MSIL/MSILWriter.h | 4 ++-- lib/Target/Mips/MipsDelaySlotFiller.cpp | 2 +- lib/Target/PowerPC/PPCBranchSelector.cpp | 2 +- lib/Target/PowerPC/PPCCodeEmitter.cpp | 2 +- lib/Target/Sparc/DelaySlotFiller.cpp | 2 +- lib/Target/Sparc/FPMover.cpp | 2 +- lib/Target/TargetData.cpp | 2 +- lib/Target/X86/X86CodeEmitter.cpp | 4 ++-- lib/Target/X86/X86FloatingPoint.cpp | 2 +- lib/Target/X86/X86RegisterInfo.cpp | 2 +- lib/Transforms/Hello/Hello.cpp | 4 ++-- lib/Transforms/IPO/ArgumentPromotion.cpp | 2 +- lib/Transforms/IPO/ConstantMerge.cpp | 2 +- lib/Transforms/IPO/DeadArgumentElimination.cpp | 2 +- lib/Transforms/IPO/DeadTypeElimination.cpp | 2 +- lib/Transforms/IPO/ExtractGV.cpp | 2 +- lib/Transforms/IPO/GlobalDCE.cpp | 2 +- lib/Transforms/IPO/GlobalOpt.cpp | 2 +- lib/Transforms/IPO/IPConstantPropagation.cpp | 2 +- lib/Transforms/IPO/IndMemRemoval.cpp | 2 +- lib/Transforms/IPO/Inliner.cpp | 8 ++++---- lib/Transforms/IPO/Internalize.cpp | 4 ++-- lib/Transforms/IPO/LoopExtractor.cpp | 6 +++--- lib/Transforms/IPO/LowerSetJmp.cpp | 2 +- lib/Transforms/IPO/PartialSpecialization.cpp | 2 +- lib/Transforms/IPO/PruneEH.cpp | 2 +- lib/Transforms/IPO/RaiseAllocations.cpp | 2 +- lib/Transforms/IPO/StripDeadPrototypes.cpp | 2 +- lib/Transforms/IPO/StripSymbols.cpp | 2 +- lib/Transforms/IPO/StructRetPromotion.cpp | 2 +- lib/Transforms/Instrumentation/EdgeProfiling.cpp | 2 +- lib/Transforms/Instrumentation/RSProfiling.cpp | 2 +- lib/Transforms/Scalar/ADCE.cpp | 2 +- lib/Transforms/Scalar/BasicBlockPlacement.cpp | 2 +- lib/Transforms/Scalar/CodeGenPrepare.cpp | 2 +- lib/Transforms/Scalar/CondPropagate.cpp | 2 +- lib/Transforms/Scalar/ConstantProp.cpp | 2 +- lib/Transforms/Scalar/DCE.cpp | 2 +- lib/Transforms/Scalar/DeadStoreElimination.cpp | 2 +- lib/Transforms/Scalar/GVN.cpp | 2 +- lib/Transforms/Scalar/GVNPRE.cpp | 2 +- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 +- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- lib/Transforms/Scalar/JumpThreading.cpp | 2 +- lib/Transforms/Scalar/LICM.cpp | 2 +- lib/Transforms/Scalar/LoopDeletion.cpp | 2 +- lib/Transforms/Scalar/LoopIndexSplit.cpp | 2 +- lib/Transforms/Scalar/LoopRotation.cpp | 2 +- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 +- lib/Transforms/Scalar/LoopUnroll.cpp | 2 +- lib/Transforms/Scalar/LoopUnswitch.cpp | 2 +- lib/Transforms/Scalar/MarkModRef.cpp | 2 +- lib/Transforms/Scalar/MemCpyOptimizer.cpp | 2 +- lib/Transforms/Scalar/PredicateSimplifier.cpp | 2 +- lib/Transforms/Scalar/Reassociate.cpp | 2 +- lib/Transforms/Scalar/Reg2Mem.cpp | 2 +- lib/Transforms/Scalar/SCCP.cpp | 4 ++-- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 2 +- lib/Transforms/Scalar/SimplifyCFGPass.cpp | 2 +- lib/Transforms/Scalar/SimplifyLibCalls.cpp | 2 +- lib/Transforms/Scalar/TailDuplication.cpp | 2 +- lib/Transforms/Scalar/TailRecursionElimination.cpp | 2 +- lib/Transforms/Utils/BreakCriticalEdges.cpp | 2 +- lib/Transforms/Utils/LCSSA.cpp | 2 +- lib/Transforms/Utils/LoopSimplify.cpp | 2 +- lib/Transforms/Utils/LowerAllocations.cpp | 2 +- lib/Transforms/Utils/LowerInvoke.cpp | 2 +- lib/Transforms/Utils/LowerSwitch.cpp | 2 +- lib/Transforms/Utils/Mem2Reg.cpp | 2 +- lib/VMCore/PassManager.cpp | 9 ++++----- lib/VMCore/Verifier.cpp | 10 +++++----- 137 files changed, 170 insertions(+), 169 deletions(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 6e944d32b36..94ab04eb56b 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -720,7 +720,7 @@ public: static char ID; // Pass ID, replacement for typeid DominatorTreeBase* DT; - DominatorTree() : FunctionPass(intptr_t(&ID)) { + DominatorTree() : FunctionPass(&ID) { DT = new DominatorTreeBase(false); } @@ -911,7 +911,7 @@ protected: const bool IsPostDominators; public: - DominanceFrontierBase(intptr_t ID, bool isPostDom) + DominanceFrontierBase(void *ID, bool isPostDom) : FunctionPass(ID), IsPostDominators(isPostDom) {} /// getRoots - Return the root blocks of the current CFG. This may include @@ -1030,7 +1030,7 @@ class DominanceFrontier : public DominanceFrontierBase { public: static char ID; // Pass ID, replacement for typeid DominanceFrontier() : - DominanceFrontierBase(intptr_t(&ID), false) {} + DominanceFrontierBase(&ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h index d3e62e26965..35e4e6f3f9e 100644 --- a/include/llvm/Analysis/FindUsedTypes.h +++ b/include/llvm/Analysis/FindUsedTypes.h @@ -25,7 +25,7 @@ class FindUsedTypes : public ModulePass { std::set UsedTypes; public: static char ID; // Pass identification, replacement for typeid - FindUsedTypes() : ModulePass((intptr_t)&ID) {} + FindUsedTypes() : ModulePass(&ID) {} /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h index e724681fa49..feae6d82f82 100644 --- a/include/llvm/Analysis/IntervalPartition.h +++ b/include/llvm/Analysis/IntervalPartition.h @@ -48,7 +48,7 @@ class IntervalPartition : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} + IntervalPartition() : FunctionPass(&ID), RootInterval(0) {} // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h index 60ad0d95190..af6a6177c1b 100644 --- a/include/llvm/Analysis/LoopPass.h +++ b/include/llvm/Analysis/LoopPass.h @@ -30,6 +30,7 @@ class LoopPass : public Pass { public: explicit LoopPass(intptr_t pid) : Pass(pid) {} + explicit LoopPass(void *pid) : Pass(pid) {} // runOnLoop - This method should be implemented by the subclass to perform // whatever action is necessary for the specified Loop. diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index c6ef41ff240..c606b22acee 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -66,7 +66,7 @@ class MemoryDependenceAnalysis : public FunctionPass { static Instruction* const Dirty; static char ID; // Class identification, replacement for typeinfo - MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {} + MemoryDependenceAnalysis() : FunctionPass(&ID) {} /// Pass Implementation stuff. This doesn't do any analysis. /// diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index b99fafcfc9f..cd6af74024a 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass { static char ID; // Pass identification, replacement for typeid DominatorTreeBase* DT; - PostDominatorTree() : FunctionPass((intptr_t)&ID) { + PostDominatorTree() : FunctionPass(&ID) { DT = new DominatorTreeBase(true); } @@ -70,7 +70,7 @@ FunctionPass* createPostDomTree(); struct PostDominanceFrontier : public DominanceFrontierBase { static char ID; PostDominanceFrontier() - : DominanceFrontierBase((intptr_t) &ID, true) {} + : DominanceFrontierBase(&ID, true) {} virtual bool runOnFunction(Function &) { Frontiers.clear(); diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index e5b10c9d59a..e16e990bad2 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -191,7 +191,7 @@ namespace llvm { void *Impl; // ScalarEvolution uses the pimpl pattern public: static char ID; // Pass identification, replacement for typeid - ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {} + ScalarEvolution() : FunctionPass(&ID), Impl(0) {} /// getSCEV - Return a SCEV expression handle for the full generality of the /// specified expression. diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h index 26005059dee..d5ff17cf247 100644 --- a/include/llvm/CallGraphSCCPass.h +++ b/include/llvm/CallGraphSCCPass.h @@ -32,6 +32,7 @@ class PMStack; struct CallGraphSCCPass : public Pass { explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {} + explicit CallGraphSCCPass(void *pid) : Pass(pid) {} /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index a43c2d4b982..c77513ca986 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -94,7 +94,7 @@ namespace llvm { public: static char ID; // Pass identification, replacement for typeid - LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {} + LiveIntervals() : MachineFunctionPass(&ID) {} struct InstrSlots { enum { diff --git a/include/llvm/CodeGen/LiveStackAnalysis.h b/include/llvm/CodeGen/LiveStackAnalysis.h index 87ed67fa000..5c88bb83c52 100644 --- a/include/llvm/CodeGen/LiveStackAnalysis.h +++ b/include/llvm/CodeGen/LiveStackAnalysis.h @@ -35,7 +35,7 @@ namespace llvm { public: static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass((intptr_t)&ID) {} + LiveStacks() : MachineFunctionPass(&ID) {} typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::const_iterator const_iterator; diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index e2bed5c2ef9..18fa6f1f02b 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -43,7 +43,7 @@ class TargetRegisterInfo; class LiveVariables : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - LiveVariables() : MachineFunctionPass((intptr_t)&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 diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index a72563fb0af..95bb2bf510d 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -27,6 +27,7 @@ namespace llvm { struct MachineFunctionPass : public FunctionPass { explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} + explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} protected: /// runOnMachineFunction - This method must be overloaded to perform the diff --git a/include/llvm/Transforms/IPO/InlinerPass.h b/include/llvm/Transforms/IPO/InlinerPass.h index d34641def09..e0a3d2943e5 100644 --- a/include/llvm/Transforms/IPO/InlinerPass.h +++ b/include/llvm/Transforms/IPO/InlinerPass.h @@ -26,8 +26,8 @@ namespace llvm { /// perform the inlining operations that does not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - explicit Inliner(const void *ID); - explicit Inliner(const void *ID, int Threshold); + explicit Inliner(void *ID); + explicit Inliner(void *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 diff --git a/include/llvm/Transforms/RSProfiling.h b/include/llvm/Transforms/RSProfiling.h index b44a992bd3d..98ec396a26a 100644 --- a/include/llvm/Transforms/RSProfiling.h +++ b/include/llvm/Transforms/RSProfiling.h @@ -27,7 +27,7 @@ namespace llvm { /// multiple profilers can be support simultaniously. struct RSProfilers : public ModulePass { static char ID; // Pass identification, replacement for typeinfo - RSProfilers() : ModulePass((intptr_t)&ID) {} + RSProfilers() : ModulePass(&ID) {} /// isProfiling - This method returns true if the value passed it was /// inserted by the profiler. diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index 598adfc0bce..c2d09935e76 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -26,7 +26,7 @@ struct UnifyFunctionExitNodes : public FunctionPass { BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: static char ID; // Pass identification, replacement for typeid - UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID), + UnifyFunctionExitNodes() : FunctionPass(&ID), ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes diff --git a/lib/Analysis/AliasAnalysisCounter.cpp b/lib/Analysis/AliasAnalysisCounter.cpp index de40ad8deef..4362d7d301a 100644 --- a/lib/Analysis/AliasAnalysisCounter.cpp +++ b/lib/Analysis/AliasAnalysisCounter.cpp @@ -35,7 +35,7 @@ namespace { Module *M; public: static char ID; // Class identification, replacement for typeinfo - AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { + AliasAnalysisCounter() : ModulePass(&ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index af15d0f4adf..c7a86d3506f 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -52,7 +52,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - AAEval() : FunctionPass((intptr_t)&ID) {} + AAEval() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); diff --git a/lib/Analysis/AliasDebugger.cpp b/lib/Analysis/AliasDebugger.cpp index 06a43b11dd5..0bbd739351f 100644 --- a/lib/Analysis/AliasDebugger.cpp +++ b/lib/Analysis/AliasDebugger.cpp @@ -41,7 +41,7 @@ namespace { public: static char ID; // Class identification, replacement for typeinfo - AliasDebugger() : ModulePass((intptr_t)&ID) {} + AliasDebugger() : ModulePass(&ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 398bf5aca5b..608da93f573 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -564,7 +564,7 @@ namespace { AliasSetTracker *Tracker; public: static char ID; // Pass identification, replacement for typeid - AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} + AliasSetPrinter() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index b417a484760..7d4309353a4 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -208,8 +208,8 @@ namespace { /// struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass((intptr_t)&ID) {} - explicit NoAA(intptr_t PID) : ImmutablePass(PID) { } + NoAA() : ImmutablePass(&ID) {} + explicit NoAA(void *PID) : ImmutablePass(PID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -269,7 +269,7 @@ namespace { /// derives from the NoAA class. struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA((intptr_t)&ID) { } + BasicAliasAnalysis() : NoAA(&ID) {} AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); diff --git a/lib/Analysis/CFGPrinter.cpp b/lib/Analysis/CFGPrinter.cpp index e20a0a2f876..46d3930bd67 100644 --- a/lib/Analysis/CFGPrinter.cpp +++ b/lib/Analysis/CFGPrinter.cpp @@ -92,7 +92,7 @@ struct DOTGraphTraits : public DefaultDOTGraphTraits { namespace { struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGViewer() : FunctionPass((intptr_t)&ID) {} + CFGViewer() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { F.viewCFG(); @@ -114,7 +114,7 @@ V0("view-cfg", "View CFG of function", false, true); namespace { struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {} + CFGOnlyViewer() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { CFGOnly = true; @@ -139,8 +139,8 @@ V1("view-cfg-only", namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGPrinter() : FunctionPass((intptr_t)&ID) {} - explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {} + CFGPrinter() : FunctionPass(&ID) {} + explicit CFGPrinter(void *pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getName() + ".dot"; @@ -170,7 +170,7 @@ P1("print-cfg", "Print CFG of function to 'dot' file", false, true); namespace { struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { static char ID; // Pass identification, replacement for typeid - CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {} + CFGOnlyPrinter() : CFGPrinter(&ID) {} virtual bool runOnFunction(Function &F) { bool OldCFGOnly = CFGOnly; CFGOnly = true; diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index c6075e1c610..9e07189a77d 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -431,7 +431,7 @@ namespace { public: static char ID; - Andersens() : ModulePass((intptr_t)&ID) {} + Andersens() : ModulePass(&ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 19d0fd51907..5616ee9a4b0 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -50,7 +50,7 @@ class VISIBILITY_HIDDEN BasicCallGraph : public CallGraph, public ModulePass { public: static char ID; // Class identification, replacement for typeinfo - BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0), + BasicCallGraph() : ModulePass(&ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} // runOnModule - Compute the call graph for the specified module. diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index 4a0e4cfe057..b8343cf4ce8 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -34,7 +34,7 @@ class CGPassManager : public ModulePass, public PMDataManager { public: static char ID; explicit CGPassManager(int Depth) - : ModulePass((intptr_t)&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. diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 9a7580b9c8d..3583f8db4f3 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -88,7 +88,7 @@ namespace { public: static char ID; - GlobalsModRef() : ModulePass((intptr_t)&ID) {} + GlobalsModRef() : ModulePass(&ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class diff --git a/lib/Analysis/InstCount.cpp b/lib/Analysis/InstCount.cpp index 5f33a60e6fd..2dea7b3ef68 100644 --- a/lib/Analysis/InstCount.cpp +++ b/lib/Analysis/InstCount.cpp @@ -52,7 +52,7 @@ namespace { } public: static char ID; // Pass identification, replacement for typeid - InstCount() : FunctionPass((intptr_t)&ID) {} + InstCount() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Analysis/IntervalPartition.cpp b/lib/Analysis/IntervalPartition.cpp index adb6e9df24f..cb8a85da552 100644 --- a/lib/Analysis/IntervalPartition.cpp +++ b/lib/Analysis/IntervalPartition.cpp @@ -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((intptr_t) &ID) { + : FunctionPass(&ID) { assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); // Pass false to intervals_begin because we take ownership of it's memory diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index b9e5f99f07c..7ebd4d39427 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -25,7 +25,7 @@ char LPPassManager::ID = 0; /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. LPPassManager::LPPassManager(int Depth) - : FunctionPass((intptr_t)&ID), PMDataManager(Depth) { + : FunctionPass(&ID), PMDataManager(Depth) { skipThisLoop = false; redoThisLoop = false; LI = NULL; diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp index 047491baeee..a0965b66da8 100644 --- a/lib/Analysis/ProfileInfo.cpp +++ b/lib/Analysis/ProfileInfo.cpp @@ -85,7 +85,7 @@ namespace { struct VISIBILITY_HIDDEN NoProfileInfo : public ImmutablePass, public ProfileInfo { static char ID; // Class identification, replacement for typeinfo - NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} + NoProfileInfo() : ImmutablePass(&ID) {} }; } // End of anonymous namespace diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp index b2fa9e45e71..0a8a87bd0f9 100644 --- a/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -34,7 +34,7 @@ namespace { public: static char ID; // Class identification, replacement for typeinfo explicit LoaderPass(const std::string &filename = "") - : ModulePass((intptr_t)&ID), Filename(filename) { + : ModulePass(&ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; } diff --git a/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/lib/Bitcode/Writer/BitcodeWriterPass.cpp index 522060e78e7..dd16fabbd7a 100644 --- a/lib/Bitcode/Writer/BitcodeWriterPass.cpp +++ b/lib/Bitcode/Writer/BitcodeWriterPass.cpp @@ -21,7 +21,7 @@ namespace { public: static char ID; // Pass identifcation, replacement for typeid explicit WriteBitcodePass(std::ostream &o) - : ModulePass((intptr_t) &ID), Out(o) {} + : ModulePass(&ID), Out(o) {} const char *getPassName() const { return "Bitcode Writer"; } diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a720f04a9ae..03a61d42cd1 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -37,7 +37,7 @@ using namespace llvm; char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm, const TargetAsmInfo *T) - : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), + : MachineFunctionPass(&ID), FunctionNumber(0), O(o), TM(tm), TAI(T), TRI(tm.getRegisterInfo()), IsInTextSection(false) {} diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 2ccfd191a09..11866a15184 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -48,7 +48,7 @@ namespace { struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass { static char ID; explicit BranchFolder(bool defaultEnableTailMerge) : - MachineFunctionPass((intptr_t)&ID) { + MachineFunctionPass(&ID) { switch (FlagEnableTailMerge) { case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break; case cl::BOU_TRUE: EnableTailMerge = true; break; diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp index 6f29112caf4..0b6e0b1b103 100644 --- a/lib/CodeGen/ELFWriter.cpp +++ b/lib/CodeGen/ELFWriter.cpp @@ -195,7 +195,7 @@ bool ELFCodeEmitter::finishFunction(MachineFunction &F) { //===----------------------------------------------------------------------===// ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { + : MachineFunctionPass(&ID), O(o), TM(tm) { e_flags = 0; // e_flags defaults to 0, no flags. is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; diff --git a/lib/CodeGen/GCMetadata.cpp b/lib/CodeGen/GCMetadata.cpp index efb89e128e4..f2978f88882 100644 --- a/lib/CodeGen/GCMetadata.cpp +++ b/lib/CodeGen/GCMetadata.cpp @@ -66,7 +66,7 @@ GCFunctionInfo::~GCFunctionInfo() {} char GCModuleInfo::ID = 0; GCModuleInfo::GCModuleInfo() - : ImmutablePass((intptr_t)&ID) {} + : ImmutablePass(&ID) {} GCModuleInfo::~GCModuleInfo() { clear(); diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index d46b5256870..517b3a7762e 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -127,7 +127,7 @@ FunctionPass *llvm::createGCLoweringPass() { char LowerIntrinsics::ID = 0; LowerIntrinsics::LowerIntrinsics() - : FunctionPass((intptr_t)&ID) {} + : FunctionPass(&ID) {} const char *LowerIntrinsics::getPassName() const { return "Lower Garbage Collection Instructions"; diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index 079b7016480..38fce9b435c 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -146,7 +146,7 @@ namespace { bool MadeChange; public: static char ID; - IfConverter() : MachineFunctionPass((intptr_t)&ID) {} + IfConverter() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "If Converter"; } diff --git a/lib/CodeGen/LoopAligner.cpp b/lib/CodeGen/LoopAligner.cpp index 44f5bb461dc..51c635661f2 100644 --- a/lib/CodeGen/LoopAligner.cpp +++ b/lib/CodeGen/LoopAligner.cpp @@ -26,7 +26,7 @@ namespace { class LoopAligner : public MachineFunctionPass { public: static char ID; - LoopAligner() : MachineFunctionPass((intptr_t)&ID) {} + LoopAligner() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Loop aligner"; } diff --git a/lib/CodeGen/LowerSubregs.cpp b/lib/CodeGen/LowerSubregs.cpp index 90bd595d7a5..6e115ddb137 100644 --- a/lib/CodeGen/LowerSubregs.cpp +++ b/lib/CodeGen/LowerSubregs.cpp @@ -24,7 +24,7 @@ namespace { struct VISIBILITY_HIDDEN LowerSubregsInstructionPass : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - LowerSubregsInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} + LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {} const char *getPassName() const { return "Subregister lowering instruction pass"; diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index 9f1cb00ca70..253c5ca5f46 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -336,7 +336,7 @@ void MachOCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) { char MachOWriter::ID = 0; MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { + : MachineFunctionPass(&ID), O(o), TM(tm) { is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; isLittleEndian = TM.getTargetData()->isLittleEndian(); diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index ae97d890db5..5aade03031e 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -49,7 +49,7 @@ namespace { const std::string Banner; Printer (std::ostream *os, const std::string &banner) - : MachineFunctionPass((intptr_t)&ID), OS(os), Banner(banner) {} + : MachineFunctionPass(&ID), OS(os), Banner(banner) {} const char *getPassName() const { return "MachineFunction Printer"; } @@ -77,7 +77,7 @@ FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS, namespace { struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { static char ID; - Deleter() : MachineFunctionPass((intptr_t)&ID) {} + Deleter() : MachineFunctionPass(&ID) {} const char *getPassName() const { return "Machine Code Deleter"; } diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp index 709234753d4..723811932fa 100644 --- a/lib/CodeGen/MachineLICM.cpp +++ b/lib/CodeGen/MachineLICM.cpp @@ -45,7 +45,7 @@ namespace { MachineLoop *CurLoop; // The current loop we are working on. public: static char ID; // Pass identification, replacement for typeid - MachineLICM() : MachineFunctionPass((intptr_t)&ID) {} + MachineLICM() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 2010d17f856..69f8d3c014c 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -1612,7 +1612,7 @@ DebugScope::~DebugScope() { //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo() -: ImmutablePass((intptr_t)&ID) +: ImmutablePass(&ID) , DR() , VR() , CompileUnits() @@ -2011,7 +2011,7 @@ namespace llvm { struct DebugLabelFolder : public MachineFunctionPass { static char ID; - DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {} + DebugLabelFolder() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Label Folder"; } diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp index b4e72fed28d..0f608d637c5 100644 --- a/lib/CodeGen/MachineSink.cpp +++ b/lib/CodeGen/MachineSink.cpp @@ -36,7 +36,7 @@ namespace { public: static char ID; // Pass identification - MachineSinking() : MachineFunctionPass((intptr_t)&ID) {} + MachineSinking() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index ceba842970d..bd389db31f3 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -38,7 +38,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - PNE() : MachineFunctionPass((intptr_t)&ID) {} + PNE() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index 8c9776e07a9..41981d3ff14 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -29,7 +29,7 @@ namespace { class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass { public: static char ID; - SchedulePostRATDList() : MachineFunctionPass((intptr_t)&ID) {} + SchedulePostRATDList() : MachineFunctionPass(&ID) {} private: MachineFunction *MF; const TargetMachine *TM; diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index be8a54e03d1..51d3698dc58 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -35,7 +35,7 @@ using namespace llvm; namespace { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { static char ID; - PEI() : MachineFunctionPass((intptr_t)&ID) {} + PEI() : MachineFunctionPass(&ID) {} const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; diff --git a/lib/CodeGen/RegAllocBigBlock.cpp b/lib/CodeGen/RegAllocBigBlock.cpp index 215f9430997..380ad059cf6 100644 --- a/lib/CodeGen/RegAllocBigBlock.cpp +++ b/lib/CodeGen/RegAllocBigBlock.cpp @@ -82,7 +82,7 @@ namespace { class VISIBILITY_HIDDEN RABigBlock : public MachineFunctionPass { public: static char ID; - RABigBlock() : MachineFunctionPass((intptr_t)&ID) {} + RABigBlock() : MachineFunctionPass(&ID) {} private: /// TM - For getting at TargetMachine info /// diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index c6f714a9cb7..91dda771475 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -55,7 +55,7 @@ linearscanRegAlloc("linearscan", " linear scan register allocator", namespace { struct VISIBILITY_HIDDEN RALinScan : public MachineFunctionPass { static char ID; - RALinScan() : MachineFunctionPass((intptr_t)&ID) {} + RALinScan() : MachineFunctionPass(&ID) {} typedef std::pair IntervalPtr; typedef SmallVector IntervalPtrs; diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 5946e749022..d66031776e3 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -44,8 +44,7 @@ namespace { class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass { public: static char ID; - RALocal() : MachineFunctionPass((intptr_t)&ID), - StackSlotForVirtReg(-1) {} + RALocal() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1) {} private: const TargetMachine *TM; MachineFunction *MF; diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp index 9ad38405ae7..87b09a2a0dc 100644 --- a/lib/CodeGen/RegAllocSimple.cpp +++ b/lib/CodeGen/RegAllocSimple.cpp @@ -41,7 +41,7 @@ namespace { class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { public: static char ID; - RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {} + RegAllocSimple() : MachineFunctionPass(&ID) {} private: MachineFunction *MF; const TargetMachine *TM; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2b9ba38f20c..b4ba64ea279 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -158,7 +158,7 @@ MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, //===----------------------------------------------------------------------===// SelectionDAGISel::SelectionDAGISel(TargetLowering &tli, bool fast) : - FunctionPass((intptr_t)&ID), TLI(tli), + FunctionPass(&ID), TLI(tli), FuncInfo(new FunctionLoweringInfo(TLI)), CurDAG(new SelectionDAG(TLI, *FuncInfo)), SDL(new SelectionDAGLowering(*CurDAG, TLI, *FuncInfo)), diff --git a/lib/CodeGen/SimpleRegisterCoalescing.h b/lib/CodeGen/SimpleRegisterCoalescing.h index 62738952aa2..41d1dfb20b0 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.h +++ b/lib/CodeGen/SimpleRegisterCoalescing.h @@ -102,7 +102,7 @@ namespace llvm { public: static char ID; // Pass identifcation, replacement for typeid - SimpleRegisterCoalescing() : MachineFunctionPass((intptr_t)&ID) {} + SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {} struct InstrSlots { enum { diff --git a/lib/CodeGen/StackSlotColoring.cpp b/lib/CodeGen/StackSlotColoring.cpp index 6d0e2148c59..ab980a14ec6 100644 --- a/lib/CodeGen/StackSlotColoring.cpp +++ b/lib/CodeGen/StackSlotColoring.cpp @@ -62,7 +62,7 @@ namespace { public: static char ID; // Pass identification - StackSlotColoring() : MachineFunctionPass((intptr_t)&ID), NextColor(-1) {} + StackSlotColoring() : MachineFunctionPass(&ID), NextColor(-1) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp index 9f59417b5dc..ebe0c01aab9 100644 --- a/lib/CodeGen/StrongPHIElimination.cpp +++ b/lib/CodeGen/StrongPHIElimination.cpp @@ -38,7 +38,7 @@ using namespace llvm; namespace { struct VISIBILITY_HIDDEN StrongPHIElimination : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - StrongPHIElimination() : MachineFunctionPass((intptr_t)&ID) {} + StrongPHIElimination() : MachineFunctionPass(&ID) {} // Waiting stores, for each MBB, the set of copies that need to // be inserted into that MBB diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 51a3c5f52ed..16b57a02b61 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -70,7 +70,7 @@ namespace { DenseMap &DistanceMap); public: static char ID; // Pass identification, replacement for typeid - TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} + TwoAddressInstructionPass() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index 7bf95bf96e5..3c3fca51b66 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -40,7 +40,7 @@ namespace { virtual bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} + UnreachableBlockElim() : FunctionPass(&ID) {} }; } char UnreachableBlockElim::ID = 0; @@ -90,7 +90,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - UnreachableMachineBlockElim() : MachineFunctionPass((intptr_t)&ID) {} + UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {} }; } char UnreachableMachineBlockElim::ID = 0; diff --git a/lib/Target/ARM/ARMCodeEmitter.cpp b/lib/Target/ARM/ARMCodeEmitter.cpp index 16b00417b35..80f68984a5e 100644 --- a/lib/Target/ARM/ARMCodeEmitter.cpp +++ b/lib/Target/ARM/ARMCodeEmitter.cpp @@ -39,11 +39,11 @@ namespace { public: static char ID; explicit ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) - : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), + : MachineFunctionPass(&ID), II(0), TD(0), TM(tm), MCE(mce) {} ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, const ARMInstrInfo &ii, const TargetData &td) - : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), + : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm), MCE(mce) {} bool runOnMachineFunction(MachineFunction &MF); diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index f577de5b365..73c56182a18 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -129,7 +129,7 @@ namespace { bool isThumb; public: static char ID; - ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} + ARMConstantIslands() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 5eeeafbac1c..8bd4caa6fd6 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -39,7 +39,7 @@ STATISTIC(NumFSTMGened, "Number of fstm instructions generated"); namespace { struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass { static char ID; - ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {} + ARMLoadStoreOpt() : MachineFunctionPass(&ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; diff --git a/lib/Target/Alpha/AlphaBranchSelector.cpp b/lib/Target/Alpha/AlphaBranchSelector.cpp index f1d60c836f7..aca8ca73489 100644 --- a/lib/Target/Alpha/AlphaBranchSelector.cpp +++ b/lib/Target/Alpha/AlphaBranchSelector.cpp @@ -23,7 +23,7 @@ using namespace llvm; namespace { struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass { static char ID; - AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {} + AlphaBSel() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); diff --git a/lib/Target/Alpha/AlphaCodeEmitter.cpp b/lib/Target/Alpha/AlphaCodeEmitter.cpp index 40e14135a40..b51440932f7 100644 --- a/lib/Target/Alpha/AlphaCodeEmitter.cpp +++ b/lib/Target/Alpha/AlphaCodeEmitter.cpp @@ -39,10 +39,10 @@ namespace { public: static char ID; explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) - : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {} + : MachineFunctionPass(&ID), II(0), TM(tm), MCE(mce) {} AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, const AlphaInstrInfo& ii) - : MachineFunctionPass((intptr_t)&ID), II(&ii), TM(tm), MCE(mce) {} + : MachineFunctionPass(&ID), II(&ii), TM(tm), MCE(mce) {} bool runOnMachineFunction(MachineFunction &MF); diff --git a/lib/Target/Alpha/AlphaLLRP.cpp b/lib/Target/Alpha/AlphaLLRP.cpp index f4dd199d354..7a1b78497b8 100644 --- a/lib/Target/Alpha/AlphaLLRP.cpp +++ b/lib/Target/Alpha/AlphaLLRP.cpp @@ -39,7 +39,7 @@ namespace { static char ID; AlphaLLRPPass(AlphaTargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), TM(tm) { } + : MachineFunctionPass(&ID), TM(tm) { } virtual const char *getPassName() const { return "Alpha NOP inserter"; diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 456bda34e73..a1222daf3f2 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -60,7 +60,7 @@ namespace { public: static char ID; CBackendNameAllUsedStructsAndMergeFunctions() - : ModulePass((intptr_t)&ID) {} + : ModulePass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -92,7 +92,7 @@ namespace { public: static char ID; explicit CWriter(raw_ostream &o) - : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0), + : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TD(0) {} virtual const char *getPassName() const { return "C backend"; } diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 33326e14d0c..b39d7749320 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -103,7 +103,7 @@ namespace { public: static char ID; explicit CppWriter(raw_ostream &o) : - ModulePass((intptr_t)&ID), Out(o), uniqueNum(0), is_inline(false) {} + ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false) {} virtual const char *getPassName() const { return "C++ backend"; } diff --git a/lib/Target/IA64/IA64Bundling.cpp b/lib/Target/IA64/IA64Bundling.cpp index cac007cef26..c5bc83e134b 100644 --- a/lib/Target/IA64/IA64Bundling.cpp +++ b/lib/Target/IA64/IA64Bundling.cpp @@ -43,7 +43,7 @@ namespace { IA64TargetMachine &TM; IA64BundlingPass(IA64TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), TM(tm) { } + : MachineFunctionPass(&ID), TM(tm) { } virtual const char *getPassName() const { return "IA64 (Itanium) Bundling Pass"; diff --git a/lib/Target/MSIL/MSILWriter.h b/lib/Target/MSIL/MSILWriter.h index b141e23d64c..c64ceeeff59 100644 --- a/lib/Target/MSIL/MSILWriter.h +++ b/lib/Target/MSIL/MSILWriter.h @@ -42,7 +42,7 @@ namespace { static char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) - : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {} + : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -86,7 +86,7 @@ namespace { StaticInitList; const std::set* UsedTypes; static char ID; - MSILWriter(raw_ostream &o) : FunctionPass((intptr_t)&ID), Out(o) { + MSILWriter(raw_ostream &o) : FunctionPass(&ID), Out(o) { UniqID = 0; } diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp index 881cd129290..4825b29d711 100644 --- a/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -32,7 +32,7 @@ namespace { static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "Mips Delay Slot Filler"; diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp index ab988ba823e..2fc5b3c025a 100644 --- a/lib/Target/PowerPC/PPCBranchSelector.cpp +++ b/lib/Target/PowerPC/PPCBranchSelector.cpp @@ -32,7 +32,7 @@ STATISTIC(NumExpanded, "Number of branches expanded to long format"); namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { static char ID; - PPCBSel() : MachineFunctionPass((intptr_t)&ID) {} + PPCBSel() : MachineFunctionPass(&ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index 3326cf7f16d..a77c7266857 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -48,7 +48,7 @@ namespace { public: static char ID; PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M) - : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {} + : MachineFunctionPass(&ID), TM(T), MCE(M) {} const char *getPassName() const { return "PowerPC Machine Code Emitter"; } diff --git a/lib/Target/Sparc/DelaySlotFiller.cpp b/lib/Target/Sparc/DelaySlotFiller.cpp index 818573253f0..f6648a87005 100644 --- a/lib/Target/Sparc/DelaySlotFiller.cpp +++ b/lib/Target/Sparc/DelaySlotFiller.cpp @@ -32,7 +32,7 @@ namespace { static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; diff --git a/lib/Target/Sparc/FPMover.cpp b/lib/Target/Sparc/FPMover.cpp index 016215b9717..a542fc5198c 100644 --- a/lib/Target/Sparc/FPMover.cpp +++ b/lib/Target/Sparc/FPMover.cpp @@ -34,7 +34,7 @@ namespace { static char ID; FPMover(TargetMachine &tm) - : MachineFunctionPass((intptr_t)&ID), TM(tm) { } + : MachineFunctionPass(&ID), TM(tm) { } virtual const char *getPassName() const { return "Sparc Double-FP Move Fixer"; diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index f83adefbee3..650f91eee1b 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -232,7 +232,7 @@ void TargetData::init(const std::string &TargetDescription) { } TargetData::TargetData(const Module *M) - : ImmutablePass((intptr_t)&ID) { + : ImmutablePass(&ID) { init(M->getDataLayout()); } diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index c3a1ed921a7..1c81b4b6fc0 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -46,12 +46,12 @@ namespace { public: static char ID; explicit Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce) - : MachineFunctionPass((intptr_t)&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, MachineCodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) - : MachineFunctionPass((intptr_t)&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_) {} diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index 7dadd44b1ce..5da02c64742 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -53,7 +53,7 @@ STATISTIC(NumFP , "Number of floating point instructions"); namespace { struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { static char ID; - FPS() : MachineFunctionPass((intptr_t)&ID) {} + FPS() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 4f335ab7625..d7bf93974e6 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -1118,7 +1118,7 @@ unsigned getX86SubSuperRegister(unsigned Reg, MVT VT, bool High) { namespace { struct VISIBILITY_HIDDEN MSAC : public MachineFunctionPass { static char ID; - MSAC() : MachineFunctionPass((intptr_t)&ID) {} + MSAC() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { MachineFrameInfo *FFI = MF.getFrameInfo(); diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp index f2a8322550f..d07f6135257 100644 --- a/lib/Transforms/Hello/Hello.cpp +++ b/lib/Transforms/Hello/Hello.cpp @@ -26,7 +26,7 @@ namespace { // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello() : FunctionPass((intptr_t)&ID) {} + Hello() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { HelloCounter++; @@ -45,7 +45,7 @@ namespace { // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello2() : FunctionPass((intptr_t)&ID) {} + Hello2() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { HelloCounter++; diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 5934c5ea24e..97433801da2 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -66,7 +66,7 @@ namespace { virtual bool runOnSCC(const std::vector &SCC); static char ID; // Pass identification, replacement for typeid - ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), + ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass(&ID), maxElements(maxElements) {} /// A vector used to hold the indices of a single GEP instruction diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index 86cfcc4624a..b4bab2d0e7e 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/lib/Transforms/IPO/ConstantMerge.cpp @@ -31,7 +31,7 @@ STATISTIC(NumMerged, "Number of global constants merged"); namespace { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { static char ID; // Pass identification, replacement for typeid - ConstantMerge() : ModulePass((intptr_t)&ID) {} + ConstantMerge() : ModulePass(&ID) {} // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 5f1920b0618..ec8f1364e82 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -121,7 +121,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - DAE() : ModulePass((intptr_t)&ID) {} + DAE() : ModulePass(&ID) {} bool runOnModule(Module &M); virtual bool ShouldHackArguments() const { return false; } diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index 3cb658ef72f..85aed2b7915 100644 --- a/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -27,7 +27,7 @@ STATISTIC(NumKilled, "Number of unused typenames removed from symtab"); namespace { struct VISIBILITY_HIDDEN DTE : public ModulePass { static char ID; // Pass identification, replacement for typeid - DTE() : ModulePass((intptr_t)&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 diff --git a/lib/Transforms/IPO/ExtractGV.cpp b/lib/Transforms/IPO/ExtractGV.cpp index 03a8e5cebca..d409b6e8067 100644 --- a/lib/Transforms/IPO/ExtractGV.cpp +++ b/lib/Transforms/IPO/ExtractGV.cpp @@ -35,7 +35,7 @@ namespace { /// explicit GVExtractorPass(std::vector& GVs, bool deleteS = true, bool relinkCallees = false) - : ModulePass((intptr_t)&ID), Named(GVs), deleteStuff(deleteS), + : ModulePass(&ID), Named(GVs), deleteStuff(deleteS), reLink(relinkCallees) {} bool runOnModule(Module &M) { diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 608705b10a0..020c70ab375 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -31,7 +31,7 @@ STATISTIC(NumVariables, "Number of global variables removed"); namespace { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { static char ID; // Pass identification, replacement for typeid - GlobalDCE() : ModulePass((intptr_t)&ID) {} + GlobalDCE() : ModulePass(&ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index f63ef46a850..f9a7c73534b 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -57,7 +57,7 @@ namespace { AU.addRequired(); } static char ID; // Pass identification, replacement for typeid - GlobalOpt() : ModulePass((intptr_t)&ID) {} + GlobalOpt() : ModulePass(&ID) {} bool runOnModule(Module &M); diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index 42c02e6a45c..aecec44aea0 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -36,7 +36,7 @@ namespace { /// struct VISIBILITY_HIDDEN IPCP : public ModulePass { static char ID; // Pass identification, replacement for typeid - IPCP() : ModulePass((intptr_t)&ID) {} + IPCP() : ModulePass(&ID) {} bool runOnModule(Module &M); private: diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp index 84483748594..2e09fe967f4 100644 --- a/lib/Transforms/IPO/IndMemRemoval.cpp +++ b/lib/Transforms/IPO/IndMemRemoval.cpp @@ -33,7 +33,7 @@ namespace { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - IndMemRemPass() : ModulePass((intptr_t)&ID) {} + IndMemRemPass() : ModulePass(&ID) {} virtual bool runOnModule(Module &M); }; diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 38cb67dddf1..88b6afdebb7 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -34,11 +34,11 @@ static cl::opt InlineLimit("inline-threshold", cl::Hidden, cl::init(200), cl::desc("Control the amount of inlining to perform (default = 200)")); -Inliner::Inliner(const void *ID) - : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {} +Inliner::Inliner(void *ID) + : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} -Inliner::Inliner(const void *ID, int Threshold) - : CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {} +Inliner::Inliner(void *ID, int Threshold) + : CallGraphSCCPass(ID), InlineThreshold(Threshold) {} /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 577d69cf60b..cbfccf2a2c7 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -60,7 +60,7 @@ static RegisterPass X("internalize", "Internalize Global Symbols"); InternalizePass::InternalizePass(bool AllButMain) - : ModulePass((intptr_t)&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. @@ -68,7 +68,7 @@ InternalizePass::InternalizePass(bool AllButMain) } InternalizePass::InternalizePass(const std::vector&exportList) - : ModulePass((intptr_t)&ID), AllButMain(false){ + : ModulePass(&ID), AllButMain(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp index 8e55b3f0919..0c654438d50 100644 --- a/lib/Transforms/IPO/LoopExtractor.cpp +++ b/lib/Transforms/IPO/LoopExtractor.cpp @@ -41,7 +41,7 @@ namespace { unsigned NumLoops; explicit LoopExtractor(unsigned numLoops = ~0) - : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {} + : FunctionPass(&ID), NumLoops(numLoops) {} virtual bool runOnFunction(Function &F); @@ -167,11 +167,11 @@ namespace { public: static char ID; // Pass identification, replacement for typeid explicit BlockExtractorPass(const std::vector &B) - : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) { + : ModulePass(&ID), BlocksToNotExtract(B) { if (!BlockFile.empty()) LoadFile(BlockFile.c_str()); } - BlockExtractorPass() : ModulePass((intptr_t)&ID) {} + BlockExtractorPass() : ModulePass(&ID) {} bool runOnModule(Module &M); }; diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index 80158b43a5c..d5997fb4b51 100644 --- a/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/lib/Transforms/IPO/LowerSetJmp.cpp @@ -112,7 +112,7 @@ namespace { bool IsTransformableFunction(const std::string& Name); public: static char ID; // Pass identification, replacement for typeid - LowerSetJmp() : ModulePass((intptr_t)&ID) {} + LowerSetJmp() : ModulePass(&ID) {} void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); diff --git a/lib/Transforms/IPO/PartialSpecialization.cpp b/lib/Transforms/IPO/PartialSpecialization.cpp index d39ea58ab67..949358e7bc9 100644 --- a/lib/Transforms/IPO/PartialSpecialization.cpp +++ b/lib/Transforms/IPO/PartialSpecialization.cpp @@ -45,7 +45,7 @@ namespace { int scanDistribution(Function&, int, std::map&); public : static char ID; // Pass identification, replacement for typeid - PartSpec() : ModulePass((intptr_t)&ID) {} + PartSpec() : ModulePass(&ID) {} bool runOnModule(Module &M); }; } diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index d4194a1060e..5e50e20af4d 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -35,7 +35,7 @@ STATISTIC(NumUnreach, "Number of noreturn calls optimized"); namespace { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - PruneEH() : CallGraphSCCPass((intptr_t)&ID) {} + PruneEH() : CallGraphSCCPass(&ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(const std::vector &SCC); diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index daf8ef00053..a81bbdb3c53 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -37,7 +37,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid RaiseAllocations() - : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} + : ModulePass(&ID), MallocFunc(0), FreeFunc(0) {} // doPassInitialization - For the raise allocations pass, this finds a // declaration for malloc and free if they exist. diff --git a/lib/Transforms/IPO/StripDeadPrototypes.cpp b/lib/Transforms/IPO/StripDeadPrototypes.cpp index 7db0aa8d129..a94d78e276c 100644 --- a/lib/Transforms/IPO/StripDeadPrototypes.cpp +++ b/lib/Transforms/IPO/StripDeadPrototypes.cpp @@ -30,7 +30,7 @@ namespace { class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } + StripDeadPrototypesPass() : ModulePass(&ID) { } virtual bool runOnModule(Module &M); }; diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 63e1a7beb04..6277f07de3a 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -38,7 +38,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid explicit StripSymbols(bool ODI = false) - : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} + : ModulePass(&ID), OnlyDebugInfo(ODI) {} virtual bool runOnModule(Module &M); diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 2f44d80ae48..2a7de3dc491 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -49,7 +49,7 @@ namespace { virtual bool runOnSCC(const std::vector &SCC); static char ID; // Pass identification, replacement for typeid - SRETPromotion() : CallGraphSCCPass((intptr_t)&ID) {} + SRETPromotion() : CallGraphSCCPass(&ID) {} private: bool PromoteReturn(CallGraphNode *CGN); diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp index 2cf824b25f5..0831f3b7a48 100644 --- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp +++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp @@ -34,7 +34,7 @@ namespace { bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - EdgeProfiler() : ModulePass((intptr_t)&ID) {} + EdgeProfiler() : ModulePass(&ID) {} }; } diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index 45a7c712d8c..c6cf4dfd6eb 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -144,7 +144,7 @@ namespace { /// ProfilerRS - Insert the random sampling framework struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ProfilerRS() : FunctionPass((intptr_t)&ID) {} + ProfilerRS() : FunctionPass(&ID) {} std::map TransCache; std::set ChoicePoints; diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index aef16f7f1ce..3481c001435 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -35,7 +35,7 @@ STATISTIC(NumRemoved, "Number of instructions removed"); namespace { struct VISIBILITY_HIDDEN ADCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ADCE() : FunctionPass((intptr_t)&ID) {} + ADCE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function& F); diff --git a/lib/Transforms/Scalar/BasicBlockPlacement.cpp b/lib/Transforms/Scalar/BasicBlockPlacement.cpp index 041bed234b6..fb9b88005b6 100644 --- a/lib/Transforms/Scalar/BasicBlockPlacement.cpp +++ b/lib/Transforms/Scalar/BasicBlockPlacement.cpp @@ -42,7 +42,7 @@ STATISTIC(NumMoved, "Number of basic blocks moved"); namespace { struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BlockPlacement() : FunctionPass((intptr_t)&ID) {} + BlockPlacement() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index da0d287817c..a000c009cc6 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -43,7 +43,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid explicit CodeGenPrepare(const TargetLowering *tli = 0) - : FunctionPass((intptr_t)&ID), TLI(tli) {} + : FunctionPass(&ID), TLI(tli) {} bool runOnFunction(Function &F); private: diff --git a/lib/Transforms/Scalar/CondPropagate.cpp b/lib/Transforms/Scalar/CondPropagate.cpp index c1e419569f4..126e13e453a 100644 --- a/lib/Transforms/Scalar/CondPropagate.cpp +++ b/lib/Transforms/Scalar/CondPropagate.cpp @@ -32,7 +32,7 @@ STATISTIC(NumSwThread, "Number of CFG edges threaded through switches"); namespace { struct VISIBILITY_HIDDEN CondProp : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CondProp() : FunctionPass((intptr_t)&ID) {} + CondProp() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index 05bb4f0c7be..b933488cf63 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -35,7 +35,7 @@ STATISTIC(NumInstKilled, "Number of instructions killed"); namespace { struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ConstantPropagation() : FunctionPass((intptr_t)&ID) {} + ConstantPropagation() : FunctionPass(&ID) {} bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index a63fcb6589f..cb78207d760 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -69,7 +69,7 @@ namespace { // struct DCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DCE() : FunctionPass((intptr_t)&ID) {} + DCE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index b75d5c4be7e..7e5fbcb8014 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -39,7 +39,7 @@ STATISTIC(NumFastOther , "Number of other instrs removed"); namespace { struct VISIBILITY_HIDDEN DSE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DSE() : FunctionPass((intptr_t)&ID) {} + DSE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index b258fcc08c0..1e5be4ab1a7 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -697,7 +697,7 @@ namespace { bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - GVN() : FunctionPass((intptr_t)&ID) { } + GVN() : FunctionPass(&ID) { } private: ValueTable VN; diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index e0c869fbf8d..e3b09379a22 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -672,7 +672,7 @@ namespace { bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - GVNPRE() : FunctionPass((intptr_t)&ID) { } + GVNPRE() : FunctionPass(&ID) {} private: ValueTable VN; diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 5d709e50fbb..3d29fd68637 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -70,7 +70,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - IndVarSimplify() : LoopPass((intptr_t)&ID) {} + IndVarSimplify() : LoopPass(&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); bool doInitialization(Loop *L, LPPassManager &LPM); diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index aedad72037e..6b25f52a818 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -80,7 +80,7 @@ namespace { bool MustPreserveLCSSA; public: static char ID; // Pass identification, replacement for typeid - InstCombiner() : FunctionPass((intptr_t)&ID) {} + InstCombiner() : FunctionPass(&ID) {} /// AddToWorkList - Add the specified instruction to the worklist if it /// isn't already in it. diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index 1d3bfbfe7c2..2f91c07c94e 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -52,7 +52,7 @@ namespace { class VISIBILITY_HIDDEN JumpThreading : public FunctionPass { public: static char ID; // Pass identification - JumpThreading() : FunctionPass((intptr_t)&ID) {} + JumpThreading() : FunctionPass(&ID) {} bool runOnFunction(Function &F); bool ThreadBlock(BasicBlock *BB); diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index aef1cd6f6f8..3eee4a27f7d 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -74,7 +74,7 @@ EnableLICMConstantMotion("enable-licm-constant-variables", cl::Hidden, namespace { struct VISIBILITY_HIDDEN LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid - LICM() : LoopPass((intptr_t)&ID) {} + LICM() : LoopPass(&ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index f68a5f7125a..74190f5f776 100644 --- a/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/lib/Transforms/Scalar/LoopDeletion.cpp @@ -30,7 +30,7 @@ namespace { class VISIBILITY_HIDDEN LoopDeletion : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopDeletion() : LoopPass((intptr_t)&ID) { } + LoopDeletion() : LoopPass(&ID) {} // Possibly eliminate loop L if it is dead. bool runOnLoop(Loop* L, LPPassManager& LPM); diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 1ab9a18cf6f..d8a1eb68aa3 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -33,7 +33,7 @@ namespace { public: static char ID; // Pass ID, replacement for typeid - LoopIndexSplit() : LoopPass((intptr_t)&ID) {} + LoopIndexSplit() : LoopPass(&ID) {} // Index split Loop L. Return true if loop is split. bool runOnLoop(Loop *L, LPPassManager &LPM); diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index f0dd40bd339..488ab0eacff 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -48,7 +48,7 @@ namespace { public: static char ID; // Pass ID, replacement for typeid - LoopRotate() : LoopPass((intptr_t)&ID) {} + LoopRotate() : LoopPass(&ID) {} // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 96fa0e9eb16..6d8de40780a 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -148,7 +148,7 @@ namespace { public: static char ID; // Pass ID, replacement for typeid explicit LoopStrengthReduce(const TargetLowering *tli = NULL) : - LoopPass((intptr_t)&ID), TLI(tli) { + LoopPass(&ID), TLI(tli) { } bool runOnLoop(Loop *L, LPPassManager &LPM); diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index 386b91c252c..ed4ea895cc2 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/lib/Transforms/Scalar/LoopUnroll.cpp @@ -42,7 +42,7 @@ namespace { class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass((intptr_t)&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 diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 5473bac555b..372e6e4f834 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -87,7 +87,7 @@ namespace { public: static char ID; // Pass ID, replacement for typeid explicit LoopUnswitch(bool Os = false) : - LoopPass((intptr_t)&ID), OptimizeForSize(Os), redoLoop(false), + LoopPass(&ID), OptimizeForSize(Os), redoLoop(false), currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL), loopPreheader(NULL) {} diff --git a/lib/Transforms/Scalar/MarkModRef.cpp b/lib/Transforms/Scalar/MarkModRef.cpp index e20278aed3e..5e83ee93103 100644 --- a/lib/Transforms/Scalar/MarkModRef.cpp +++ b/lib/Transforms/Scalar/MarkModRef.cpp @@ -28,7 +28,7 @@ STATISTIC(NumReadOnly, "Number of functions marked readonly"); namespace { struct VISIBILITY_HIDDEN MarkModRef : public FunctionPass { static char ID; // Pass identification, replacement for typeid - MarkModRef() : FunctionPass((intptr_t)&ID) {} + MarkModRef() : FunctionPass(&ID) {} bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 18f5f0c1306..8810edb5332 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -300,7 +300,7 @@ namespace { bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - MemCpyOpt() : FunctionPass((intptr_t)&ID) { } + MemCpyOpt() : FunctionPass(&ID) {} private: // This transformation requires dominator postdominator info diff --git a/lib/Transforms/Scalar/PredicateSimplifier.cpp b/lib/Transforms/Scalar/PredicateSimplifier.cpp index 9a94fad9327..665a46bfd73 100644 --- a/lib/Transforms/Scalar/PredicateSimplifier.cpp +++ b/lib/Transforms/Scalar/PredicateSimplifier.cpp @@ -2249,7 +2249,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid - PredicateSimplifier() : FunctionPass((intptr_t)&ID) {} + PredicateSimplifier() : FunctionPass(&ID) {} bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index dbb87c5e5b4..313723cfefa 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -72,7 +72,7 @@ namespace { bool MadeChange; public: static char ID; // Pass identification, replacement for typeid - Reassociate() : FunctionPass((intptr_t)&ID) {} + Reassociate() : FunctionPass(&ID) {} bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/Reg2Mem.cpp b/lib/Transforms/Scalar/Reg2Mem.cpp index ce38b08ef97..46b2952b4cc 100644 --- a/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/lib/Transforms/Scalar/Reg2Mem.cpp @@ -36,7 +36,7 @@ STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted"); namespace { struct VISIBILITY_HIDDEN RegToMem : public FunctionPass { static char ID; // Pass identification, replacement for typeid - RegToMem() : FunctionPass((intptr_t)&ID) {} + RegToMem() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index ed0f727ecdf..48842b2e385 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1497,7 +1497,7 @@ namespace { /// struct VISIBILITY_HIDDEN SCCP : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SCCP() : FunctionPass((intptr_t)&ID) {} + SCCP() : FunctionPass(&ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. @@ -1611,7 +1611,7 @@ namespace { /// struct VISIBILITY_HIDDEN IPSCCP : public ModulePass { static char ID; - IPSCCP() : ModulePass((intptr_t)&ID) {} + IPSCCP() : ModulePass(&ID) {} bool runOnModule(Module &M); }; } // end anonymous namespace diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index c5ca22145e3..c29202826c2 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -48,7 +48,7 @@ STATISTIC(NumGlobals, "Number of allocas copied from constant global"); namespace { struct VISIBILITY_HIDDEN SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid - explicit SROA(signed T = -1) : FunctionPass((intptr_t)&ID) { + explicit SROA(signed T = -1) : FunctionPass(&ID) { if (T == -1) SRThreshold = 128; else diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 23683289c0b..cd063079f68 100644 --- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -41,7 +41,7 @@ STATISTIC(NumSimpl, "Number of blocks simplified"); namespace { struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {} + CFGSimplifyPass() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); }; diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 8ef88553555..965d1ce0dee 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -1206,7 +1206,7 @@ namespace { FWriteOpt FWrite; FPutsOpt FPuts; FPrintFOpt FPrintF; public: static char ID; // Pass identification - SimplifyLibCalls() : FunctionPass((intptr_t)&ID) {} + SimplifyLibCalls() : FunctionPass(&ID) {} void InitOptimizations(); bool runOnFunction(Function &F); diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index d0998ab5a65..568ec06e39f 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -48,7 +48,7 @@ namespace { bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - TailDup() : FunctionPass((intptr_t)&ID) {} + TailDup() : FunctionPass(&ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned); diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index 6fcf55b581a..e1234efb578 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -68,7 +68,7 @@ STATISTIC(NumAccumAdded, "Number of accumulators introduced"); namespace { struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass { static char ID; // Pass identification, replacement for typeid - TailCallElim() : FunctionPass((intptr_t)&ID) {} + TailCallElim() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index a821423d17f..a32c0167128 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -35,7 +35,7 @@ STATISTIC(NumBroken, "Number of blocks inserted"); namespace { struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {} + BreakCriticalEdges() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 55d7a485931..bcba3c13990 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -49,7 +49,7 @@ STATISTIC(NumLCSSA, "Number of live out of a loop variables"); namespace { struct VISIBILITY_HIDDEN LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid - LCSSA() : LoopPass((intptr_t)&ID) {} + LCSSA() : LoopPass(&ID) {} // Cached analysis information for the current function. LoopInfo *LI; diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 3267af74c3e..af41036252b 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -56,7 +56,7 @@ STATISTIC(NumNested , "Number of nested loops split out"); namespace { struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass { static char ID; // Pass identification, replacement for typeid - LoopSimplify() : FunctionPass((intptr_t)&ID) {} + LoopSimplify() : FunctionPass(&ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 4223c7f4813..792e98ea428 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -38,7 +38,7 @@ namespace { public: static char ID; // Pass ID, replacement for typeid explicit LowerAllocations(bool LowerToInt = false) - : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0), + : BasicBlockPass(&ID), MallocFunc(0), FreeFunc(0), LowerMallocArgToInteger(LowerToInt) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 0f86765a70d..437fdbe04dd 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -78,7 +78,7 @@ namespace { public: static char ID; // Pass identification, replacement for typeid explicit LowerInvoke(const TargetLowering *tli = NULL) - : FunctionPass((intptr_t)&ID), TLI(tli) { } + : FunctionPass(&ID), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index 99e938416ec..a7b1efc794f 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -33,7 +33,7 @@ namespace { class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LowerSwitch() : FunctionPass((intptr_t) &ID) {} + LowerSwitch() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp index 1a936c04141..2b06d778e14 100644 --- a/lib/Transforms/Utils/Mem2Reg.cpp +++ b/lib/Transforms/Utils/Mem2Reg.cpp @@ -28,7 +28,7 @@ STATISTIC(NumPromoted, "Number of alloca's promoted"); namespace { struct VISIBILITY_HIDDEN PromotePass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PromotePass() : FunctionPass((intptr_t)&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. diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index d7b3cc7e638..42b33ff66b1 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -73,7 +73,7 @@ class VISIBILITY_HIDDEN BBPassManager : public PMDataManager, public: static char ID; explicit BBPassManager(int Depth) - : PMDataManager(Depth), FunctionPass((intptr_t)&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. @@ -129,7 +129,7 @@ class FunctionPassManagerImpl : public Pass, public: static char ID; explicit FunctionPassManagerImpl(int Depth) : - Pass((intptr_t)&ID), PMDataManager(Depth), + Pass(&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -193,7 +193,7 @@ class MPPassManager : public Pass, public PMDataManager { public: static char ID; explicit MPPassManager(int Depth) : - Pass((intptr_t)&ID), PMDataManager(Depth) { } + Pass(&ID), PMDataManager(Depth) { } // Delete on the fly managers. virtual ~MPPassManager() { @@ -269,8 +269,7 @@ class PassManagerImpl : public Pass, public: static char ID; explicit PassManagerImpl(int Depth) : - Pass((intptr_t)&ID), PMDataManager(Depth), - PMTopLevelManager(TLM_Pass) { } + Pass(&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 5ca8e1a23a2..aa6963d94a2 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -70,7 +70,7 @@ namespace { // Anonymous namespace for class struct VISIBILITY_HIDDEN PreVerifier : public FunctionPass { static char ID; // Pass ID, replacement for typeid - PreVerifier() : FunctionPass((intptr_t)&ID) { } + PreVerifier() : FunctionPass(&ID) { } // Check that the prerequisites for successful DominatorTree construction // are satisfied. @@ -118,20 +118,20 @@ namespace { SmallPtrSet InstsInThisBlock; Verifier() - : FunctionPass((intptr_t)&ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action(AbortProcessAction), DT(0), msgs( std::ios::app | std::ios::out ) {} explicit Verifier(VerifierFailureAction ctn) - : FunctionPass((intptr_t)&ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action(ctn), DT(0), msgs( std::ios::app | std::ios::out ) {} explicit Verifier(bool AB) - : FunctionPass((intptr_t)&ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action( AB ? AbortProcessAction : PrintMessageAction), DT(0), msgs( std::ios::app | std::ios::out ) {} explicit Verifier(DominatorTree &dt) - : FunctionPass((intptr_t)&ID), + : FunctionPass(&ID), Broken(false), RealPass(false), action(PrintMessageAction), DT(&dt), msgs( std::ios::app | std::ios::out ) {}