diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-12-18 23:07:04 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-12-18 23:07:04 +0000 |
| commit | da0acc816c18d18223af64f10590f298c006d581 (patch) | |
| tree | 34e57267ca957825819dc7f10414fb8e56c9b76e /clang/lib/Driver/Tools.cpp | |
| parent | 021de66be60cccd95de62ba948d6d5ffecae4720 (diff) | |
| download | bcm5719-llvm-da0acc816c18d18223af64f10590f298c006d581.tar.gz bcm5719-llvm-da0acc816c18d18223af64f10590f298c006d581.zip | |
Revert "Change -save-temps to emit unoptimized bitcode files."
This reverts commit r224503.
It broke compilation of fortran through the Clang driver. Previously
`clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it
tries to call `clang -cc1 t.f` which fails for obvious reasons.
llvm-svn: 224546
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index fcc47418349..34f018e071b 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2002,7 +2002,7 @@ static bool ShouldDisableDwarfDirectory(const ArgList &Args, /// \brief Check whether the given input tree contains any compilation actions. static bool ContainsCompileAction(const Action *A) { - if (isa<CompileJobAction>(A) || isa<BackendJobAction>(A)) + if (isa<CompileJobAction>(A)) return true; for (const auto &Act : *A) @@ -2528,8 +2528,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } else if (isa<VerifyPCHJobAction>(JA)) { CmdArgs.push_back("-verify-pch"); } else { - assert((isa<CompileJobAction>(JA) || isa<BackendJobAction>(JA)) && - "Invalid action for clang tool."); + assert(isa<CompileJobAction>(JA) && "Invalid action for clang tool."); if (JA.getType() == types::TY_Nothing) { CmdArgs.push_back("-fsyntax-only"); @@ -4406,27 +4405,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option // parser. Args.AddAllArgValues(CmdArgs, options::OPT_Xclang); - bool OptDisabled = false; for (arg_iterator it = Args.filtered_begin(options::OPT_mllvm), ie = Args.filtered_end(); it != ie; ++it) { (*it)->claim(); // We translate this by hand to the -cc1 argument, since nightly test uses // it and developers have been trained to spell it with -mllvm. - if (StringRef((*it)->getValue(0)) == "-disable-llvm-optzns") { + if (StringRef((*it)->getValue(0)) == "-disable-llvm-optzns") CmdArgs.push_back("-disable-llvm-optzns"); - OptDisabled = true; - } else + else (*it)->render(Args, CmdArgs); } - // With -save-temps, we want to save the unoptimized bitcode output from the - // CompileJobAction, so disable optimizations if they are not already - // disabled. - if (Args.hasArg(options::OPT_save_temps) && !OptDisabled && - isa<CompileJobAction>(JA)) - CmdArgs.push_back("-disable-llvm-optzns"); - if (Output.getType() == types::TY_Dependencies) { // Handled with other dependency code. } else if (Output.isFilename()) { @@ -4472,8 +4462,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // can propagate it to the backend. bool SplitDwarf = Args.hasArg(options::OPT_gsplit_dwarf) && getToolChain().getTriple().isOSLinux() && - (isa<AssembleJobAction>(JA) || isa<CompileJobAction>(JA) || - isa<BackendJobAction>(JA)); + (isa<AssembleJobAction>(JA) || isa<CompileJobAction>(JA)); const char *SplitDwarfOut; if (SplitDwarf) { CmdArgs.push_back("-split-dwarf-file"); @@ -4497,7 +4486,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Handle the debug info splitting at object creation time if we're // creating an object. // TODO: Currently only works on linux with newer objcopy. - if (SplitDwarf && !isa<CompileJobAction>(JA) && !isa<BackendJobAction>(JA)) + if (SplitDwarf && !isa<CompileJobAction>(JA)) SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output, SplitDwarfOut); if (Arg *A = Args.getLastArg(options::OPT_pg)) |

