Make sure we only use the output file as a base for debug splitting
if we're compiling.
llvm-svn: 175851
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index e830bdc..ebbabcf 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1723,7 +1723,7 @@
// Add an output for the extract.
Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o);
const char *OutFile;
- if (FinalOutput) {
+ if (FinalOutput && C.getArgs().hasArg(options::OPT_c)) {
SmallString<128> T(FinalOutput->getValue());
llvm::sys::path::replace_extension(T, "dwo");
OutFile = Args.MakeArgString(T);