The return value of compileSharedObject was never used. Return the shared
authorChris Lattner <sabre@nondot.org>
Tue, 14 Oct 2003 21:09:11 +0000 (21:09 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 14 Oct 2003 21:09:11 +0000 (21:09 +0000)
object's name instead

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9120 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/BugDriver.h
tools/bugpoint/CodeGeneratorBug.cpp
tools/bugpoint/ExecutionDriver.cpp

index eff11ec0de476974c25296f97d04cfd0c39b4bd3..2b43aae584c4beb04bd39817d56444fd17d7a9f2 100644 (file)
@@ -85,8 +85,8 @@ public:
 
   /// 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 28e3b9111ac1a38884c8ff430267b4efe2138f44..b7757097019d083c83f904b451e8bf0664af0844 100644 (file)
@@ -225,8 +225,7 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
   }
 
   // Make a shared library
-  std::string SharedObject;
-  BD.compileSharedObject(SafeModuleBC, SharedObject);
+  std::string SharedObject = compileSharedObject(SafeModuleBC);
 
   delete SafeModule;
   delete TestModule;
index f941713b3ab07ed4a07487eac341cd9158891240..17e2ce2378d0ed813f7fe0b3f82099ab1aedcc53 100644 (file)
@@ -135,16 +135,16 @@ std::string BugDriver::executeProgramWithCBE(std::string OutputFile,
   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 @@ int BugDriver::compileSharedObject(const std::string &BytecodeFile,
   }
 #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;
 }