#include "llvm/Transforms/Pass.h"
class TargetData;
-class LowerAllocations : public ConcretePass<LowerAllocations> {
+class LowerAllocations : public ConcretePass {
Method *MallocMeth; // Methods in the module we are processing
Method *FreeMeth; // Initialized by doPassInitializationVirt
bool traceMethodExits);
-class InsertTraceCode : public ConcretePass<InsertTraceCode> {
+class InsertTraceCode : public ConcretePass {
bool TraceBasicBlockExits, TraceMethodExits;
public:
InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
//===----------------------------------------------------------------------===//
-// ConcretePass<t> class - This is used by implementations of passes to fill in
-// boiler plate code. SubClass should be a concrete class that is derived from
-// ConcretePass.
+// ConcretePass class - This is used by implementations of passes to fill in
+// boiler plate code.
//
// Deriving from this class is good because if new methods are added in the
// future, code for your pass won't have to change to stub out the unused
// functionality.
//
-template<class SubClass>
struct ConcretePass : public Pass {
// doPassInitializationVirt - Default to success.
// SubClass should be a concrete class that is derived from StatelessPass.
//
template<class SubClass>
-struct StatelessPass : public ConcretePass<SubClass> {
+struct StatelessPass : public ConcretePass {
//===--------------------------------------------------------------------===//
// The externally useful entry points - These are specialized to avoid the
#include "llvm/Transforms/Pass.h"
#include "llvm/Assembly/Writer.h"
-class PrintModulePass : public ConcretePass<PrintModulePass> {
+class PrintModulePass : public ConcretePass {
string Banner; // String to print before each method
ostream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
// Native code generation for a specified target.
//===---------------------------------------------------------------------===//
-class GenerateCodeForTarget : public ConcretePass<GenerateCodeForTarget> {
+class GenerateCodeForTarget : public ConcretePass {
TargetMachine &Target;
public:
inline GenerateCodeForTarget(TargetMachine &T) : Target(T) {}
// Write assembly code to specified output stream
//===---------------------------------------------------------------------===//
-class EmitAssembly : public ConcretePass<EmitAssembly> {
+class EmitAssembly : public ConcretePass {
const TargetMachine &Target; // Target to compile for
ostream *Out; // Stream to print on
bool DeleteStream; // Delete stream in dtor?