diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-11-16 08:38:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-11-16 08:38:26 +0000 |
commit | ecb2908bf98749531c148a3d5f2271159f4f66e4 (patch) | |
tree | 5c72fb3496e8ad7c9852dde525359f342b87a594 /llvm/lib/Target/TargetMachine.cpp | |
parent | cca9aa58ca1594c3c74ee6c2055fbe23a6febdc7 (diff) | |
download | bcm5719-llvm-ecb2908bf98749531c148a3d5f2271159f4f66e4.tar.gz bcm5719-llvm-ecb2908bf98749531c148a3d5f2271159f4f66e4.zip |
Sink codegen optimization level into MCCodeGenInfo along side relocation model
and code model. This eliminates the need to pass OptLevel flag all over the
place and makes it possible for any codegen pass to use this information.
llvm-svn: 144788
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index daac9243ddb..805e16e8179 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -226,6 +226,14 @@ CodeModel::Model TargetMachine::getCodeModel() const { return CodeGenInfo->getCodeModel(); } +/// getOptLevel - Returns the optimization level: None, Less, +/// Default, or Aggressive. +CodeGenOpt::Level TargetMachine::getOptLevel() const { + if (!CodeGenInfo) + return CodeGenOpt::Default; + return CodeGenInfo->getOptLevel(); +} + bool TargetMachine::getAsmVerbosityDefault() { return AsmVerbosityDefault; } |