ExecutionEngine: honor optimization level
[oota-llvm.git] / lib / ExecutionEngine / TargetSelect.cpp
index 45480a6d590b42ee4a53462f2bcb7cdc6c07301c..cf2d9ff56188f3a10c434096e413cc768b65cf0b 100644 (file)
@@ -32,6 +32,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
                               const SmallVectorImpl<std::string>& MAttrs,
                               Reloc::Model RM,
                               CodeModel::Model CM,
+                              CodeGenOpt::Level OL,
                               std::string *ErrorStr) {
   Triple TheTriple(Mod->getTargetTriple());
   if (TheTriple.getTriple().empty())
@@ -87,7 +88,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
   // Allocate a target...
   TargetMachine *Target = TheTarget->createTargetMachine(TheTriple.getTriple(),
                                                          MCPU, FeaturesStr,
-                                                         RM, CM);
+                                                         RM, CM, OL);
   assert(Target && "Could not allocate target machine!");
   return Target;
 }