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

2016-12-02 Thread Alex Lorenz via Phabricator via cfe-commits
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=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  = 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 
+
+// CHECK: ignoring duplicate directory
+// CHECK-SAME: Inputs/SystemHeaderPrefix"{{$}}
+
+// CHECK:  #include "..."
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
+// CHECK-NEXT: #include <...>
+// CHECK-NEXT: {{.*}}Inputs{{$}}
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}


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  = 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 
+
+// CHECK: ignoring duplicate directory
+// CHECK-SAME: Inputs/SystemHeaderPrefix"{{$}}
+
+// CHECK:  #include "..."
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
+// CHECK-NEXT: #include <...>
+// CHECK-NEXT: {{.*}}Inputs{{$}}
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2016-12-01 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno accepted this revision.
bruno added a comment.

LGTM!


Repository:
  rL LLVM

https://reviews.llvm.org/D27298



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2016-12-01 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini accepted this revision.
mehdi_amini added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rL LLVM

https://reviews.llvm.org/D27298



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2016-12-01 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision.
arphaman added reviewers: mehdi_amini, bruno.
arphaman added a subscriber: cfe-commits.
arphaman set the repository for this revision to rL LLVM.

The commit r126167 started passing the `First` index into `RemoveDuplicates`, 
but forgot to update `0` to `First` in the loop that looks for the duplicate. 
This resulted in a bug where an -iquoted search path was incorrectly removed if 
you passed in the same path into -iquote and more than one time into -isystem.


Repository:
  rL LLVM

https://reviews.llvm.org/D27298

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


Index: test/Frontend/include-duplicate-removal.c
===
--- /dev/null
+++ 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 
+
+// CHECK: ignoring duplicate directory
+// CHECK-SAME: Inputs/SystemHeaderPrefix"{{$}}
+
+// CHECK:  #include "..."
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
+// CHECK-NEXT: #include <...>
+// CHECK-NEXT: {{.*}}Inputs{{$}}
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
Index: lib/Frontend/InitHeaderSearch.cpp
===
--- lib/Frontend/InitHeaderSearch.cpp
+++ 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  = SearchList[FirstDir];


Index: test/Frontend/include-duplicate-removal.c
===
--- /dev/null
+++ 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 
+
+// CHECK: ignoring duplicate directory
+// CHECK-SAME: Inputs/SystemHeaderPrefix"{{$}}
+
+// CHECK:  #include "..."
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
+// CHECK-NEXT: #include <...>
+// CHECK-NEXT: {{.*}}Inputs{{$}}
+// CHECK-NEXT: {{.*}}Inputs/SystemHeaderPrefix{{$}}
Index: lib/Frontend/InitHeaderSearch.cpp
===
--- lib/Frontend/InitHeaderSearch.cpp
+++ 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  = SearchList[FirstDir];
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits