diff options
author | Dan Gohman <gohman@apple.com> | 2009-02-18 05:09:16 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-02-18 05:09:16 +0000 |
commit | 865f006bb45a609e1cb6acb653af3fe5442ee4dc (patch) | |
tree | 0071ecd9b57dcc912f9cbfee237f2ed3e1335582 | |
parent | 38ad0191e9d1a9887ee355afe12d22b38a608f72 (diff) |
Eliminate several more unnecessary intptr_t casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64888 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/WritingAnLLVMPass.html | 4 | ||||
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/Analysis/LoopVR.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineLoopInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/PassManagers.h | 2 | ||||
-rw-r--r-- | include/llvm/Target/TargetData.h | 6 | ||||
-rw-r--r-- | lib/CodeGen/GCMetadata.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/GCStrategy.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/MachineDominators.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/DCE.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/PrintModulePass.cpp | 8 | ||||
-rw-r--r-- | tools/bugpoint/TestPasses.cpp | 4 | ||||
-rw-r--r-- | tools/opt/AnalysisWrappers.cpp | 4 | ||||
-rw-r--r-- | tools/opt/GraphPrinters.cpp | 4 | ||||
-rw-r--r-- | tools/opt/PrintSCC.cpp | 4 | ||||
-rw-r--r-- | tools/opt/opt.cpp | 10 |
16 files changed, 31 insertions, 31 deletions
diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index 04bd926611..9eb97e1d66 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -265,7 +265,7 @@ time.</p> <div class="doc_code"><pre> static char ID; - Hello() : FunctionPass((intptr_t)&ID) {} + Hello() : FunctionPass(&ID) {} </pre></div><p> <p> This declares pass identifier used by LLVM to identify pass. This allows LLVM to @@ -319,7 +319,7 @@ is supplied as fourth argument. </p> <b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> { static char ID; - Hello() : FunctionPass((intptr_t)&ID) {} + Hello() : FunctionPass(&ID) {} <b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &F) { llvm::cerr << "<i>Hello: </i>" << F.getName() << "\n"; diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index b2268a2d74..3961675980 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -937,7 +937,7 @@ class LoopInfo : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LoopInfo() : FunctionPass(intptr_t(&ID)) { + LoopInfo() : FunctionPass(&ID) { LI = new LoopInfoBase<BasicBlock>(); } diff --git a/include/llvm/Analysis/LoopVR.h b/include/llvm/Analysis/LoopVR.h index db260c4350..1d806f83aa 100644 --- a/include/llvm/Analysis/LoopVR.h +++ b/include/llvm/Analysis/LoopVR.h @@ -30,7 +30,7 @@ class LoopVR : public FunctionPass { public: static char ID; // Class identification, replacement for typeinfo - LoopVR() : FunctionPass(intptr_t(&ID)) {} + LoopVR() : FunctionPass(&ID) {} bool runOnFunction(Function &F); virtual void print(std::ostream &os, const Module *) const; diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h index dc5350722e..8c96308ac9 100644 --- a/include/llvm/CodeGen/MachineLoopInfo.h +++ b/include/llvm/CodeGen/MachineLoopInfo.h @@ -77,7 +77,7 @@ class MachineLoopInfo : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - MachineLoopInfo() : MachineFunctionPass(intptr_t(&ID)) { + MachineLoopInfo() : MachineFunctionPass(&ID) { LI = new LoopInfoBase<MachineBasicBlock>(); } diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index 22d5062b6b..2d68239e2a 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -384,7 +384,7 @@ class FPPassManager : public ModulePass, public PMDataManager { public: static char ID; explicit FPPassManager(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/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 92feebf01a..7e7785bb40 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -109,7 +109,7 @@ public: /// /// @note This has to exist, because this is a pass, but it should never be /// used. - TargetData() : ImmutablePass(intptr_t(&ID)) { + TargetData() : ImmutablePass(&ID) { assert(0 && "ERROR: Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); abort(); @@ -117,7 +117,7 @@ public: /// Constructs a TargetData from a specification string. See init(). explicit TargetData(const std::string &TargetDescription) - : ImmutablePass(intptr_t(&ID)) { + : ImmutablePass(&ID) { init(TargetDescription); } @@ -125,7 +125,7 @@ public: explicit TargetData(const Module *M); TargetData(const TargetData &TD) : - ImmutablePass(intptr_t(&ID)), + ImmutablePass(&ID), LittleEndian(TD.isLittleEndian()), PointerMemSize(TD.PointerMemSize), PointerABIAlign(TD.PointerABIAlign), diff --git a/lib/CodeGen/GCMetadata.cpp b/lib/CodeGen/GCMetadata.cpp index 4742ad8bbb..cf2ebb39ad 100644 --- a/lib/CodeGen/GCMetadata.cpp +++ b/lib/CodeGen/GCMetadata.cpp @@ -129,7 +129,7 @@ FunctionPass *llvm::createGCInfoPrinter(std::ostream &OS) { } Printer::Printer(std::ostream &OS) - : FunctionPass(intptr_t(&ID)), OS(OS) {} + : FunctionPass(&ID), OS(OS) {} const char *Printer::getPassName() const { return "Print Garbage Collector Information"; @@ -189,7 +189,7 @@ FunctionPass *llvm::createGCInfoDeleter() { return new Deleter(); } -Deleter::Deleter() : FunctionPass(intptr_t(&ID)) {} +Deleter::Deleter() : FunctionPass(&ID) {} const char *Deleter::getPassName() const { return "Delete Garbage Collector Information"; diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index 3ec368fe73..ad7421abc2 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -313,7 +313,7 @@ FunctionPass *llvm::createGCMachineCodeAnalysisPass() { char MachineCodeAnalysis::ID = 0; MachineCodeAnalysis::MachineCodeAnalysis() - : MachineFunctionPass(intptr_t(&ID)) {} + : MachineFunctionPass(&ID) {} const char *MachineCodeAnalysis::getPassName() const { return "Analyze Machine Code For Garbage Collection"; diff --git a/lib/CodeGen/MachineDominators.cpp b/lib/CodeGen/MachineDominators.cpp index f782048437..37c86019d4 100644 --- a/lib/CodeGen/MachineDominators.cpp +++ b/lib/CodeGen/MachineDominators.cpp @@ -39,7 +39,7 @@ bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) { } MachineDominatorTree::MachineDominatorTree() - : MachineFunctionPass(intptr_t(&ID)) { + : MachineFunctionPass(&ID) { DT = new DominatorTreeBase<MachineBasicBlock>(false); } diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index a5990ee79e..8bb504c09c 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -36,7 +36,7 @@ namespace { // struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass { static char ID; // Pass identification, replacement for typeid - DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {} + DeadInstElimination() : BasicBlockPass(&ID) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) { diff --git a/lib/VMCore/PrintModulePass.cpp b/lib/VMCore/PrintModulePass.cpp index 61e5889bb7..7cb009a7d3 100644 --- a/lib/VMCore/PrintModulePass.cpp +++ b/lib/VMCore/PrintModulePass.cpp @@ -27,10 +27,10 @@ namespace { bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintModulePass() : ModulePass(intptr_t(&ID)), Out(&errs()), + PrintModulePass() : ModulePass(&ID), Out(&errs()), DeleteStream(false) {} PrintModulePass(raw_ostream *o, bool DS) - : ModulePass(intptr_t(&ID)), Out(o), DeleteStream(DS) {} + : ModulePass(&ID), 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(intptr_t(&ID)), Banner(""), Out(&errs()), + PrintFunctionPass() : FunctionPass(&ID), Banner(""), Out(&errs()), DeleteStream(false) {} PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS) - : FunctionPass(intptr_t(&ID)), Banner(B), Out(o), DeleteStream(DS) {} + : FunctionPass(&ID), Banner(B), Out(o), DeleteStream(DS) {} inline ~PrintFunctionPass() { if (DeleteStream) delete Out; diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp index db7544b57a..900bf632a8 100644 --- a/tools/bugpoint/TestPasses.cpp +++ b/tools/bugpoint/TestPasses.cpp @@ -27,7 +27,7 @@ namespace { class CrashOnCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass((intptr_t)&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((intptr_t)&ID) {} + DeleteCalls() : BasicBlockPass(&ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 94cca50d63..631a0ddbfb 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -31,7 +31,7 @@ namespace { /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {} + ExternalFunctionsPassedConstants() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (I->isDeclaration()) { @@ -70,7 +70,7 @@ namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass((intptr_t)&ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index 31515c8993..a52baf7dae 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -62,7 +62,7 @@ namespace llvm { namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass((intptr_t)&ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { WriteGraphToFile(std::cerr, "callgraph", &getAnalysis<CallGraph>()); @@ -91,7 +91,7 @@ namespace { class DomInfoPrinter : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - DomInfoPrinter() : FunctionPass((intptr_t)&ID) {} + DomInfoPrinter() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index f314baaba9..be652644a6 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -36,7 +36,7 @@ using namespace llvm; namespace { struct CFGSCC : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSCC() : FunctionPass((intptr_t)&ID) {} + CFGSCC() : FunctionPass(&ID) {} bool runOnFunction(Function& func); void print(std::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((intptr_t)&ID) {} + CallGraphSCC() : ModulePass(&ID) {} // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index b46f7c9188..680353ad23 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -122,7 +122,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { static char ID; const PassInfo *PassToPrint; CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass((intptr_t)&ID), PassToPrint(PI) {} + CallGraphSCCPass(&ID), PassToPrint(PI) {} virtual bool runOnSCC(const std::vector<CallGraphNode *>&SCC) { if (!Quiet) { @@ -151,7 +151,7 @@ char CallGraphSCCPassPrinter::ID = 0; struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID), + ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID), PassToPrint(PI) {} virtual bool runOnModule(Module &M) { @@ -176,7 +176,7 @@ char ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID), + FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID), PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { @@ -203,7 +203,7 @@ struct LoopPassPrinter : public LoopPass { static char ID; const PassInfo *PassToPrint; LoopPassPrinter(const PassInfo *PI) : - LoopPass((intptr_t)&ID), PassToPrint(PI) {} + LoopPass(&ID), PassToPrint(PI) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { @@ -229,7 +229,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; static char ID; BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {} + : BasicBlockPass(&ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { |