]> granicus.if.org Git - clang/commitdiff
Driver: Bug fix, derived .gch names sometimes started with "/".
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 09:58:30 +0000 (09:58 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 09:58:30 +0000 (09:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index f2e965c1a74fce83d617de79acbe567445048823..0cb14886e90f0fafbe140c7a0766c56f7abce2c1 100644 (file)
@@ -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);