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
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 5934c5e..9743380 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -66,7 +66,7 @@
 
     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 86cfcc4..b4bab2d 100644
--- a/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/lib/Transforms/IPO/ConstantMerge.cpp
@@ -31,7 +31,7 @@
 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 5f1920b..ec8f136 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -121,7 +121,7 @@
 
   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 3cb658e..85aed2b 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -27,7 +27,7 @@
 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 03a8e5c..d409b6e 100644
--- a/lib/Transforms/IPO/ExtractGV.cpp
+++ b/lib/Transforms/IPO/ExtractGV.cpp
@@ -35,7 +35,7 @@
     ///
     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 608705b..020c70a 100644
--- a/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/lib/Transforms/IPO/GlobalDCE.cpp
@@ -31,7 +31,7 @@
 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 f63ef46..f9a7c73 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -57,7 +57,7 @@
       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 42c02e6..aecec44 100644
--- a/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -36,7 +36,7 @@
   ///
   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 8448374..2e09fe9 100644
--- a/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/lib/Transforms/IPO/IndMemRemoval.cpp
@@ -33,7 +33,7 @@
   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 38cb67d..88b6afd 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -34,11 +34,11 @@
 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 577d69c..cbfccf2 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -60,7 +60,7 @@
 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(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 8e55b3f..0c65443 100644
--- a/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/lib/Transforms/IPO/LoopExtractor.cpp
@@ -41,7 +41,7 @@
     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 @@
   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 80158b4..d5997fb 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -112,7 +112,7 @@
     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 d39ea58..949358e 100644
--- a/lib/Transforms/IPO/PartialSpecialization.cpp
+++ b/lib/Transforms/IPO/PartialSpecialization.cpp
@@ -45,7 +45,7 @@
     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 d4194a1..5e50e20 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -35,7 +35,7 @@
 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 daf8ef0..a81bbdb 100644
--- a/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -37,7 +37,7 @@
   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 7db0aa8..a94d78e 100644
--- a/lib/Transforms/IPO/StripDeadPrototypes.cpp
+++ b/lib/Transforms/IPO/StripDeadPrototypes.cpp
@@ -30,7 +30,7 @@
 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 63e1a7b..6277f07 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -38,7 +38,7 @@
   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 2f44d80..2a7de3d 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -49,7 +49,7 @@
 
     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);