[cfe-commits] r144789 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp
Evan Cheng
evan.cheng at apple.com
Wed Nov 16 00:38:55 PST 2011
Author: evancheng
Date: Wed Nov 16 02:38:55 2011
New Revision: 144789
URL: http://llvm.org/viewvc/llvm-project?rev=144789&view=rev
Log:
Match LLVM API change.
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=144789&r1=144788&r2=144789&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Wed Nov 16 02:38:55 2011
@@ -296,8 +296,16 @@
RM = llvm::Reloc::DynamicNoPIC;
}
+ CodeGenOpt::Level OptLevel = CodeGenOpt::Default;
+ switch (CodeGenOpts.OptimizationLevel) {
+ default: break;
+ case 0: OptLevel = CodeGenOpt::None; break;
+ case 3: OptLevel = CodeGenOpt::Aggressive; break;
+ }
+
TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
- FeaturesStr, RM, CM);
+ FeaturesStr, RM, CM,
+ OptLevel);
if (CodeGenOpts.RelaxAll)
TM->setMCRelaxAll(true);
@@ -312,13 +320,6 @@
// Create the code generator passes.
PassManager *PM = getCodeGenPasses();
- CodeGenOpt::Level OptLevel = CodeGenOpt::Default;
-
- switch (CodeGenOpts.OptimizationLevel) {
- default: break;
- case 0: OptLevel = CodeGenOpt::None; break;
- case 3: OptLevel = CodeGenOpt::Aggressive; break;
- }
// Normal mode, emit a .s or .o file by running the code generator. Note,
// this also adds codegenerator level optimization passes.
@@ -336,7 +337,7 @@
if (LangOpts.ObjCAutoRefCount)
PM->add(createObjCARCContractPass());
- if (TM->addPassesToEmitFile(*PM, OS, CGFT, OptLevel,
+ if (TM->addPassesToEmitFile(*PM, OS, CGFT,
/*DisableVerify=*/!CodeGenOpts.VerifyModule)) {
Diags.Report(diag::err_fe_unable_to_interface_with_target);
return false;
More information about the cfe-commits
mailing list