aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2005-04-20 03:22:18 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2005-04-20 03:22:18 +0000
commitb0bafc55be00e4091ca8adddcfcf440670d0999a (patch)
tree90eccb13c8ac2a2bbf943ba473bcd0f3f3282d89 /tools/gccld/gccld.cpp
parent7d27fc0252cb03b61c59b8a1e3307455c410266b (diff)
* Print commands as we execute them with `-v'
* Add option `-save-temps' Patch contributed by Markus Oberhumer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r--tools/gccld/gccld.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 8698cc8899..98e7dea325 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -83,6 +83,10 @@ namespace {
cl::opt<bool>
NativeCBE("native-cbe",
cl::desc("Generate a native binary with the C backend and GCC"));
+
+ cl::opt<bool>
+ SaveTemps("save-temps",
+ cl::desc("Do not delete temporary files"));
cl::opt<std::string>
RPath("rpath",
@@ -300,16 +304,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);
+ GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc,
+ Verbose);
if (Verbose) std::cout << "Generating Native Code\n";
GenerateNative(OutputFilename, AssemblyFile.toString(),
LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
- SOName );
+ SOName, Verbose);
- // Remove the assembly language file.
- AssemblyFile.destroyFile();
- // Remove the bytecode language file.
- sys::Path(RealBytecodeOutput).destroyFile();
+ if (!SaveTemps) {
+ // Remove the assembly language file.
+ AssemblyFile.destroyFile();
+ // Remove the bytecode language file.
+ sys::Path(RealBytecodeOutput).destroyFile();
+ }
} else if (NativeCBE) {
sys::Path CFile (OutputFilename);
@@ -329,18 +336,19 @@ int main(int argc, char **argv, char **envp ) {
return PrintAndReturn(argv[0], "Failed to find gcc");
// Generate an assembly language file for the bytecode.
- if (Verbose) std::cout << "Generating Assembly Code\n";
- GenerateCFile(CFile.toString(), RealBytecodeOutput, llc);
+ if (Verbose) std::cout << "Generating C Source Code\n";
+ GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose);
if (Verbose) std::cout << "Generating Native Code\n";
GenerateNative(OutputFilename, CFile.toString(),
LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
- SOName );
+ SOName, Verbose);
- // Remove the assembly language file.
- CFile.destroyFile();
-
- // Remove the bytecode language file.
- sys::Path(RealBytecodeOutput).destroyFile();
+ if (!SaveTemps) {
+ // Remove the assembly language file.
+ CFile.destroyFile();
+ // Remove the bytecode language file.
+ sys::Path(RealBytecodeOutput).destroyFile();
+ }
} else if (!LinkAsLibrary) {
EmitShellScript(argv);