aboutsummaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-07-07 17:34:40 +0000
committerJustin Bogner <mail@justinbogner.com>2014-07-07 17:34:40 +0000
commit761439962b996292e5c49a19f3b1ee6cd5584f70 (patch)
tree3db3eabaa8d4884bcd7f4efa0d2d749667ad4860 /clang
parente218cd77b4d49da5ebf9e978d510a4a612eab8fd (diff)
downloadllvm-761439962b996292e5c49a19f3b1ee6cd5584f70.zip
llvm-761439962b996292e5c49a19f3b1ee6cd5584f70.tar.gz
llvm-761439962b996292e5c49a19f3b1ee6cd5584f70.tar.bz2
Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps
If there isn't a VFS to overlay we shouldn't be adding a -ivfsoverlay flag. llvm-svn: 212468
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Driver/Driver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 08dcc11..2844033 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -550,9 +550,11 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
E = I + OldFilename.size();
I = Cmd.rfind(" ", I) + 1;
Cmd.replace(I, E - I, NewFilename.data(), NewFilename.size());
- // Add the VFS overlay to the reproduction script.
- I += NewFilename.size();
- Cmd.insert(I, std::string(" -ivfsoverlay ") + VFS.c_str());
+ if (!VFS.empty()) {
+ // Add the VFS overlay to the reproduction script.
+ I += NewFilename.size();
+ Cmd.insert(I, std::string(" -ivfsoverlay ") + VFS.c_str());
+ }
ScriptOS << Cmd;
Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
}