[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h CodeGeneratorBug.cpp ExecutionDriver.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 14 16:10:08 PDT 2003


Changes in directory llvm/tools/bugpoint:

BugDriver.h updated: 1.14 -> 1.15
CodeGeneratorBug.cpp updated: 1.20 -> 1.21
ExecutionDriver.cpp updated: 1.22 -> 1.23

---
Log message:

The return value of compileSharedObject was never used.  Return the shared
object's name instead


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

Index: llvm/tools/bugpoint/BugDriver.h
diff -u llvm/tools/bugpoint/BugDriver.h:1.14 llvm/tools/bugpoint/BugDriver.h:1.15
--- llvm/tools/bugpoint/BugDriver.h:1.14	Tue Aug  5 10:51:05 2003
+++ llvm/tools/bugpoint/BugDriver.h	Tue Oct 14 16:09:11 2003
@@ -85,8 +85,8 @@
 
   /// compileSharedObject - This method creates a SharedObject from a given
   /// BytecodeFile for debugging a code generator.
-  int compileSharedObject(const std::string &BytecodeFile,
-                          std::string &SharedObject);
+  ///
+  std::string compileSharedObject(const std::string &BytecodeFile);
 
   /// debugCodeGenerator - This method narrows down a module to a function or
   /// set of functions, using the CBE as a ``safe'' code generator for other


Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp
diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.20 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.21
--- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.20	Tue Oct 14 16:01:51 2003
+++ llvm/tools/bugpoint/CodeGeneratorBug.cpp	Tue Oct 14 16:09:11 2003
@@ -225,8 +225,7 @@
   }
 
   // Make a shared library
-  std::string SharedObject;
-  BD.compileSharedObject(SafeModuleBC, SharedObject);
+  std::string SharedObject = compileSharedObject(SafeModuleBC);
 
   delete SafeModule;
   delete TestModule;


Index: llvm/tools/bugpoint/ExecutionDriver.cpp
diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.22 llvm/tools/bugpoint/ExecutionDriver.cpp:1.23
--- llvm/tools/bugpoint/ExecutionDriver.cpp:1.22	Tue Oct  7 08:45:51 2003
+++ llvm/tools/bugpoint/ExecutionDriver.cpp	Tue Oct 14 16:09:11 2003
@@ -135,16 +135,16 @@
   return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe);
 }
 
-int BugDriver::compileSharedObject(const std::string &BytecodeFile,
-                                   std::string &SharedObject) {
+std::string BugDriver::compileSharedObject(const std::string &BytecodeFile) {
   assert(Interpreter && "Interpreter should have been created already!");
-  std::string Message, OutputCFile;
+  std::string OutputCFile;
 
   // Using CBE
   cbe->OutputC(BytecodeFile, OutputCFile);
 
 #if 0 /* This is an alternative, as yet unimplemented */
   // Using LLC
+  std::string Message;
   LLC *llc = createLLCtool(Message);
   if (llc->OutputAsm(BytecodeFile, OutputFile)) {
     std::cerr << "Could not generate asm code with `llc', exiting.\n";
@@ -152,12 +152,14 @@
   }
 #endif
 
-  gcc->MakeSharedObject(OutputCFile, CFile, SharedObject);
+  std::string SharedObjectFile;
+  if (gcc->MakeSharedObject(OutputCFile, CFile, SharedObject))
+    exit(1);
 
   // Remove the intermediate C file
   removeFile(OutputCFile);
 
-  return 0;
+  return SharedObjectFile;
 }
 
 





More information about the llvm-commits mailing list