Changes in directory llvm/tools/bugpoint:

OptimizerDriver.cpp updated: 1.41 -> 1.42
ToolRunner.cpp updated: 1.55 -> 1.56
---
Log message:

For PR797: http://llvm.org/PR797 :
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.


---
Diffs of the changes:  (+9 -6)

 OptimizerDriver.cpp |   13 ++++++++-----
 ToolRunner.cpp      |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)


Index: llvm/tools/bugpoint/OptimizerDriver.cpp
diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.41 
llvm/tools/bugpoint/OptimizerDriver.cpp:1.42
--- llvm/tools/bugpoint/OptimizerDriver.cpp:1.41        Sun Aug 20 21:04:43 2006
+++ llvm/tools/bugpoint/OptimizerDriver.cpp     Mon Aug 21 01:04:45 2006
@@ -179,7 +179,8 @@
   args[n++] = 0;
 
   sys::Path prog(sys::Program::FindProgramByName(ToolName));
-  int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout);
+  std::string ErrMsg;
+  int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg);
 
   // If we are supposed to delete the bytecode file or if the passes crashed,
   // remove it now.  This may fail if the file was never created, but that's 
ok.
@@ -194,10 +195,12 @@
       std::cout << "Success!\n";
     else if (result > 0)
       std::cout << "Exited with error code '" << result << "'\n";
-    else if (result == -9999)
-      std::cout << "Program not executable\n";
-    else if (result < 0)
-      std::cout << "Crashed with signal #" << abs(result) << "\n";
+    else if (result < 0) {
+      if (result == -1)
+        std::cout << "Execute failed: " << ErrMsg << "\n";
+      else
+        std::cout << "Crashed with signal #" << abs(result) << "\n";
+    }
     if (result & 0x01000000)
       std::cout << "Dumped core\n";
   }


Index: llvm/tools/bugpoint/ToolRunner.cpp
diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.55 
llvm/tools/bugpoint/ToolRunner.cpp:1.56
--- llvm/tools/bugpoint/ToolRunner.cpp:1.55     Sun Aug 20 21:04:43 2006
+++ llvm/tools/bugpoint/ToolRunner.cpp  Mon Aug 21 01:04:45 2006
@@ -55,7 +55,7 @@
   sys::Path ErrorFilename("error_messages");
   ErrorFilename.makeUnique();
   RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename,
-                        ErrorFilename); // FIXME: check return code
+                        ErrorFilename); // FIXME: check return code ?
 
   // Print out the error messages generated by GCC if possible...
   std::ifstream ErrorFile(ErrorFilename.c_str());



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to