r177815 - Revert svn r176894 and r177658.
Bob Wilson
bob.wilson at apple.com
Fri Mar 22 22:17:59 PDT 2013
Author: bwilson
Date: Sat Mar 23 00:17:59 2013
New Revision: 177815
URL: http://llvm.org/viewvc/llvm-project?rev=177815&view=rev
Log:
Revert svn r176894 and r177658.
Changing -ccc-install-dir to affect cc1's resource-dir setting broke our
internal LNT tests. After discussing the situation with Jim, we've decided to
pursue an alternate approach. We really want the resource-dir to be located
relative to clang, even when using -ccc-install-dir, but we're going to
add a fallback setting for the libc++ headers if they don't exist alongside
the compiler.
Removed:
cfe/trunk/test/Driver/resource-dir.cpp
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=177815&r1=177814&r2=177815&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Sat Mar 23 00:17:59 2013
@@ -59,6 +59,15 @@ Driver::Driver(StringRef ClangExecutable
Name = llvm::sys::path::stem(ClangExecutable);
Dir = llvm::sys::path::parent_path(ClangExecutable);
+
+ // Compute the path to the resource directory.
+ StringRef ClangResourceDir(CLANG_RESOURCE_DIR);
+ SmallString<128> P(Dir);
+ if (ClangResourceDir != "")
+ llvm::sys::path::append(P, ClangResourceDir);
+ else
+ llvm::sys::path::append(P, "..", "lib", "clang", CLANG_VERSION_STRING);
+ ResourceDir = P.str();
}
Driver::~Driver() {
@@ -282,18 +291,8 @@ Compilation *Driver::BuildCompilation(Ar
if (Args->hasArg(options::OPT_nostdlib))
UseStdLib = false;
- // Compute the path to the resource directory. We used to do this in
- // Driver::Driver(), but that's not right, as command line args (such as
- // ccc-install-dir) can change 'Dir'.
- StringRef ClangResourceDir(CLANG_RESOURCE_DIR);
- SmallString<128> P(Dir);
if (const Arg *A = Args->getLastArg(options::OPT_resource_dir))
- P = A->getValue();
- else if (!ClangResourceDir.empty())
- llvm::sys::path::append(P, ClangResourceDir);
- else
- llvm::sys::path::append(P, "..", "lib", "clang", CLANG_VERSION_STRING);
- ResourceDir = P.str();
+ ResourceDir = A->getValue();
// Perform the default argument translations.
DerivedArgList *TranslatedArgs = TranslateInputArgs(*Args);
Removed: cfe/trunk/test/Driver/resource-dir.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/resource-dir.cpp?rev=177814&view=auto
==============================================================================
--- cfe/trunk/test/Driver/resource-dir.cpp (original)
+++ cfe/trunk/test/Driver/resource-dir.cpp (removed)
@@ -1,10 +0,0 @@
-// RUN: %clang %s -fsyntax-only -### 2> %t.log
-// RUN: FileCheck %s --check-prefix=CHECK-DEFAULT < %t.log
-
-// CHECK-DEFAULT: "-resource-dir" "{{.+}}/../lib/clang/{{.+}}"
-
-// RUN: %clang %s -fsyntax-only -ccc-install-dir /my/install/dir -### 2> %t.log
-// RUN: FileCheck %s --check-prefix=CHECK-INSTALL-DIR < %t.log
-// CHECK-INSTALL-DIR: "-resource-dir" "/my/install/dir{{[\\/]+}}..{{[\\/]+}}lib{{[\\/]+}}clang{{[\\/]+.+}}"
-
-void foo(void) {}
More information about the cfe-commits
mailing list