[PATCH] D27298: [Frontend] Fix an issue where a quoted search path is incorrectly removed as a duplicate header search path

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 02:02:03 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL288491: [Frontend] Fix an issue where a quoted search path is incorrectly (authored by arphaman).

Changed prior to commit:
  https://reviews.llvm.org/D27298?vs=79887&id=80038#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27298

Files:
  cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
  cfe/trunk/test/Frontend/include-duplicate-removal.c


Index: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
@@ -526,7 +526,7 @@
     if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) {
       // Find the dir that this is the same of.
       unsigned FirstDir;
-      for (FirstDir = 0; ; ++FirstDir) {
+      for (FirstDir = First;; ++FirstDir) {
         assert(FirstDir != i && "Didn't find dupe?");
 
         const DirectoryLookup &SearchEntry = SearchList[FirstDir];
Index: cfe/trunk/test/Frontend/include-duplicate-removal.c
===================================================================
--- cfe/trunk/test/Frontend/include-duplicate-removal.c
+++ cfe/trunk/test/Frontend/include-duplicate-removal.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -v -I%S/Inputs -iquote %S/Inputs/SystemHeaderPrefix -isystem %S/Inputs/SystemHeaderPrefix -isystem %S/Inputs/SystemHeaderPrefix %s 2>&1 | FileCheck %s
+
+#include <test.h>
+
+// CHECK: ignoring duplicate directory
+// CHECK-SAME: Inputs/SystemHeaderPrefix"{{$}}
+
+// CHECK:      #include "..."
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
+// CHECK-NEXT: #include <...>
+// CHECK-NEXT: {{.*}}Inputs{{$}}
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27298.80038.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161202/e7cf38a0/attachment-0001.bin>


More information about the cfe-commits mailing list