Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
[oota-llvm.git] / tools / llc / llc.cpp
index 145d957890c3be6f3881035d12acc5c22b67e17b..b7756129155f822d51216e1f4620e8cb73f1a680 100644 (file)
@@ -304,8 +304,11 @@ static int compileModule(char **argv, LLVMContext &Context) {
   if (const DataLayout *DL = Target->getDataLayout())
     M->setDataLayout(*DL);
 
-  // Override function attributes based on CPUStr and FeaturesStr.
-  setFunctionAttributes(CPUStr, FeaturesStr, *M);
+  // Override function attributes based on CPUStr, FeaturesStr, and Options.
+  // Pass AlwaysRecordAttrs=false as we want to override an attribute only when
+  // the corresponding cl::opt has been provided on llc's command line.
+  setFunctionAttributes(CPUStr, FeaturesStr, Options, *M,
+                        /* AlwaysRecordAttrs */ false);
 
   if (RelaxAll.getNumOccurrences() > 0 &&
       FileType != TargetMachine::CGFT_ObjectFile)