From 7defa2d3d5cf1e4f773360886d17fd3bc99c0930 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Thu, 25 Jun 2009 18:20:10 +0000 Subject: Make -save-temps behave like in GCC 4.5. The -save-temps option now behaves like described in GCC 4.5 release notes (you can specify output directory for temporary files with -save-temps=obj -o $DIRNAME). I do not have GCC 4.5 installed, so if there are any inconsistencies between llvmc and GCC in the implementation of this feature, please let me know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74190 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CompilerDriver/Action.cpp | 5 +---- lib/CompilerDriver/CompilationGraph.cpp | 7 ++----- lib/CompilerDriver/Tool.cpp | 8 +++----- 3 files changed, 6 insertions(+), 14 deletions(-) (limited to 'lib/CompilerDriver') diff --git a/lib/CompilerDriver/Action.cpp b/lib/CompilerDriver/Action.cpp index c0a1b849bc..816f793bc0 100644 --- a/lib/CompilerDriver/Action.cpp +++ b/lib/CompilerDriver/Action.cpp @@ -12,8 +12,8 @@ //===----------------------------------------------------------------------===// #include "llvm/CompilerDriver/Action.h" +#include "llvm/CompilerDriver/BuiltinOptions.h" -#include "llvm/Support/CommandLine.h" #include "llvm/System/Program.h" #include @@ -22,9 +22,6 @@ using namespace llvm; using namespace llvmc; -extern cl::opt DryRun; -extern cl::opt VerboseMode; - namespace { int ExecuteProgram(const std::string& name, const StrVector& args) { diff --git a/lib/CompilerDriver/CompilationGraph.cpp b/lib/CompilerDriver/CompilationGraph.cpp index c7302afefb..1212a219b0 100644 --- a/lib/CompilerDriver/CompilationGraph.cpp +++ b/lib/CompilerDriver/CompilationGraph.cpp @@ -11,11 +11,11 @@ // //===----------------------------------------------------------------------===// +#include "llvm/CompilerDriver/BuiltinOptions.h" #include "llvm/CompilerDriver/CompilationGraph.h" #include "llvm/CompilerDriver/Error.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/DOTGraphTraits.h" #include "llvm/Support/GraphWriter.h" @@ -30,9 +30,6 @@ using namespace llvm; using namespace llvmc; -extern cl::list InputFilenames; -extern cl::list Languages; - namespace llvmc { const std::string& LanguageMap::GetLanguage(const sys::Path& File) const { @@ -477,7 +474,7 @@ namespace llvm { { template - static std::string getNodeLabel(const Node* N, const GraphType&, + static std::string getNodeLabel(const Node* N, const GraphType&, bool ShortNames) { if (N->ToolPtr) diff --git a/lib/CompilerDriver/Tool.cpp b/lib/CompilerDriver/Tool.cpp index 886b26b5d7..e704dd9544 100644 --- a/lib/CompilerDriver/Tool.cpp +++ b/lib/CompilerDriver/Tool.cpp @@ -11,16 +11,14 @@ // //===----------------------------------------------------------------------===// +#include "llvm/CompilerDriver/BuiltinOptions.h" #include "llvm/CompilerDriver/Tool.h" #include "llvm/System/Path.h" -#include "llvm/Support/CommandLine.h" using namespace llvm; using namespace llvmc; -extern cl::opt OutputFilename; - namespace { sys::Path MakeTempFile(const sys::Path& TempDir, const std::string& BaseName, const std::string& Suffix) { @@ -39,7 +37,7 @@ namespace { // NOTE: makeUnique always *creates* a unique temporary file, // which is good, since there will be no races. However, some // tools do not like it when the output file already exists, so - // they have to be placated with -f or something like that. + // they need to be placated with -f or something like that. Out.makeUnique(true, NULL); return Out; } @@ -52,7 +50,7 @@ sys::Path Tool::OutFilename(const sys::Path& In, sys::Path Out; if (StopCompilation) { - if (!OutputFilename.empty()) { + if (!OutputFilename.empty() && SaveTemps != SaveTempsEnum::Obj ) { Out.set(OutputFilename); } else if (IsJoin()) { -- cgit v1.2.3