Tidy up several unbeseeming casts from pointer to intptr_t.

llvm-svn: 55779
This commit is contained in:
Dan Gohman 2008-09-04 17:05:41 +00:00
parent 4b19157ba9
commit a79db30d28
137 changed files with 170 additions and 169 deletions

View File

@ -720,7 +720,7 @@ public:
static char ID; // Pass ID, replacement for typeid static char ID; // Pass ID, replacement for typeid
DominatorTreeBase<BasicBlock>* DT; DominatorTreeBase<BasicBlock>* DT;
DominatorTree() : FunctionPass(intptr_t(&ID)) { DominatorTree() : FunctionPass(&ID) {
DT = new DominatorTreeBase<BasicBlock>(false); DT = new DominatorTreeBase<BasicBlock>(false);
} }
@ -911,7 +911,7 @@ protected:
const bool IsPostDominators; const bool IsPostDominators;
public: public:
DominanceFrontierBase(intptr_t ID, bool isPostDom) DominanceFrontierBase(void *ID, bool isPostDom)
: FunctionPass(ID), IsPostDominators(isPostDom) {} : FunctionPass(ID), IsPostDominators(isPostDom) {}
/// getRoots - Return the root blocks of the current CFG. This may include /// getRoots - Return the root blocks of the current CFG. This may include
@ -1030,7 +1030,7 @@ class DominanceFrontier : public DominanceFrontierBase {
public: public:
static char ID; // Pass ID, replacement for typeid static char ID; // Pass ID, replacement for typeid
DominanceFrontier() : DominanceFrontier() :
DominanceFrontierBase(intptr_t(&ID), false) {} DominanceFrontierBase(&ID, false) {}
BasicBlock *getRoot() const { BasicBlock *getRoot() const {
assert(Roots.size() == 1 && "Should always have entry node!"); assert(Roots.size() == 1 && "Should always have entry node!");

View File

@ -25,7 +25,7 @@ class FindUsedTypes : public ModulePass {
std::set<const Type *> UsedTypes; std::set<const Type *> UsedTypes;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
FindUsedTypes() : ModulePass((intptr_t)&ID) {} FindUsedTypes() : ModulePass(&ID) {}
/// getTypes - After the pass has been run, return the set containing all of /// getTypes - After the pass has been run, return the set containing all of
/// the types used in the module. /// the types used in the module.

View File

@ -48,7 +48,7 @@ class IntervalPartition : public FunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} IntervalPartition() : FunctionPass(&ID), RootInterval(0) {}
// run - Calculate the interval partition for this function // run - Calculate the interval partition for this function
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

View File

@ -30,6 +30,7 @@ class LoopPass : public Pass {
public: public:
explicit LoopPass(intptr_t pid) : Pass(pid) {} explicit LoopPass(intptr_t pid) : Pass(pid) {}
explicit LoopPass(void *pid) : Pass(pid) {}
// runOnLoop - This method should be implemented by the subclass to perform // runOnLoop - This method should be implemented by the subclass to perform
// whatever action is necessary for the specified Loop. // whatever action is necessary for the specified Loop.

View File

@ -66,7 +66,7 @@ class MemoryDependenceAnalysis : public FunctionPass {
static Instruction* const Dirty; static Instruction* const Dirty;
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {} MemoryDependenceAnalysis() : FunctionPass(&ID) {}
/// Pass Implementation stuff. This doesn't do any analysis. /// Pass Implementation stuff. This doesn't do any analysis.
/// ///

View File

@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
DominatorTreeBase<BasicBlock>* DT; DominatorTreeBase<BasicBlock>* DT;
PostDominatorTree() : FunctionPass((intptr_t)&ID) { PostDominatorTree() : FunctionPass(&ID) {
DT = new DominatorTreeBase<BasicBlock>(true); DT = new DominatorTreeBase<BasicBlock>(true);
} }
@ -70,7 +70,7 @@ FunctionPass* createPostDomTree();
struct PostDominanceFrontier : public DominanceFrontierBase { struct PostDominanceFrontier : public DominanceFrontierBase {
static char ID; static char ID;
PostDominanceFrontier() PostDominanceFrontier()
: DominanceFrontierBase((intptr_t) &ID, true) {} : DominanceFrontierBase(&ID, true) {}
virtual bool runOnFunction(Function &) { virtual bool runOnFunction(Function &) {
Frontiers.clear(); Frontiers.clear();

View File

@ -191,7 +191,7 @@ namespace llvm {
void *Impl; // ScalarEvolution uses the pimpl pattern void *Impl; // ScalarEvolution uses the pimpl pattern
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {} ScalarEvolution() : FunctionPass(&ID), Impl(0) {}
/// getSCEV - Return a SCEV expression handle for the full generality of the /// getSCEV - Return a SCEV expression handle for the full generality of the
/// specified expression. /// specified expression.

View File

@ -32,6 +32,7 @@ class PMStack;
struct CallGraphSCCPass : public Pass { struct CallGraphSCCPass : public Pass {
explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {} explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
explicit CallGraphSCCPass(void *pid) : Pass(pid) {}
/// doInitialization - This method is called before the SCC's of the program /// doInitialization - This method is called before the SCC's of the program
/// has been processed, allowing the pass to do initialization as necessary. /// has been processed, allowing the pass to do initialization as necessary.

View File

@ -94,7 +94,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {} LiveIntervals() : MachineFunctionPass(&ID) {}
struct InstrSlots { struct InstrSlots {
enum { enum {

View File

@ -35,7 +35,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveStacks() : MachineFunctionPass((intptr_t)&ID) {} LiveStacks() : MachineFunctionPass(&ID) {}
typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::iterator iterator;
typedef SS2IntervalMap::const_iterator const_iterator; typedef SS2IntervalMap::const_iterator const_iterator;

View File

@ -43,7 +43,7 @@ class TargetRegisterInfo;
class LiveVariables : public MachineFunctionPass { class LiveVariables : public MachineFunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveVariables() : MachineFunctionPass((intptr_t)&ID) {} LiveVariables() : MachineFunctionPass(&ID) {}
/// VarInfo - This represents the regions where a virtual register is live in /// VarInfo - This represents the regions where a virtual register is live in
/// the program. We represent this with three different pieces of /// the program. We represent this with three different pieces of

View File

@ -27,6 +27,7 @@ namespace llvm {
struct MachineFunctionPass : public FunctionPass { struct MachineFunctionPass : public FunctionPass {
explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
protected: protected:
/// runOnMachineFunction - This method must be overloaded to perform the /// runOnMachineFunction - This method must be overloaded to perform the

View File

@ -26,8 +26,8 @@ namespace llvm {
/// perform the inlining operations that does not depend on the policy. /// perform the inlining operations that does not depend on the policy.
/// ///
struct Inliner : public CallGraphSCCPass { struct Inliner : public CallGraphSCCPass {
explicit Inliner(const void *ID); explicit Inliner(void *ID);
explicit Inliner(const void *ID, int Threshold); explicit Inliner(void *ID, int Threshold);
/// getAnalysisUsage - For this class, we declare that we require and preserve /// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should /// the call graph. If the derived class implements this method, it should

View File

@ -27,7 +27,7 @@ namespace llvm {
/// multiple profilers can be support simultaniously. /// multiple profilers can be support simultaniously.
struct RSProfilers : public ModulePass { struct RSProfilers : public ModulePass {
static char ID; // Pass identification, replacement for typeinfo static char ID; // Pass identification, replacement for typeinfo
RSProfilers() : ModulePass((intptr_t)&ID) {} RSProfilers() : ModulePass(&ID) {}
/// isProfiling - This method returns true if the value passed it was /// isProfiling - This method returns true if the value passed it was
/// inserted by the profiler. /// inserted by the profiler.

View File

@ -26,7 +26,7 @@ struct UnifyFunctionExitNodes : public FunctionPass {
BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID), UnifyFunctionExitNodes() : FunctionPass(&ID),
ReturnBlock(0), UnwindBlock(0) {} ReturnBlock(0), UnwindBlock(0) {}
// We can preserve non-critical-edgeness when we unify function exit nodes // We can preserve non-critical-edgeness when we unify function exit nodes

View File

@ -35,7 +35,7 @@ namespace {
Module *M; Module *M;
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { AliasAnalysisCounter() : ModulePass(&ID) {
No = May = Must = 0; No = May = Must = 0;
NoMR = JustRef = JustMod = MR = 0; NoMR = JustRef = JustMod = MR = 0;
} }

View File

@ -52,7 +52,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
AAEval() : FunctionPass((intptr_t)&ID) {} AAEval() : FunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<AliasAnalysis>(); AU.addRequired<AliasAnalysis>();

View File

@ -41,7 +41,7 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
AliasDebugger() : ModulePass((intptr_t)&ID) {} AliasDebugger() : ModulePass(&ID) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); // set up super class InitializeAliasAnalysis(this); // set up super class

View File

@ -564,7 +564,7 @@ namespace {
AliasSetTracker *Tracker; AliasSetTracker *Tracker;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} AliasSetPrinter() : FunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();

View File

@ -208,8 +208,8 @@ namespace {
/// ///
struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
NoAA() : ImmutablePass((intptr_t)&ID) {} NoAA() : ImmutablePass(&ID) {}
explicit NoAA(intptr_t PID) : ImmutablePass(PID) { } explicit NoAA(void *PID) : ImmutablePass(PID) { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>(); AU.addRequired<TargetData>();
@ -269,7 +269,7 @@ namespace {
/// derives from the NoAA class. /// derives from the NoAA class.
struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
BasicAliasAnalysis() : NoAA((intptr_t)&ID) { } BasicAliasAnalysis() : NoAA(&ID) {}
AliasResult alias(const Value *V1, unsigned V1Size, AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size); const Value *V2, unsigned V2Size);

View File

@ -92,7 +92,7 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
namespace { namespace {
struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass { struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
CFGViewer() : FunctionPass((intptr_t)&ID) {} CFGViewer() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
F.viewCFG(); F.viewCFG();
@ -114,7 +114,7 @@ V0("view-cfg", "View CFG of function", false, true);
namespace { namespace {
struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass { struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {} CFGOnlyViewer() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
CFGOnly = true; CFGOnly = true;
@ -139,8 +139,8 @@ V1("view-cfg-only",
namespace { namespace {
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
CFGPrinter() : FunctionPass((intptr_t)&ID) {} CFGPrinter() : FunctionPass(&ID) {}
explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {} explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
std::string Filename = "cfg." + F.getName() + ".dot"; std::string Filename = "cfg." + F.getName() + ".dot";
@ -170,7 +170,7 @@ P1("print-cfg", "Print CFG of function to 'dot' file", false, true);
namespace { namespace {
struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {} CFGOnlyPrinter() : CFGPrinter(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
bool OldCFGOnly = CFGOnly; bool OldCFGOnly = CFGOnly;
CFGOnly = true; CFGOnly = true;

View File

@ -431,7 +431,7 @@ namespace {
public: public:
static char ID; static char ID;
Andersens() : ModulePass((intptr_t)&ID) {} Andersens() : ModulePass(&ID) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); InitializeAliasAnalysis(this);

View File

@ -50,7 +50,7 @@ class VISIBILITY_HIDDEN BasicCallGraph : public CallGraph, public ModulePass {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0), BasicCallGraph() : ModulePass(&ID), Root(0),
ExternalCallingNode(0), CallsExternalNode(0) {} ExternalCallingNode(0), CallsExternalNode(0) {}
// runOnModule - Compute the call graph for the specified module. // runOnModule - Compute the call graph for the specified module.

View File

@ -34,7 +34,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
public: public:
static char ID; static char ID;
explicit CGPassManager(int Depth) explicit CGPassManager(int Depth)
: ModulePass((intptr_t)&ID), PMDataManager(Depth) { } : ModulePass(&ID), PMDataManager(Depth) { }
/// run - Execute all of the passes scheduled for execution. Keep track of /// 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. /// whether any of the passes modifies the module, and if so, return true.

View File

@ -88,7 +88,7 @@ namespace {
public: public:
static char ID; static char ID;
GlobalsModRef() : ModulePass((intptr_t)&ID) {} GlobalsModRef() : ModulePass(&ID) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); // set up super class InitializeAliasAnalysis(this); // set up super class

View File

@ -52,7 +52,7 @@ namespace {
} }
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
InstCount() : FunctionPass((intptr_t)&ID) {} InstCount() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

View File

@ -91,7 +91,7 @@ bool IntervalPartition::runOnFunction(Function &F) {
// distinguish it from a copy constructor. Always pass in false for now. // distinguish it from a copy constructor. Always pass in false for now.
// //
IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
: FunctionPass((intptr_t) &ID) { : FunctionPass(&ID) {
assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
// Pass false to intervals_begin because we take ownership of it's memory // Pass false to intervals_begin because we take ownership of it's memory

View File

@ -25,7 +25,7 @@ char LPPassManager::ID = 0;
/// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses.
LPPassManager::LPPassManager(int Depth) LPPassManager::LPPassManager(int Depth)
: FunctionPass((intptr_t)&ID), PMDataManager(Depth) { : FunctionPass(&ID), PMDataManager(Depth) {
skipThisLoop = false; skipThisLoop = false;
redoThisLoop = false; redoThisLoop = false;
LI = NULL; LI = NULL;

View File

@ -85,7 +85,7 @@ namespace {
struct VISIBILITY_HIDDEN NoProfileInfo struct VISIBILITY_HIDDEN NoProfileInfo
: public ImmutablePass, public ProfileInfo { : public ImmutablePass, public ProfileInfo {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} NoProfileInfo() : ImmutablePass(&ID) {}
}; };
} // End of anonymous namespace } // End of anonymous namespace

View File

@ -34,7 +34,7 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
explicit LoaderPass(const std::string &filename = "") explicit LoaderPass(const std::string &filename = "")
: ModulePass((intptr_t)&ID), Filename(filename) { : ModulePass(&ID), Filename(filename) {
if (filename.empty()) Filename = ProfileInfoFilename; if (filename.empty()) Filename = ProfileInfoFilename;
} }

View File

@ -21,7 +21,7 @@ namespace {
public: public:
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
explicit WriteBitcodePass(std::ostream &o) explicit WriteBitcodePass(std::ostream &o)
: ModulePass((intptr_t) &ID), Out(o) {} : ModulePass(&ID), Out(o) {}
const char *getPassName() const { return "Bitcode Writer"; } const char *getPassName() const { return "Bitcode Writer"; }

View File

@ -37,7 +37,7 @@ using namespace llvm;
char AsmPrinter::ID = 0; char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm, AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
const TargetAsmInfo *T) const TargetAsmInfo *T)
: MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()), TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
IsInTextSection(false) IsInTextSection(false)
{} {}

View File

@ -48,7 +48,7 @@ namespace {
struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass { struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass {
static char ID; static char ID;
explicit BranchFolder(bool defaultEnableTailMerge) : explicit BranchFolder(bool defaultEnableTailMerge) :
MachineFunctionPass((intptr_t)&ID) { MachineFunctionPass(&ID) {
switch (FlagEnableTailMerge) { switch (FlagEnableTailMerge) {
case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break; case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break;
case cl::BOU_TRUE: EnableTailMerge = true; break; case cl::BOU_TRUE: EnableTailMerge = true; break;

View File

@ -195,7 +195,7 @@ bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) 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. e_flags = 0; // e_flags defaults to 0, no flags.
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;

View File

@ -66,7 +66,7 @@ GCFunctionInfo::~GCFunctionInfo() {}
char GCModuleInfo::ID = 0; char GCModuleInfo::ID = 0;
GCModuleInfo::GCModuleInfo() GCModuleInfo::GCModuleInfo()
: ImmutablePass((intptr_t)&ID) {} : ImmutablePass(&ID) {}
GCModuleInfo::~GCModuleInfo() { GCModuleInfo::~GCModuleInfo() {
clear(); clear();

View File

@ -127,7 +127,7 @@ FunctionPass *llvm::createGCLoweringPass() {
char LowerIntrinsics::ID = 0; char LowerIntrinsics::ID = 0;
LowerIntrinsics::LowerIntrinsics() LowerIntrinsics::LowerIntrinsics()
: FunctionPass((intptr_t)&ID) {} : FunctionPass(&ID) {}
const char *LowerIntrinsics::getPassName() const { const char *LowerIntrinsics::getPassName() const {
return "Lower Garbage Collection Instructions"; return "Lower Garbage Collection Instructions";

View File

@ -146,7 +146,7 @@ namespace {
bool MadeChange; bool MadeChange;
public: public:
static char ID; static char ID;
IfConverter() : MachineFunctionPass((intptr_t)&ID) {} IfConverter() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "If Converter"; } virtual const char *getPassName() const { return "If Converter"; }

View File

@ -26,7 +26,7 @@ namespace {
class LoopAligner : public MachineFunctionPass { class LoopAligner : public MachineFunctionPass {
public: public:
static char ID; static char ID;
LoopAligner() : MachineFunctionPass((intptr_t)&ID) {} LoopAligner() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Loop aligner"; } virtual const char *getPassName() const { return "Loop aligner"; }

View File

@ -24,7 +24,7 @@ namespace {
struct VISIBILITY_HIDDEN LowerSubregsInstructionPass struct VISIBILITY_HIDDEN LowerSubregsInstructionPass
: public MachineFunctionPass { : public MachineFunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LowerSubregsInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {}
const char *getPassName() const { const char *getPassName() const {
return "Subregister lowering instruction pass"; return "Subregister lowering instruction pass";

View File

@ -336,7 +336,7 @@ void MachOCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
char MachOWriter::ID = 0; char MachOWriter::ID = 0;
MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm) 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; is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
isLittleEndian = TM.getTargetData()->isLittleEndian(); isLittleEndian = TM.getTargetData()->isLittleEndian();

View File

@ -49,7 +49,7 @@ namespace {
const std::string Banner; const std::string Banner;
Printer (std::ostream *os, 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"; } const char *getPassName() const { return "MachineFunction Printer"; }
@ -77,7 +77,7 @@ FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
namespace { namespace {
struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
static char ID; static char ID;
Deleter() : MachineFunctionPass((intptr_t)&ID) {} Deleter() : MachineFunctionPass(&ID) {}
const char *getPassName() const { return "Machine Code Deleter"; } const char *getPassName() const { return "Machine Code Deleter"; }

View File

@ -45,7 +45,7 @@ namespace {
MachineLoop *CurLoop; // The current loop we are working on. MachineLoop *CurLoop; // The current loop we are working on.
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
MachineLICM() : MachineFunctionPass((intptr_t)&ID) {} MachineLICM() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -1612,7 +1612,7 @@ DebugScope::~DebugScope() {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
MachineModuleInfo::MachineModuleInfo() MachineModuleInfo::MachineModuleInfo()
: ImmutablePass((intptr_t)&ID) : ImmutablePass(&ID)
, DR() , DR()
, VR() , VR()
, CompileUnits() , CompileUnits()
@ -2011,7 +2011,7 @@ namespace llvm {
struct DebugLabelFolder : public MachineFunctionPass { struct DebugLabelFolder : public MachineFunctionPass {
static char ID; static char ID;
DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {} DebugLabelFolder() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Label Folder"; } virtual const char *getPassName() const { return "Label Folder"; }

View File

@ -36,7 +36,7 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
MachineSinking() : MachineFunctionPass((intptr_t)&ID) {} MachineSinking() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -38,7 +38,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
PNE() : MachineFunctionPass((intptr_t)&ID) {} PNE() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn); virtual bool runOnMachineFunction(MachineFunction &Fn);

View File

@ -29,7 +29,7 @@ namespace {
class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass { class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass {
public: public:
static char ID; static char ID;
SchedulePostRATDList() : MachineFunctionPass((intptr_t)&ID) {} SchedulePostRATDList() : MachineFunctionPass(&ID) {}
private: private:
MachineFunction *MF; MachineFunction *MF;
const TargetMachine *TM; const TargetMachine *TM;

View File

@ -35,7 +35,7 @@ using namespace llvm;
namespace { namespace {
struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
static char ID; static char ID;
PEI() : MachineFunctionPass((intptr_t)&ID) {} PEI() : MachineFunctionPass(&ID) {}
const char *getPassName() const { const char *getPassName() const {
return "Prolog/Epilog Insertion & Frame Finalization"; return "Prolog/Epilog Insertion & Frame Finalization";

View File

@ -82,7 +82,7 @@ namespace {
class VISIBILITY_HIDDEN RABigBlock : public MachineFunctionPass { class VISIBILITY_HIDDEN RABigBlock : public MachineFunctionPass {
public: public:
static char ID; static char ID;
RABigBlock() : MachineFunctionPass((intptr_t)&ID) {} RABigBlock() : MachineFunctionPass(&ID) {}
private: private:
/// TM - For getting at TargetMachine info /// TM - For getting at TargetMachine info
/// ///

View File

@ -55,7 +55,7 @@ linearscanRegAlloc("linearscan", " linear scan register allocator",
namespace { namespace {
struct VISIBILITY_HIDDEN RALinScan : public MachineFunctionPass { struct VISIBILITY_HIDDEN RALinScan : public MachineFunctionPass {
static char ID; static char ID;
RALinScan() : MachineFunctionPass((intptr_t)&ID) {} RALinScan() : MachineFunctionPass(&ID) {}
typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr; typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
typedef SmallVector<IntervalPtr, 32> IntervalPtrs; typedef SmallVector<IntervalPtr, 32> IntervalPtrs;

View File

@ -44,8 +44,7 @@ namespace {
class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass { class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass {
public: public:
static char ID; static char ID;
RALocal() : MachineFunctionPass((intptr_t)&ID), RALocal() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1) {}
StackSlotForVirtReg(-1) {}
private: private:
const TargetMachine *TM; const TargetMachine *TM;
MachineFunction *MF; MachineFunction *MF;

View File

@ -41,7 +41,7 @@ namespace {
class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
public: public:
static char ID; static char ID;
RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {} RegAllocSimple() : MachineFunctionPass(&ID) {}
private: private:
MachineFunction *MF; MachineFunction *MF;
const TargetMachine *TM; const TargetMachine *TM;

View File

@ -158,7 +158,7 @@ MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
SelectionDAGISel::SelectionDAGISel(TargetLowering &tli, bool fast) : SelectionDAGISel::SelectionDAGISel(TargetLowering &tli, bool fast) :
FunctionPass((intptr_t)&ID), TLI(tli), FunctionPass(&ID), TLI(tli),
FuncInfo(new FunctionLoweringInfo(TLI)), FuncInfo(new FunctionLoweringInfo(TLI)),
CurDAG(new SelectionDAG(TLI, *FuncInfo)), CurDAG(new SelectionDAG(TLI, *FuncInfo)),
SDL(new SelectionDAGLowering(*CurDAG, TLI, *FuncInfo)), SDL(new SelectionDAGLowering(*CurDAG, TLI, *FuncInfo)),

View File

@ -102,7 +102,7 @@ namespace llvm {
public: public:
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
SimpleRegisterCoalescing() : MachineFunctionPass((intptr_t)&ID) {} SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {}
struct InstrSlots { struct InstrSlots {
enum { enum {

View File

@ -62,7 +62,7 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
StackSlotColoring() : MachineFunctionPass((intptr_t)&ID), NextColor(-1) {} StackSlotColoring() : MachineFunctionPass(&ID), NextColor(-1) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LiveStacks>(); AU.addRequired<LiveStacks>();

View File

@ -38,7 +38,7 @@ using namespace llvm;
namespace { namespace {
struct VISIBILITY_HIDDEN StrongPHIElimination : public MachineFunctionPass { struct VISIBILITY_HIDDEN StrongPHIElimination : public MachineFunctionPass {
static char ID; // Pass identification, replacement for typeid 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 // Waiting stores, for each MBB, the set of copies that need to
// be inserted into that MBB // be inserted into that MBB

View File

@ -70,7 +70,7 @@ namespace {
DenseMap<MachineInstr*, unsigned> &DistanceMap); DenseMap<MachineInstr*, unsigned> &DistanceMap);
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} TwoAddressInstructionPass() : MachineFunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<LiveVariables>(); AU.addPreserved<LiveVariables>();

View File

@ -40,7 +40,7 @@ namespace {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} UnreachableBlockElim() : FunctionPass(&ID) {}
}; };
} }
char UnreachableBlockElim::ID = 0; char UnreachableBlockElim::ID = 0;
@ -90,7 +90,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
UnreachableMachineBlockElim() : MachineFunctionPass((intptr_t)&ID) {} UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {}
}; };
} }
char UnreachableMachineBlockElim::ID = 0; char UnreachableMachineBlockElim::ID = 0;

View File

@ -39,11 +39,11 @@ namespace {
public: public:
static char ID; static char ID;
explicit ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) explicit ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
: MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), : MachineFunctionPass(&ID), II(0), TD(0), TM(tm),
MCE(mce) {} MCE(mce) {}
ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
const ARMInstrInfo &ii, const TargetData &td) const ARMInstrInfo &ii, const TargetData &td)
: MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm),
MCE(mce) {} MCE(mce) {}
bool runOnMachineFunction(MachineFunction &MF); bool runOnMachineFunction(MachineFunction &MF);

View File

@ -129,7 +129,7 @@ namespace {
bool isThumb; bool isThumb;
public: public:
static char ID; static char ID;
ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} ARMConstantIslands() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn); virtual bool runOnMachineFunction(MachineFunction &Fn);

View File

@ -39,7 +39,7 @@ STATISTIC(NumFSTMGened, "Number of fstm instructions generated");
namespace { namespace {
struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass { struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass {
static char ID; static char ID;
ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {} ARMLoadStoreOpt() : MachineFunctionPass(&ID) {}
const TargetInstrInfo *TII; const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI; const TargetRegisterInfo *TRI;

View File

@ -23,7 +23,7 @@ using namespace llvm;
namespace { namespace {
struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass { struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass {
static char ID; static char ID;
AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {} AlphaBSel() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn); virtual bool runOnMachineFunction(MachineFunction &Fn);

View File

@ -39,10 +39,10 @@ namespace {
public: public:
static char ID; static char ID;
explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
: MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {} : MachineFunctionPass(&ID), II(0), TM(tm), MCE(mce) {}
AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
const AlphaInstrInfo& ii) const AlphaInstrInfo& ii)
: MachineFunctionPass((intptr_t)&ID), II(&ii), TM(tm), MCE(mce) {} : MachineFunctionPass(&ID), II(&ii), TM(tm), MCE(mce) {}
bool runOnMachineFunction(MachineFunction &MF); bool runOnMachineFunction(MachineFunction &MF);

View File

@ -39,7 +39,7 @@ namespace {
static char ID; static char ID;
AlphaLLRPPass(AlphaTargetMachine &tm) AlphaLLRPPass(AlphaTargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm) { } : MachineFunctionPass(&ID), TM(tm) { }
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "Alpha NOP inserter"; return "Alpha NOP inserter";

View File

@ -60,7 +60,7 @@ namespace {
public: public:
static char ID; static char ID;
CBackendNameAllUsedStructsAndMergeFunctions() CBackendNameAllUsedStructsAndMergeFunctions()
: ModulePass((intptr_t)&ID) {} : ModulePass(&ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<FindUsedTypes>(); AU.addRequired<FindUsedTypes>();
} }
@ -92,7 +92,7 @@ namespace {
public: public:
static char ID; static char ID;
explicit CWriter(raw_ostream &o) explicit CWriter(raw_ostream &o)
: FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0), : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0),
TheModule(0), TAsm(0), TD(0) {} TheModule(0), TAsm(0), TD(0) {}
virtual const char *getPassName() const { return "C backend"; } virtual const char *getPassName() const { return "C backend"; }

View File

@ -103,7 +103,7 @@ namespace {
public: public:
static char ID; static char ID;
explicit CppWriter(raw_ostream &o) : explicit CppWriter(raw_ostream &o) :
ModulePass((intptr_t)&ID), Out(o), uniqueNum(0), is_inline(false) {} ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false) {}
virtual const char *getPassName() const { return "C++ backend"; } virtual const char *getPassName() const { return "C++ backend"; }

View File

@ -43,7 +43,7 @@ namespace {
IA64TargetMachine &TM; IA64TargetMachine &TM;
IA64BundlingPass(IA64TargetMachine &tm) IA64BundlingPass(IA64TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm) { } : MachineFunctionPass(&ID), TM(tm) { }
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "IA64 (Itanium) Bundling Pass"; return "IA64 (Itanium) Bundling Pass";

View File

@ -42,7 +42,7 @@ namespace {
static char ID; static char ID;
MSILModule(const std::set<const Type *>*& _UsedTypes, MSILModule(const std::set<const Type *>*& _UsedTypes,
const TargetData*& _TD) const TargetData*& _TD)
: ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {} : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {}
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<FindUsedTypes>(); AU.addRequired<FindUsedTypes>();
@ -86,7 +86,7 @@ namespace {
StaticInitList; StaticInitList;
const std::set<const Type *>* UsedTypes; const std::set<const Type *>* UsedTypes;
static char ID; static char ID;
MSILWriter(raw_ostream &o) : FunctionPass((intptr_t)&ID), Out(o) { MSILWriter(raw_ostream &o) : FunctionPass(&ID), Out(o) {
UniqID = 0; UniqID = 0;
} }

View File

@ -32,7 +32,7 @@ namespace {
static char ID; static char ID;
Filler(TargetMachine &tm) Filler(TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "Mips Delay Slot Filler"; return "Mips Delay Slot Filler";

View File

@ -32,7 +32,7 @@ STATISTIC(NumExpanded, "Number of branches expanded to long format");
namespace { namespace {
struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
static char ID; static char ID;
PPCBSel() : MachineFunctionPass((intptr_t)&ID) {} PPCBSel() : MachineFunctionPass(&ID) {}
/// BlockSizes - The sizes of the basic blocks in the function. /// BlockSizes - The sizes of the basic blocks in the function.
std::vector<unsigned> BlockSizes; std::vector<unsigned> BlockSizes;

View File

@ -48,7 +48,7 @@ namespace {
public: public:
static char ID; static char ID;
PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M) PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M)
: MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {} : MachineFunctionPass(&ID), TM(T), MCE(M) {}
const char *getPassName() const { return "PowerPC Machine Code Emitter"; } const char *getPassName() const { return "PowerPC Machine Code Emitter"; }

View File

@ -32,7 +32,7 @@ namespace {
static char ID; static char ID;
Filler(TargetMachine &tm) Filler(TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "SPARC Delay Slot Filler"; return "SPARC Delay Slot Filler";

View File

@ -34,7 +34,7 @@ namespace {
static char ID; static char ID;
FPMover(TargetMachine &tm) FPMover(TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm) { } : MachineFunctionPass(&ID), TM(tm) { }
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "Sparc Double-FP Move Fixer"; return "Sparc Double-FP Move Fixer";

View File

@ -232,7 +232,7 @@ void TargetData::init(const std::string &TargetDescription) {
} }
TargetData::TargetData(const Module *M) TargetData::TargetData(const Module *M)
: ImmutablePass((intptr_t)&ID) { : ImmutablePass(&ID) {
init(M->getDataLayout()); init(M->getDataLayout());
} }

View File

@ -46,12 +46,12 @@ namespace {
public: public:
static char ID; static char ID;
explicit Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce) explicit Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce)
: MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), : MachineFunctionPass(&ID), II(0), TD(0), TM(tm),
MCE(mce), PICBaseOffset(0), Is64BitMode(false), MCE(mce), PICBaseOffset(0), Is64BitMode(false),
IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce, Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce,
const X86InstrInfo &ii, const TargetData &td, bool is64) const X86InstrInfo &ii, const TargetData &td, bool is64)
: MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm),
MCE(mce), PICBaseOffset(0), Is64BitMode(is64), MCE(mce), PICBaseOffset(0), Is64BitMode(is64),
IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}

View File

@ -53,7 +53,7 @@ STATISTIC(NumFP , "Number of floating point instructions");
namespace { namespace {
struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
static char ID; static char ID;
FPS() : MachineFunctionPass((intptr_t)&ID) {} FPS() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -1118,7 +1118,7 @@ unsigned getX86SubSuperRegister(unsigned Reg, MVT VT, bool High) {
namespace { namespace {
struct VISIBILITY_HIDDEN MSAC : public MachineFunctionPass { struct VISIBILITY_HIDDEN MSAC : public MachineFunctionPass {
static char ID; static char ID;
MSAC() : MachineFunctionPass((intptr_t)&ID) {} MSAC() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF) { virtual bool runOnMachineFunction(MachineFunction &MF) {
MachineFrameInfo *FFI = MF.getFrameInfo(); MachineFrameInfo *FFI = MF.getFrameInfo();

View File

@ -26,7 +26,7 @@ namespace {
// Hello - The first implementation, without getAnalysisUsage. // Hello - The first implementation, without getAnalysisUsage.
struct Hello : public FunctionPass { struct Hello : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
Hello() : FunctionPass((intptr_t)&ID) {} Hello() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
HelloCounter++; HelloCounter++;
@ -45,7 +45,7 @@ namespace {
// Hello2 - The second implementation with getAnalysisUsage implemented. // Hello2 - The second implementation with getAnalysisUsage implemented.
struct Hello2 : public FunctionPass { struct Hello2 : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
Hello2() : FunctionPass((intptr_t)&ID) {} Hello2() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
HelloCounter++; HelloCounter++;

View File

@ -66,7 +66,7 @@ namespace {
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC); virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass(&ID),
maxElements(maxElements) {} maxElements(maxElements) {}
/// A vector used to hold the indices of a single GEP instruction /// A vector used to hold the indices of a single GEP instruction

View File

@ -31,7 +31,7 @@ STATISTIC(NumMerged, "Number of global constants merged");
namespace { namespace {
struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass {
static char ID; // Pass identification, replacement for typeid 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, // run - For this pass, process all of the globals in the module,
// eliminating duplicate constants. // eliminating duplicate constants.

View File

@ -121,7 +121,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
DAE() : ModulePass((intptr_t)&ID) {} DAE() : ModulePass(&ID) {}
bool runOnModule(Module &M); bool runOnModule(Module &M);
virtual bool ShouldHackArguments() const { return false; } virtual bool ShouldHackArguments() const { return false; }

View File

@ -27,7 +27,7 @@ STATISTIC(NumKilled, "Number of unused typenames removed from symtab");
namespace { namespace {
struct VISIBILITY_HIDDEN DTE : public ModulePass { struct VISIBILITY_HIDDEN DTE : public ModulePass {
static char ID; // Pass identification, replacement for typeid 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 // doPassInitialization - For this pass, it removes global symbol table
// entries for primitive types. These are never used for linking in GCC and // entries for primitive types. These are never used for linking in GCC and

View File

@ -35,7 +35,7 @@ namespace {
/// ///
explicit GVExtractorPass(std::vector<GlobalValue*>& GVs, bool deleteS = true, explicit GVExtractorPass(std::vector<GlobalValue*>& GVs, bool deleteS = true,
bool relinkCallees = false) bool relinkCallees = false)
: ModulePass((intptr_t)&ID), Named(GVs), deleteStuff(deleteS), : ModulePass(&ID), Named(GVs), deleteStuff(deleteS),
reLink(relinkCallees) {} reLink(relinkCallees) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {

View File

@ -31,7 +31,7 @@ STATISTIC(NumVariables, "Number of global variables removed");
namespace { namespace {
struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass {
static char ID; // Pass identification, replacement for typeid 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 // run - Do the GlobalDCE pass on the specified module, optionally updating
// the specified callgraph to reflect the changes. // the specified callgraph to reflect the changes.

View File

@ -57,7 +57,7 @@ namespace {
AU.addRequired<TargetData>(); AU.addRequired<TargetData>();
} }
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
GlobalOpt() : ModulePass((intptr_t)&ID) {} GlobalOpt() : ModulePass(&ID) {}
bool runOnModule(Module &M); bool runOnModule(Module &M);

View File

@ -36,7 +36,7 @@ namespace {
/// ///
struct VISIBILITY_HIDDEN IPCP : public ModulePass { struct VISIBILITY_HIDDEN IPCP : public ModulePass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
IPCP() : ModulePass((intptr_t)&ID) {} IPCP() : ModulePass(&ID) {}
bool runOnModule(Module &M); bool runOnModule(Module &M);
private: private:

View File

@ -33,7 +33,7 @@ namespace {
class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
IndMemRemPass() : ModulePass((intptr_t)&ID) {} IndMemRemPass() : ModulePass(&ID) {}
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);
}; };

View File

@ -34,11 +34,11 @@ static cl::opt<int>
InlineLimit("inline-threshold", cl::Hidden, cl::init(200), InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
cl::desc("Control the amount of inlining to perform (default = 200)")); cl::desc("Control the amount of inlining to perform (default = 200)"));
Inliner::Inliner(const void *ID) Inliner::Inliner(void *ID)
: CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {} : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {}
Inliner::Inliner(const void *ID, int Threshold) Inliner::Inliner(void *ID, int Threshold)
: CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {} : CallGraphSCCPass(ID), InlineThreshold(Threshold) {}
/// getAnalysisUsage - For this class, we declare that we require and preserve /// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should /// the call graph. If the derived class implements this method, it should

View File

@ -60,7 +60,7 @@ static RegisterPass<InternalizePass>
X("internalize", "Internalize Global Symbols"); X("internalize", "Internalize Global Symbols");
InternalizePass::InternalizePass(bool AllButMain) InternalizePass::InternalizePass(bool AllButMain)
: ModulePass((intptr_t)&ID), AllButMain(AllButMain){ : ModulePass(&ID), AllButMain(AllButMain){
if (!APIFile.empty()) // If a filename is specified, use it. if (!APIFile.empty()) // If a filename is specified, use it.
LoadFile(APIFile.c_str()); LoadFile(APIFile.c_str());
if (!APIList.empty()) // If a list is specified, use it as well. 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) 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(); for(std::vector<const char *>::const_iterator itr = exportList.begin();
itr != exportList.end(); itr++) { itr != exportList.end(); itr++) {
ExternalNames.insert(*itr); ExternalNames.insert(*itr);

View File

@ -41,7 +41,7 @@ namespace {
unsigned NumLoops; unsigned NumLoops;
explicit LoopExtractor(unsigned numLoops = ~0) explicit LoopExtractor(unsigned numLoops = ~0)
: FunctionPass((intptr_t)&ID), NumLoops(numLoops) {} : FunctionPass(&ID), NumLoops(numLoops) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
@ -167,11 +167,11 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
explicit BlockExtractorPass(const std::vector<BasicBlock*> &B) explicit BlockExtractorPass(const std::vector<BasicBlock*> &B)
: ModulePass((intptr_t)&ID), BlocksToNotExtract(B) { : ModulePass(&ID), BlocksToNotExtract(B) {
if (!BlockFile.empty()) if (!BlockFile.empty())
LoadFile(BlockFile.c_str()); LoadFile(BlockFile.c_str());
} }
BlockExtractorPass() : ModulePass((intptr_t)&ID) {} BlockExtractorPass() : ModulePass(&ID) {}
bool runOnModule(Module &M); bool runOnModule(Module &M);
}; };

View File

@ -112,7 +112,7 @@ namespace {
bool IsTransformableFunction(const std::string& Name); bool IsTransformableFunction(const std::string& Name);
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LowerSetJmp() : ModulePass((intptr_t)&ID) {} LowerSetJmp() : ModulePass(&ID) {}
void visitCallInst(CallInst& CI); void visitCallInst(CallInst& CI);
void visitInvokeInst(InvokeInst& II); void visitInvokeInst(InvokeInst& II);

View File

@ -45,7 +45,7 @@ namespace {
int scanDistribution(Function&, int, std::map<Constant*, int>&); int scanDistribution(Function&, int, std::map<Constant*, int>&);
public : public :
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
PartSpec() : ModulePass((intptr_t)&ID) {} PartSpec() : ModulePass(&ID) {}
bool runOnModule(Module &M); bool runOnModule(Module &M);
}; };
} }

View File

@ -35,7 +35,7 @@ STATISTIC(NumUnreach, "Number of noreturn calls optimized");
namespace { namespace {
struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass {
static char ID; // Pass identification, replacement for typeid 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. // runOnSCC - Analyze the SCC, performing the transformation if possible.
bool runOnSCC(const std::vector<CallGraphNode *> &SCC); bool runOnSCC(const std::vector<CallGraphNode *> &SCC);

View File

@ -37,7 +37,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
RaiseAllocations() RaiseAllocations()
: ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} : ModulePass(&ID), MallocFunc(0), FreeFunc(0) {}
// doPassInitialization - For the raise allocations pass, this finds a // doPassInitialization - For the raise allocations pass, this finds a
// declaration for malloc and free if they exist. // declaration for malloc and free if they exist.

View File

@ -30,7 +30,7 @@ namespace {
class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } StripDeadPrototypesPass() : ModulePass(&ID) { }
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);
}; };

View File

@ -38,7 +38,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
explicit StripSymbols(bool ODI = false) explicit StripSymbols(bool ODI = false)
: ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} : ModulePass(&ID), OnlyDebugInfo(ODI) {}
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);

View File

@ -49,7 +49,7 @@ namespace {
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC); virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
SRETPromotion() : CallGraphSCCPass((intptr_t)&ID) {} SRETPromotion() : CallGraphSCCPass(&ID) {}
private: private:
bool PromoteReturn(CallGraphNode *CGN); bool PromoteReturn(CallGraphNode *CGN);

View File

@ -34,7 +34,7 @@ namespace {
bool runOnModule(Module &M); bool runOnModule(Module &M);
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
EdgeProfiler() : ModulePass((intptr_t)&ID) {} EdgeProfiler() : ModulePass(&ID) {}
}; };
} }

View File

@ -144,7 +144,7 @@ namespace {
/// ProfilerRS - Insert the random sampling framework /// ProfilerRS - Insert the random sampling framework
struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
ProfilerRS() : FunctionPass((intptr_t)&ID) {} ProfilerRS() : FunctionPass(&ID) {}
std::map<Value*, Value*> TransCache; std::map<Value*, Value*> TransCache;
std::set<BasicBlock*> ChoicePoints; std::set<BasicBlock*> ChoicePoints;

View File

@ -35,7 +35,7 @@ STATISTIC(NumRemoved, "Number of instructions removed");
namespace { namespace {
struct VISIBILITY_HIDDEN ADCE : public FunctionPass { struct VISIBILITY_HIDDEN ADCE : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
ADCE() : FunctionPass((intptr_t)&ID) {} ADCE() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function& F); virtual bool runOnFunction(Function& F);

View File

@ -42,7 +42,7 @@ STATISTIC(NumMoved, "Number of basic blocks moved");
namespace { namespace {
struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass { struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
BlockPlacement() : FunctionPass((intptr_t)&ID) {} BlockPlacement() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

Some files were not shown because too many files have changed in this diff Show More