diff options
author | Alex Lorenz <arphaman@gmail.com> | 2018-06-28 23:23:45 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2018-06-28 23:23:45 +0000 |
commit | 9b1baabc4e8c0c7c90c0a0a9e15307f73fecf076 (patch) | |
tree | 0eab399fe3793acdcbef03f66aad1b429edec6af /clang | |
parent | 0cf1f15e8337ee9acaf5265aec927ca72ffbe44e (diff) | |
download | bcm5719-llvm-9b1baabc4e8c0c7c90c0a0a9e15307f73fecf076.tar.gz bcm5719-llvm-9b1baabc4e8c0c7c90c0a0a9e15307f73fecf076.zip |
[frontend] Don't include the C++ stdlib for -x assembler-with-cpp
The new C++ stdlib warning added in r335081 gets
triggered when compiling an assembly file with -x assembler-with-cpp.
This commit ensures that the C++ stdlib is not included when compiling assembly.
In general, it's not really useful to include the C++ stdlib search path when
compiling assembly source.
rdar://41359632
Differential Revision: https://reviews.llvm.org/D48736
llvm-svn: 335940
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Frontend/InitHeaderSearch.cpp | 4 | ||||
-rw-r--r-- | clang/test/Frontend/nostdlib-for-asmpp.s | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp index 85aeec461ba..8a70404629d 100644 --- a/clang/lib/Frontend/InitHeaderSearch.cpp +++ b/clang/lib/Frontend/InitHeaderSearch.cpp @@ -470,8 +470,8 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang, break; } - if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes && - HSOpts.UseStandardSystemIncludes) { + if (Lang.CPlusPlus && !Lang.AsmPreprocessor && + HSOpts.UseStandardCXXIncludes && HSOpts.UseStandardSystemIncludes) { if (HSOpts.UseLibcxx) { if (triple.isOSDarwin()) { // On Darwin, libc++ may be installed alongside the compiler in diff --git a/clang/test/Frontend/nostdlib-for-asmpp.s b/clang/test/Frontend/nostdlib-for-asmpp.s new file mode 100644 index 00000000000..330fee32a36 --- /dev/null +++ b/clang/test/Frontend/nostdlib-for-asmpp.s @@ -0,0 +1,5 @@ +// RUN: %clang -cc1 -x assembler-with-cpp -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -std=c++11 -v %s 2>&1 | FileCheck %s +// The C++ stdlib path should not be included for an assembly source. + +// CHECK-NOT: usr/include/c++/ +// CHECK-NOT: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead |