[llvm-commits] [llvm] r64888 - in /llvm/trunk: docs/WritingAnLLVMPass.html include/llvm/Analysis/LoopInfo.h include/llvm/Analysis/LoopVR.h include/llvm/CodeGen/MachineLoopInfo.h include/llvm/PassManagers.h include/llvm/Target/TargetData.h lib/CodeGen/GCMetadata.cpp lib/CodeGen/GCStrategy.cpp lib/CodeGen/MachineDominators.cpp lib/Transforms/Scalar/DCE.cpp lib/VMCore/PrintModulePass.cpp tools/bugpoint/TestPasses.cpp tools/opt/AnalysisWrappers.cpp tools/opt/GraphPrinters.cpp tools/opt/PrintSCC.cpp tools/opt/opt.cpp
Dan Gohman
gohman at apple.com
Tue Feb 17 21:09:20 PST 2009
Author: djg
Date: Tue Feb 17 23:09:16 2009
New Revision: 64888
URL: http://llvm.org/viewvc/llvm-project?rev=64888&view=rev
Log:
Eliminate several more unnecessary intptr_t casts.
Modified:
llvm/trunk/docs/WritingAnLLVMPass.html
llvm/trunk/include/llvm/Analysis/LoopInfo.h
llvm/trunk/include/llvm/Analysis/LoopVR.h
llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h
llvm/trunk/include/llvm/PassManagers.h
llvm/trunk/include/llvm/Target/TargetData.h
llvm/trunk/lib/CodeGen/GCMetadata.cpp
llvm/trunk/lib/CodeGen/GCStrategy.cpp
llvm/trunk/lib/CodeGen/MachineDominators.cpp
llvm/trunk/lib/Transforms/Scalar/DCE.cpp
llvm/trunk/lib/VMCore/PrintModulePass.cpp
llvm/trunk/tools/bugpoint/TestPasses.cpp
llvm/trunk/tools/opt/AnalysisWrappers.cpp
llvm/trunk/tools/opt/GraphPrinters.cpp
llvm/trunk/tools/opt/PrintSCC.cpp
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Tue Feb 17 23:09:16 2009
@@ -265,7 +265,7 @@
<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 @@
<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";
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Feb 17 23:09:16 2009
@@ -937,7 +937,7 @@
public:
static char ID; // Pass identification, replacement for typeid
- LoopInfo() : FunctionPass(intptr_t(&ID)) {
+ LoopInfo() : FunctionPass(&ID) {
LI = new LoopInfoBase<BasicBlock>();
}
Modified: llvm/trunk/include/llvm/Analysis/LoopVR.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopVR.h?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopVR.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopVR.h Tue Feb 17 23:09:16 2009
@@ -30,7 +30,7 @@
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;
Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Tue Feb 17 23:09:16 2009
@@ -77,7 +77,7 @@
public:
static char ID; // Pass identification, replacement for typeid
- MachineLoopInfo() : MachineFunctionPass(intptr_t(&ID)) {
+ MachineLoopInfo() : MachineFunctionPass(&ID) {
LI = new LoopInfoBase<MachineBasicBlock>();
}
Modified: llvm/trunk/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassManagers.h (original)
+++ llvm/trunk/include/llvm/PassManagers.h Tue Feb 17 23:09:16 2009
@@ -384,7 +384,7 @@
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.
Modified: llvm/trunk/include/llvm/Target/TargetData.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetData.h (original)
+++ llvm/trunk/include/llvm/Target/TargetData.h Tue Feb 17 23:09:16 2009
@@ -109,7 +109,7 @@
///
/// @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 @@
/// 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 @@
explicit TargetData(const Module *M);
TargetData(const TargetData &TD) :
- ImmutablePass(intptr_t(&ID)),
+ ImmutablePass(&ID),
LittleEndian(TD.isLittleEndian()),
PointerMemSize(TD.PointerMemSize),
PointerABIAlign(TD.PointerABIAlign),
Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Tue Feb 17 23:09:16 2009
@@ -129,7 +129,7 @@
}
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 @@
return new Deleter();
}
-Deleter::Deleter() : FunctionPass(intptr_t(&ID)) {}
+Deleter::Deleter() : FunctionPass(&ID) {}
const char *Deleter::getPassName() const {
return "Delete Garbage Collector Information";
Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Tue Feb 17 23:09:16 2009
@@ -313,7 +313,7 @@
char MachineCodeAnalysis::ID = 0;
MachineCodeAnalysis::MachineCodeAnalysis()
- : MachineFunctionPass(intptr_t(&ID)) {}
+ : MachineFunctionPass(&ID) {}
const char *MachineCodeAnalysis::getPassName() const {
return "Analyze Machine Code For Garbage Collection";
Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Tue Feb 17 23:09:16 2009
@@ -39,7 +39,7 @@
}
MachineDominatorTree::MachineDominatorTree()
- : MachineFunctionPass(intptr_t(&ID)) {
+ : MachineFunctionPass(&ID) {
DT = new DominatorTreeBase<MachineBasicBlock>(false);
}
Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Tue Feb 17 23:09:16 2009
@@ -36,7 +36,7 @@
//
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(); ) {
Modified: llvm/trunk/lib/VMCore/PrintModulePass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PrintModulePass.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PrintModulePass.cpp (original)
+++ llvm/trunk/lib/VMCore/PrintModulePass.cpp Tue Feb 17 23:09:16 2009
@@ -27,10 +27,10 @@
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 @@
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;
Modified: llvm/trunk/tools/bugpoint/TestPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/TestPasses.cpp (original)
+++ llvm/trunk/tools/bugpoint/TestPasses.cpp Tue Feb 17 23:09:16 2009
@@ -27,7 +27,7 @@
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 @@
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)
Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original)
+++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Tue Feb 17 23:09:16 2009
@@ -31,7 +31,7 @@
/// 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 @@
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();
Modified: llvm/trunk/tools/opt/GraphPrinters.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/tools/opt/GraphPrinters.cpp (original)
+++ llvm/trunk/tools/opt/GraphPrinters.cpp Tue Feb 17 23:09:16 2009
@@ -62,7 +62,7 @@
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 @@
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();
Modified: llvm/trunk/tools/opt/PrintSCC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/tools/opt/PrintSCC.cpp (original)
+++ llvm/trunk/tools/opt/PrintSCC.cpp Tue Feb 17 23:09:16 2009
@@ -36,7 +36,7 @@
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 @@
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);
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=64888&r1=64887&r2=64888&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Tue Feb 17 23:09:16 2009
@@ -122,7 +122,7 @@
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 @@
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 @@
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 @@
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 @@
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) {
More information about the llvm-commits
mailing list