[cfe-commits] r166808 - in /cfe/trunk: lib/Driver/Driver.cpp test/Driver/working-directory-and-abs.c
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Oct 26 13:09:24 PDT 2012
Author: akirtzidis
Date: Fri Oct 26 15:09:24 2012
New Revision: 166808
URL: http://llvm.org/viewvc/llvm-project?rev=166808&view=rev
Log:
[driver] Before applying the working directory check if the input path
is absolute.
Added:
cfe/trunk/test/Driver/working-directory-and-abs.c
Modified:
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=166808&r1=166807&r2=166808&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Oct 26 15:09:24 2012
@@ -1018,8 +1018,8 @@
if (CheckInputsExist && memcmp(Value, "-", 2) != 0) {
SmallString<64> Path(Value);
if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) {
- SmallString<64> Directory(WorkDir->getValue(Args));
- if (llvm::sys::path::is_absolute(Directory.str())) {
+ if (!llvm::sys::path::is_absolute(Path.str())) {
+ SmallString<64> Directory(WorkDir->getValue(Args));
llvm::sys::path::append(Directory, Value);
Path.assign(Directory);
}
Added: cfe/trunk/test/Driver/working-directory-and-abs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/working-directory-and-abs.c?rev=166808&view=auto
==============================================================================
--- cfe/trunk/test/Driver/working-directory-and-abs.c (added)
+++ cfe/trunk/test/Driver/working-directory-and-abs.c Fri Oct 26 15:09:24 2012
@@ -0,0 +1 @@
+// RUN: %clang -working-directory=%S %S/working-directory-and-abs.c -fsyntax-only
More information about the cfe-commits
mailing list