diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-04 17:05:41 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-04 17:05:41 +0000 |
commit | ae73dc1448d25b02cabc7c64c86c64371453dda8 (patch) | |
tree | af8e2a48c6bdac1ac118d027226915ef67e8bdac /lib/CodeGen | |
parent | 79924eb6f5708a2ae36ba22b674b2d7bea3167e6 (diff) |
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/CodeGen')
26 files changed, 29 insertions, 30 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a720f04a9a..03a61d42cd 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 2ccfd191a0..11866a1518 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 6f29112caf..0b6e0b1b10 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 efb89e128e..f2978f8888 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 d46b525687..517b3a7762 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 079b701648..38fce9b435 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 44f5bb461d..51c635661f 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 90bd595d7a..6e115ddb13 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 9f1cb00ca7..253c5ca5f4 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 ae97d890db..5aade03031 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 709234753d..723811932f 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 2010d17f85..69f8d3c014 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 b4e72fed28..0f608d637c 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 ceba842970..bd389db31f 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 8c9776e07a..41981d3ff1 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 be8a54e03d..51d3698dc5 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 215f943099..380ad059cf 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 c6f714a9cb..91dda77147 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<LiveInterval*, LiveInterval::iterator> IntervalPtr; typedef SmallVector<IntervalPtr, 32> IntervalPtrs; diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 5946e74902..d66031776e 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 9ad38405ae..87b09a2a0d 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 2b9ba38f20..b4ba64ea27 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 62738952aa..41d1dfb20b 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 6d0e2148c5..ab980a14ec 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<LiveStacks>(); diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp index 9f59417b5d..ebe0c01aab 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 51a3c5f52e..16b57a02b6 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -70,7 +70,7 @@ namespace { DenseMap<MachineInstr*, unsigned> &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<LiveVariables>(); diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index 7bf95bf96e..3c3fca51b6 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; |