changeset 1280:00a307a393f2

Now the backend wants an enum value as optimization level. Hopefully this'll be the last change to that code...
author Frits van Bommel <fvbommel wxs.nl>
date Thu, 30 Apr 2009 11:56:03 +0200
parents 04c36605feb9
children 29d3861aa2da
files gen/toobj.cpp
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toobj.cpp	Wed Apr 29 18:59:39 2009 +0200
+++ b/gen/toobj.cpp	Thu Apr 30 11:56:03 2009 +0200
@@ -268,10 +268,18 @@
     // Last argument is bool Fast
     // debug info doesn't work properly without fast!
     bool LastArg = !optimize() || global.params.symdebug;
-#else
+#elif LLVM_REV < 70459
     // Last argument is unsigned OptLevel
     // debug info doesn't work properly with OptLevel > 0!
     unsigned LastArg = global.params.symdebug ? 0 : optLevel();
+#else
+    // Last argument is enum CodeGenOpt::Level OptLevel
+    // debug info doesn't work properly with OptLevel != None!
+    CodeGenOpt::Level LastArg = CodeGenOpt::Default;
+    if (global.params.symdebug)
+        LastArg = CodeGenOpt::None;
+    else if (optLevel() >= 3)
+        LastArg = CodeGenOpt::Aggressive;
 #endif
     FileModel::Model mod = Target.addPassesToEmitFile(Passes, out, TargetMachine::AssemblyFile, LastArg);
     assert(mod == FileModel::AsmFile);