From a0f5b15e1eb8642d92b3141a6b88a5729ea979dc Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 14 Oct 2003 21:09:11 +0000 Subject: [PATCH] The return value of compileSharedObject was never used. Return the shared 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 | 4 ++-- tools/bugpoint/CodeGeneratorBug.cpp | 3 +-- tools/bugpoint/ExecutionDriver.cpp | 12 +++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h index eff11ec0de4..2b43aae584c 100644 --- a/tools/bugpoint/BugDriver.h +++ b/tools/bugpoint/BugDriver.h @@ -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 diff --git a/tools/bugpoint/CodeGeneratorBug.cpp b/tools/bugpoint/CodeGeneratorBug.cpp index 28e3b9111ac..b7757097019 100644 --- a/tools/bugpoint/CodeGeneratorBug.cpp +++ b/tools/bugpoint/CodeGeneratorBug.cpp @@ -225,8 +225,7 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector &Funcs, } // Make a shared library - std::string SharedObject; - BD.compileSharedObject(SafeModuleBC, SharedObject); + std::string SharedObject = compileSharedObject(SafeModuleBC); delete SafeModule; delete TestModule; diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index f941713b3ab..17e2ce2378d 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -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; } -- 2.34.1