diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-04-29 23:29:43 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-04-29 23:29:43 +0000 |
commit | 5ed22ac54c2530a1d0d140d259f881f3b2040e56 (patch) | |
tree | 740060aedf3541a695c8ee54326cd88874936263 /lib/Target/Sparc | |
parent | f0d2d9593dbeca56c962391c18ddb059e2ee9bef (diff) | |
download | external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.zip external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.tar.gz external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.tar.bz2 |
Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 5 | ||||
-rw-r--r-- | lib/Target/Sparc/Sparc.h | 5 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcTargetMachine.cpp | 7 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcTargetMachine.h | 7 |
4 files changed, 14 insertions, 10 deletions
diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index ab18684..115f9b0 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -49,7 +49,8 @@ namespace { ValueMapTy NumberForBB; public: explicit SparcAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, unsigned OL, bool V) + const TargetAsmInfo *T, CodeGenOpt::Level OL, + bool V) : AsmPrinter(O, TM, T, OL, V) {} virtual const char *getPassName() const { @@ -82,7 +83,7 @@ namespace { /// FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o, TargetMachine &tm, - unsigned OptLevel, + CodeGenOpt::Level OptLevel, bool verbose) { return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose); } diff --git a/lib/Target/Sparc/Sparc.h b/lib/Target/Sparc/Sparc.h index 74b2e47..bb03f30 100644 --- a/lib/Target/Sparc/Sparc.h +++ b/lib/Target/Sparc/Sparc.h @@ -15,17 +15,18 @@ #ifndef TARGET_SPARC_H #define TARGET_SPARC_H +#include "llvm/Target/TargetMachine.h" #include <cassert> namespace llvm { class FunctionPass; - class TargetMachine; class SparcTargetMachine; class raw_ostream; FunctionPass *createSparcISelDag(SparcTargetMachine &TM); FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM, - unsigned OptLevel, bool Verbose); + CodeGenOpt::Level OptLevel, + bool Verbose); FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM); FunctionPass *createSparcFPMoverPass(TargetMachine &TM); } // end namespace llvm; diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp index cabfce1..eda0309 100644 --- a/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/lib/Target/Sparc/SparcTargetMachine.cpp @@ -69,7 +69,7 @@ unsigned SparcTargetMachine::getModuleMatchQuality(const Module &M) { } bool SparcTargetMachine::addInstSelector(PassManagerBase &PM, - unsigned OptLevel) { + CodeGenOpt::Level OptLevel) { PM.add(createSparcISelDag(*this)); return false; } @@ -77,14 +77,15 @@ bool SparcTargetMachine::addInstSelector(PassManagerBase &PM, /// addPreEmitPass - This pass may be implemented by targets that want to run /// passes immediately before machine code is emitted. This should return /// true if -print-machineinstrs should print out the code after the passes. -bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM, unsigned OptLevel){ +bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM, + CodeGenOpt::Level OptLevel){ PM.add(createSparcFPMoverPass(*this)); PM.add(createSparcDelaySlotFillerPass(*this)); return true; } bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, - unsigned OptLevel, + CodeGenOpt::Level OptLevel, bool Verbose, raw_ostream &Out) { // Output assembly language. diff --git a/lib/Target/Sparc/SparcTargetMachine.h b/lib/Target/Sparc/SparcTargetMachine.h index 927cbb5..40b44f2 100644 --- a/lib/Target/Sparc/SparcTargetMachine.h +++ b/lib/Target/Sparc/SparcTargetMachine.h @@ -51,9 +51,10 @@ public: static unsigned getModuleMatchQuality(const Module &M); // Pass Pipeline Configuration - virtual bool addInstSelector(PassManagerBase &PM, unsigned OptLevel); - virtual bool addPreEmitPass(PassManagerBase &PM, unsigned OptLevel); - virtual bool addAssemblyEmitter(PassManagerBase &PM, unsigned OptLevel, + virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); + virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel); + virtual bool addAssemblyEmitter(PassManagerBase &PM, + CodeGenOpt::Level OptLevel, bool Verbose, raw_ostream &Out); }; |