diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
commit | 8ea5ecb0564b8822c70ad84202471f03e2690da7 (patch) | |
tree | 2b32a1dc217579d1cc5799b60e575dcb0a6dcc5d /tools/gccld/gccld.cpp | |
parent | 4ce5dc63778f36f61b510456783f15a224406e68 (diff) |
For 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r-- | tools/gccld/gccld.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index 22a26ef91a..a9df06d69c 100644 --- a/tools/gccld/gccld.cpp +++ b/tools/gccld/gccld.cpp @@ -320,12 +320,19 @@ int main(int argc, char **argv, char **envp ) { // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc, - Verbose); + std::string ErrMsg; + if (0 != GenerateAssembly( + AssemblyFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile.toString(), + if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, - NoInternalize, RPath, SOName, Verbose); + NoInternalize, RPath, SOName, ErrMsg, Verbose) ) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (!SaveTemps) { // Remove the assembly language file. @@ -353,11 +360,19 @@ int main(int argc, char **argv, char **envp ) { // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating C Source Code\n"; - GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose); + std::string ErrMsg; + if (0 != GenerateCFile( + CFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile.toString(), + if (0 != GenerateNative(OutputFilename, CFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, - NoInternalize, RPath, SOName, Verbose); + NoInternalize, RPath, SOName, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (!SaveTemps) { // Remove the assembly language file. |