summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-18 05:28:44 +0000
committerChris Lattner <sabre@nondot.org>2001-10-18 05:28:44 +0000
commitd054fae5f189febf9eed1eaecfcb2281c7605c2f (patch)
treea84065c323b51b31239fdc173998e267c6294852
parenta0a8b5bc26a13f75546305bbef34e3d8a46c24be (diff)
downloadbcm5719-llvm-d054fae5f189febf9eed1eaecfcb2281c7605c2f.tar.gz
bcm5719-llvm-d054fae5f189febf9eed1eaecfcb2281c7605c2f.zip
Convert to new simpler, more powerful pass structure
llvm-svn: 882
-rw-r--r--llvm/tools/llc/llc.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index a072de309e9..297e95c111b 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -52,7 +52,7 @@ static inline string GetFileNameRoot(const string &InputFilename) {
// Native code generation for a specified target.
//===---------------------------------------------------------------------===//
-class GenerateCodeForTarget : public ConcretePass {
+class GenerateCodeForTarget : public Pass {
TargetMachine &Target;
public:
inline GenerateCodeForTarget(TargetMachine &T) : Target(T) {}
@@ -60,7 +60,7 @@ public:
// doPerMethodWork - This method does the actual work of generating code for
// the specified method.
//
- bool doPerMethodWorkVirt(Method *M) {
+ bool doPerMethodWork(Method *M) {
if (!M->isExternal() && Target.compileMethod(M)) {
cerr << "Error compiling " << InputFilename << "!\n";
return true;
@@ -77,27 +77,22 @@ public:
// Write assembly code to specified output stream
//===---------------------------------------------------------------------===//
-class EmitAssembly : public ConcretePass {
+class EmitAssembly : public Pass {
const TargetMachine &Target; // Target to compile for
ostream *Out; // Stream to print on
bool DeleteStream; // Delete stream in dtor?
-
- Module *TheMod;
public:
inline EmitAssembly(const TargetMachine &T, ostream *O, bool D)
: Target(T), Out(O), DeleteStream(D) {}
- virtual bool doPassInitializationVirt(Module *M) {
- TheMod = M;
- return false;
- }
- ~EmitAssembly() {
+ virtual bool doPassFinalization(Module *M) {
// TODO: This should be performed as a moduleCleanup function, but we don't
// have one yet!
- Target.emitAssembly(TheMod, *Out);
+ Target.emitAssembly(M, *Out);
if (DeleteStream) delete Out;
+ return false;
}
};
OpenPOWER on IntegriCloud