summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index f2e965c1a74..0cb14886e90 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -820,7 +820,10 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
// pathname.
if (JA.getType() == types::TY_PCH) {
BasePath.eraseComponent();
- BasePath.appendComponent(NamedOutput);
+ if (BasePath.isEmpty())
+ BasePath = NamedOutput;
+ else
+ BasePath.appendComponent(NamedOutput);
return C.addResultFile(C.getArgs().MakeArgString(BasePath.c_str()));
} else {
return C.addResultFile(NamedOutput);
OpenPOWER on IntegriCloud