ExecutionEngine: honor optimization level
It was getting ignored after r144788.
Also fix an accidental implicit cast from the OptLevel enum
to an optional bool argument. MSVC warned on this, but gcc
didn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145633 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/TargetSelect.cpp b/lib/ExecutionEngine/TargetSelect.cpp
index 45480a6..cf2d9ff 100644
--- a/lib/ExecutionEngine/TargetSelect.cpp
+++ b/lib/ExecutionEngine/TargetSelect.cpp
@@ -32,6 +32,7 @@
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 @@
// 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;
}