[llvm-commits] [dragonegg] r94979 - in /dragonegg/trunk: llvm-backend.cpp llvm-convert.cpp

Duncan Sands baldrick at free.fr
Mon Feb 1 05:11:48 PST 2010


Author: baldrick
Date: Mon Feb  1 07:11:48 2010
New Revision: 94979

URL: http://llvm.org/viewvc/llvm-project?rev=94979&view=rev
Log:
Don't try to generate code if an error occurred.  Likewise, don't check
that every SSA name got a value if an error occurred.  This prevents
problems when invalid asm causes us to bail out.

Modified:
    dragonegg/trunk/llvm-backend.cpp
    dragonegg/trunk/llvm-convert.cpp

Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=94979&r1=94978&r2=94979&view=diff

==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Mon Feb  1 07:11:48 2010
@@ -1563,14 +1563,16 @@
     Fn = Emitter.EmitFunction();
   }
 
-  // TODO  performLateBackendInitialization();
-  createPerFunctionOptimizationPasses();
+  if (!errorcount && !sorrycount) {
+    // TODO  performLateBackendInitialization();
+    createPerFunctionOptimizationPasses();
 
-  if (PerFunctionPasses)
-    PerFunctionPasses->run(*Fn);
+    if (PerFunctionPasses)
+      PerFunctionPasses->run(*Fn);
 
-  // TODO: Nuke the .ll code for the function at -O[01] if we don't want to
-  // inline it or something else.
+    // TODO: Nuke the .ll code for the function at -O[01] if we don't want to
+    // inline it or something else.
+  }
 
   // Done with this function.
   current_function_decl = NULL;
@@ -1909,6 +1911,9 @@
 /// llvm_finish_unit - Finish the .s file.  This is called by GCC once the
 /// compilation unit has been completely processed.
 static void llvm_finish_unit(void *gcc_data, void *user_data) {
+  if (errorcount || sorrycount)
+    return;
+
   if (!quiet_flag)
     errs() << "Finishing compilation unit\n";
 

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=94979&r1=94978&r2=94979&view=diff

==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Mon Feb  1 07:11:48 2010
@@ -977,12 +977,13 @@
   PopulatePhiNodes();
 
 #ifndef NDEBUG
-  for (DenseMap<tree, TrackingVH<Value> >::const_iterator I = SSANames.begin(),
-       E = SSANames.end(); I != E; ++I)
-    if (isSSAPlaceholder(I->second)) {
-      debug_tree(I->first);
-      llvm_unreachable("SSA name never defined!");
-    }
+  if (!errorcount && !sorrycount)
+    for (DenseMap<tree, TrackingVH<Value> >::const_iterator I = SSANames.begin(),
+         E = SSANames.end(); I != E; ++I)
+      if (isSSAPlaceholder(I->second)) {
+        debug_tree(I->first);
+        llvm_unreachable("SSA name never defined!");
+      }
 #endif
 
   return Fn;





More information about the llvm-commits mailing list