This revision was automatically updated to reflect the committed changes.
Closed by commit rC335940: [frontend] Don't include the C++ stdlib for -x 
assembler-with-cpp (authored by arphaman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48736?vs=153368&id=153420#toc

Repository:
  rC Clang

https://reviews.llvm.org/D48736

Files:
  lib/Frontend/InitHeaderSearch.cpp
  test/Frontend/nostdlib-for-asmpp.s


Index: test/Frontend/nostdlib-for-asmpp.s
===================================================================
--- test/Frontend/nostdlib-for-asmpp.s
+++ 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
Index: lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- lib/Frontend/InitHeaderSearch.cpp
+++ lib/Frontend/InitHeaderSearch.cpp
@@ -470,8 +470,8 @@
     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


Index: test/Frontend/nostdlib-for-asmpp.s
===================================================================
--- test/Frontend/nostdlib-for-asmpp.s
+++ 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
Index: lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- lib/Frontend/InitHeaderSearch.cpp
+++ lib/Frontend/InitHeaderSearch.cpp
@@ -470,8 +470,8 @@
     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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to