#ifndef LLVM_PASS_H
#define LLVM_PASS_H
+#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Streams.h"
#include <vector>
#include <deque>
Pass(const Pass &); // DO NOT IMPLEMENT
public:
explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) {}
+ explicit Pass(const void *pid) : Resolver(0), PassID((intptr_t)pid) {}
virtual ~Pass();
/// getPassName - Return a nice clean name for a pass. This usually
/// verifyAnalysis() - This member can be implemented by a analysis pass to
/// check state of analysis information.
- virtual void verifyAnalysis() {}
+ virtual void verifyAnalysis() const {}
// dumpPassStructure - Implement the -debug-passes=PassStructure option
virtual void dumpPassStructure(unsigned Offset = 0);
template<typename AnalysisClass>
static const PassInfo *getClassPassInfo() {
- return lookupPassInfo((intptr_t)&AnalysisClass::ID);
+ return lookupPassInfo(intptr_t(&AnalysisClass::ID));
}
// lookupPassInfo - Return the pass info object for the specified pass class,
}
explicit ModulePass(intptr_t pid) : Pass(pid) {}
+ explicit ModulePass(const void *pid) : Pass(pid) {}
// Force out-of-line virtual method.
virtual ~ModulePass();
};
/// ImmutablePasses are never run.
///
- virtual bool runOnModule(Module &M) { return false; }
+ bool runOnModule(Module &M) { return false; }
explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
+ explicit ImmutablePass(const void *pid) : ModulePass(pid) {}
+
// Force out-of-line virtual method.
virtual ~ImmutablePass();
};
class FunctionPass : public Pass {
public:
explicit FunctionPass(intptr_t pid) : Pass(pid) {}
+ explicit FunctionPass(const void *pid) : Pass(pid) {}
/// doInitialization - Virtual method overridden by subclasses to do
/// any necessary per-module initialization.
class BasicBlockPass : public Pass {
public:
explicit BasicBlockPass(intptr_t pid) : Pass(pid) {}
+ explicit BasicBlockPass(const void *pid) : Pass(pid) {}
/// doInitialization - Virtual method overridden by subclasses to do
/// any necessary per-module initialization.