summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-04 17:05:41 +0000
committerDan Gohman <gohman@apple.com>2008-09-04 17:05:41 +0000
commitae73dc1448d25b02cabc7c64c86c64371453dda8 (patch)
treeaf8e2a48c6bdac1ac118d027226915ef67e8bdac /lib/Transforms/IPO
parent79924eb6f5708a2ae36ba22b674b2d7bea3167e6 (diff)
downloadllvm-ae73dc1448d25b02cabc7c64c86c64371453dda8.tar.gz
llvm-ae73dc1448d25b02cabc7c64c86c64371453dda8.tar.bz2
llvm-ae73dc1448d25b02cabc7c64c86c64371453dda8.tar.xz
Tidy up several unbeseeming casts from pointer to intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp2
-rw-r--r--lib/Transforms/IPO/ConstantMerge.cpp2
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp2
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp2
-rw-r--r--lib/Transforms/IPO/ExtractGV.cpp2
-rw-r--r--lib/Transforms/IPO/GlobalDCE.cpp2
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp2
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp2
-rw-r--r--lib/Transforms/IPO/Inliner.cpp8
-rw-r--r--lib/Transforms/IPO/Internalize.cpp4
-rw-r--r--lib/Transforms/IPO/LoopExtractor.cpp6
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp2
-rw-r--r--lib/Transforms/IPO/PartialSpecialization.cpp2
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp2
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp2
-rw-r--r--lib/Transforms/IPO/StripDeadPrototypes.cpp2
-rw-r--r--lib/Transforms/IPO/StripSymbols.cpp2
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp2
19 files changed, 25 insertions, 25 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 5934c5ea24..97433801da 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -66,7 +66,7 @@ namespace {
virtual bool runOnSCC(const std::vector<CallGraphNode *> &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 86cfcc4624..b4bab2d0e7 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 5f1920b061..ec8f1364e8 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 3cb658ef72..85aed2b791 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 03a8e5cebc..d409b6e806 100644
--- a/lib/Transforms/IPO/ExtractGV.cpp
+++ b/lib/Transforms/IPO/ExtractGV.cpp
@@ -35,7 +35,7 @@ namespace {
///
explicit GVExtractorPass(std::vector<GlobalValue*>& 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 608705b10a..020c70ab37 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 f63ef46a85..f9a7c73534 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -57,7 +57,7 @@ namespace {
AU.addRequired<TargetData>();
}
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 42c02e6a45..aecec44aea 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 8448374859..2e09fe967f 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 38cb67dddf..88b6afdebb 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -34,11 +34,11 @@ static cl::opt<int>
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 577d69cf60..cbfccf2a2c 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -60,7 +60,7 @@ static RegisterPass<InternalizePass>
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<const char *>&exportList)
- : ModulePass((intptr_t)&ID), AllButMain(false){
+ : ModulePass(&ID), AllButMain(false){
for(std::vector<const char *>::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 8e55b3f091..0c654438d5 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<BasicBlock*> &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 80158b43a5..d5997fb4b5 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 d39ea58ab6..949358e7bc 100644
--- a/lib/Transforms/IPO/PartialSpecialization.cpp
+++ b/lib/Transforms/IPO/PartialSpecialization.cpp
@@ -45,7 +45,7 @@ namespace {
int scanDistribution(Function&, int, std::map<Constant*, int>&);
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 d4194a1060..5e50e20af4 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<CallGraphNode *> &SCC);
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp
index daf8ef0005..a81bbdb3c5 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 7db0aa8d12..a94d78e276 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 63e1a7beb0..6277f07de3 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 2f44d80ae4..2a7de3dc49 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -49,7 +49,7 @@ namespace {
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
static char ID; // Pass identification, replacement for typeid
- SRETPromotion() : CallGraphSCCPass((intptr_t)&ID) {}
+ SRETPromotion() : CallGraphSCCPass(&ID) {}
private:
bool PromoteReturn(CallGraphNode *CGN);