ConcretePass should not be a templated class!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-15 17:47:13 +00:00
parent 25c1229930
commit 2db4b72017
5 changed files with 8 additions and 10 deletions

View File

@ -13,7 +13,7 @@
#include "llvm/Transforms/Pass.h" #include "llvm/Transforms/Pass.h"
class TargetData; class TargetData;
class LowerAllocations : public ConcretePass<LowerAllocations> { class LowerAllocations : public ConcretePass {
Method *MallocMeth; // Methods in the module we are processing Method *MallocMeth; // Methods in the module we are processing
Method *FreeMeth; // Initialized by doPassInitializationVirt Method *FreeMeth; // Initialized by doPassInitializationVirt

View File

@ -70,7 +70,7 @@ void InsertCodeToTraceValues (Method* method,
bool traceMethodExits); bool traceMethodExits);
class InsertTraceCode : public ConcretePass<InsertTraceCode> { class InsertTraceCode : public ConcretePass {
bool TraceBasicBlockExits, TraceMethodExits; bool TraceBasicBlockExits, TraceMethodExits;
public: public:
InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits) InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)

View File

@ -113,15 +113,13 @@ struct Pass {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// ConcretePass<t> class - This is used by implementations of passes to fill in // ConcretePass class - This is used by implementations of passes to fill in
// boiler plate code. SubClass should be a concrete class that is derived from // boiler plate code.
// ConcretePass.
// //
// Deriving from this class is good because if new methods are added in the // 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 // future, code for your pass won't have to change to stub out the unused
// functionality. // functionality.
// //
template<class SubClass>
struct ConcretePass : public Pass { struct ConcretePass : public Pass {
// doPassInitializationVirt - Default to success. // doPassInitializationVirt - Default to success.
@ -143,7 +141,7 @@ struct ConcretePass : public Pass {
// SubClass should be a concrete class that is derived from StatelessPass. // SubClass should be a concrete class that is derived from StatelessPass.
// //
template<class SubClass> template<class SubClass>
struct StatelessPass : public ConcretePass<SubClass> { struct StatelessPass : public ConcretePass {
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// The externally useful entry points - These are specialized to avoid the // The externally useful entry points - These are specialized to avoid the

View File

@ -11,7 +11,7 @@
#include "llvm/Transforms/Pass.h" #include "llvm/Transforms/Pass.h"
#include "llvm/Assembly/Writer.h" #include "llvm/Assembly/Writer.h"
class PrintModulePass : public ConcretePass<PrintModulePass> { class PrintModulePass : public ConcretePass {
string Banner; // String to print before each method string Banner; // String to print before each method
ostream *Out; // ostream to print on ostream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor? bool DeleteStream; // Delete the ostream in our dtor?

View File

@ -52,7 +52,7 @@ static inline string GetFileNameRoot(const string &InputFilename) {
// Native code generation for a specified target. // Native code generation for a specified target.
//===---------------------------------------------------------------------===// //===---------------------------------------------------------------------===//
class GenerateCodeForTarget : public ConcretePass<GenerateCodeForTarget> { class GenerateCodeForTarget : public ConcretePass {
TargetMachine &Target; TargetMachine &Target;
public: public:
inline GenerateCodeForTarget(TargetMachine &T) : Target(T) {} inline GenerateCodeForTarget(TargetMachine &T) : Target(T) {}
@ -77,7 +77,7 @@ public:
// Write assembly code to specified output stream // Write assembly code to specified output stream
//===---------------------------------------------------------------------===// //===---------------------------------------------------------------------===//
class EmitAssembly : public ConcretePass<EmitAssembly> { class EmitAssembly : public ConcretePass {
const TargetMachine &Target; // Target to compile for const TargetMachine &Target; // Target to compile for
ostream *Out; // Stream to print on ostream *Out; // Stream to print on
bool DeleteStream; // Delete stream in dtor? bool DeleteStream; // Delete stream in dtor?