]> granicus.if.org Git - clang/commitdiff
Revert r371785.
authorManoj Gupta <manojgupta@google.com>
Fri, 13 Sep 2019 00:28:37 +0000 (00:28 +0000)
committerManoj Gupta <manojgupta@google.com>
Fri, 13 Sep 2019 00:28:37 +0000 (00:28 +0000)
r371785 is causing fails on clang-hexagon-elf buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371799 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommonKinds.td
lib/Frontend/InitHeaderSearch.cpp
test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/lib/.keep [deleted file]
test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/include/c++/.keep [deleted file]
test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/lib/gcc/.keep [deleted file]
test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/include/.keep [deleted file]
test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/lib/.keep [deleted file]
test/Frontend/warning-poison-system-directories.c [deleted file]

index 1cd62d1e138efd1718b8394f0eec1bd173d36b15..8196a4601c224636ab09a03462a532cd3dc0f506 100644 (file)
@@ -315,9 +315,4 @@ def err_unknown_analyzer_checker_or_package : Error<
     "no analyzer checkers or packages are associated with '%0'">;
 def note_suggest_disabling_all_checkers : Note<
     "use -analyzer-disable-all-checks to disable all static analyzer checkers">;
-
-// Poison system directories.
-def warn_poison_system_directories : Warning <
-  "include location '%0' is unsafe for cross-compilation">,
-  InGroup<DiagGroup<"poison-system-directories">>, DefaultIgnore;
 }
index 5d877ee9c0d739c2bd1fdc63f636d6af3895bc30..ad0d23271487aa4a301b4dfc638cce4e5b1483c2 100644 (file)
@@ -137,13 +137,6 @@ bool InitHeaderSearch::AddUnmappedPath(const Twine &Path, IncludeDirGroup Group,
   SmallString<256> MappedPathStorage;
   StringRef MappedPathStr = Path.toStringRef(MappedPathStorage);
 
-  // If use system headers while cross-compiling, emit the warning.
-  if (HasSysroot && (MappedPathStr.startswith("/usr/include") ||
-                     MappedPathStr.startswith("/usr/local/include"))) {
-    Headers.getDiags().Report(diag::warn_poison_system_directories)
-        << MappedPathStr;
-  }
-
   // Compute the DirectoryLookup type.
   SrcMgr::CharacteristicKind Type;
   if (Group == Quoted || Group == Angled || Group == IndexHeaderMap) {
diff --git a/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/lib/.keep b/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/lib/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/include/c++/.keep b/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/include/c++/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/lib/gcc/.keep b/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/lib/gcc/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/include/.keep b/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/include/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/lib/.keep b/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/lib/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Frontend/warning-poison-system-directories.c b/test/Frontend/warning-poison-system-directories.c
deleted file mode 100644 (file)
index 018f02d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// System directory and sysroot option causes warning.
-// RUN: %clang -Wpoison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
-// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
-// RUN: %clang -Wpoison-system-directories -target x86_64 -cxx-isystem/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
-// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
-// RUN: %clang -Wpoison-system-directories -target x86_64 -iquote/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
-// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
-// RUN: %clang -Wpoison-system-directories -target x86_64 -isystem/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
-// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
-
-// Missing target but included sysroot still causes the warning.
-// RUN: %clang -Wpoison-system-directories -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.2.stderr
-// RUN: FileCheck -check-prefix=WARN < %t.2.stderr %s
-
-// With -Werror the warning causes the failure.
-// RUN: not %clang -Werror=poison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.3.stderr
-// RUN: FileCheck -check-prefix=ERROR < %t.3.stderr %s
-
-// Cros target without sysroot causes no warning.
-// RUN: %clang -Wpoison-system-directories -Werror -target x86_64 -I/usr/include -c -o - %s
-
-// By default the warning is off.
-// RUN: %clang -Werror -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s
-
-// WARN: warning: include location {{[^ ]+}} is unsafe for cross-compilation [-Wpoison-system-directories]
-
-// ERROR: error: include location {{[^ ]+}} is unsafe for cross-compilation [-Werror,-Wpoison-system-directories]