Skip to content
Snippets Groups Projects
Commit 35ec7f07 authored by Alex Lorenz's avatar Alex Lorenz
Browse files

[Frontend] Fix an issue where a quoted search path is incorrectly

removed as a duplicate header search path

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.

rdar://23991350

Differential Revision: https://reviews.llvm.org/D27298


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288491 91177308-0d34-0410-b5e6-96231b3b80d8
parent 124ca6c2
No related branches found
No related tags found
No related merge requests found
...@@ -526,7 +526,7 @@ static unsigned RemoveDuplicates(std::vector<DirectoryLookup> &SearchList, ...@@ -526,7 +526,7 @@ static unsigned RemoveDuplicates(std::vector<DirectoryLookup> &SearchList,
if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) { if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) {
// Find the dir that this is the same of. // Find the dir that this is the same of.
unsigned FirstDir; unsigned FirstDir;
for (FirstDir = 0; ; ++FirstDir) { for (FirstDir = First;; ++FirstDir) {
assert(FirstDir != i && "Didn't find dupe?"); assert(FirstDir != i && "Didn't find dupe?");
const DirectoryLookup &SearchEntry = SearchList[FirstDir]; const DirectoryLookup &SearchEntry = SearchList[FirstDir];
......
// 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{{$}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment