ppluzhnikov updated this revision to Diff 428693.
ppluzhnikov added a comment.
Fix clangd test failure.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121733/new/
https://reviews.llvm.org/D121733
Files:
clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
clang-tools-extra/clangd/index/CanonicalIncludes.cpp
clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
clang-tools-extra/test/clang-apply-replacements/conflict.cpp
clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
clang/bindings/python/tests/cindex/test_translation_unit.py
clang/lib/Basic/FileManager.cpp
clang/test/ClangScanDeps/header-search-pruning-transitive.c
clang/test/Frontend/dependency-gen.c
clang/test/Index/skip-parsed-bodies/compile_commands.json
clang/test/Modules/cxx20-hu-04.cpp
clang/test/Modules/cxx20-hu-05.cpp
clang/test/Modules/cxx20-hu-06.cpp
clang/test/Modules/filename.cpp
clang/unittests/Lex/HeaderSearchTest.cpp
clang/unittests/Tooling/Syntax/TokensTest.cpp
clang/unittests/Tooling/TransformerTest.cpp
Index: clang/unittests/Tooling/TransformerTest.cpp
===================================================================
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
return L.getFilePath() < R.getFilePath();
});
- ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
- EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
- EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+ const auto &change_h = Changes[1];
+ ASSERT_EQ(change_h.getFilePath(), "input.h");
+ EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+ EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
llvm::Expected<std::string> UpdatedCode =
- clang::tooling::applyAllReplacements(Header,
- Changes[0].getReplacements());
+ clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
ASSERT_TRUE(static_cast<bool>(UpdatedCode))
<< "Could not update code: " << llvm::toString(UpdatedCode.takeError());
EXPECT_EQ(format(*UpdatedCode), "");
- ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
- EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
- EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
- UpdatedCode = clang::tooling::applyAllReplacements(
- Source, Changes[1].getReplacements());
+ const auto &change_cc = Changes[0];
+ ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+ EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+ EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+ UpdatedCode =
+ clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
ASSERT_TRUE(static_cast<bool>(UpdatedCode))
<< "Could not update code: " << llvm::toString(UpdatedCode.takeError());
EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
{{"input.h", Header}}));
ASSERT_EQ(Changes.size(), 1U);
- ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+ ASSERT_EQ(Changes[0].getFilePath(), "input.h");
EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
llvm::Expected<std::string> UpdatedCode =
@@ -1708,7 +1709,7 @@
ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
- "./input.h"))));
+ "input.h"))));
}
TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===================================================================
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -295,7 +295,7 @@
{"int main() {}",
R"(expanded tokens:
int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
int main ( ) { }
no mappings.
@@ -304,7 +304,7 @@
{"\t\n int\t\n main\t\n (\t\n )\t\n{\t\n }\t\n",
R"(expanded tokens:
int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
int main ( ) { }
no mappings.
@@ -316,7 +316,7 @@
)cpp",
R"(expanded tokens:
<empty>
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# pragma GCC visibility push ( public ) # pragma GCC visibility pop
mappings:
@@ -325,7 +325,7 @@
// Empty files should not crash.
{R"cpp()cpp", R"(expanded tokens:
<empty>
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
<empty>
no mappings.
@@ -339,7 +339,7 @@
)cpp",
R"(expanded tokens:
a
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
a # define MACRO ( ) A # B
mappings:
@@ -404,7 +404,7 @@
std::string Expected =
"expanded tokens:\n"
" int a ;\n"
- "file './input.cpp'\n"
+ "file 'input.cpp'\n"
" spelled tokens:\n"
" # define FOO a # include \"unresolved_file.h\" # undef FOO "
"# ifdef X # else # endif # ifndef Y # endif # if 1 # elif 2 # else "
@@ -423,7 +423,7 @@
)cpp",
R"(expanded tokens:
int const a ;
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define INT int const INT a ;
mappings:
@@ -437,7 +437,7 @@
)cpp",
R"(expanded tokens:
const int a ;
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define INT ( a ) const int INT ( 10 + 10 ) a ;
mappings:
@@ -452,7 +452,7 @@
)cpp",
R"(expanded tokens:
int const a ;
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define ID ( X ) X # define INT int const ID ( ID ( INT ) ) a ;
mappings:
@@ -468,7 +468,7 @@
)cpp",
"expanded tokens:\n"
" int a = 1 * 2 + 3 * 4 + 5 ;\n"
- "file './input.cpp'\n"
+ "file 'input.cpp'\n"
" spelled tokens:\n"
" # define ADD ( X , Y ) X + Y # define MULT ( X , Y ) X * Y int "
"a = ADD ( MULT ( 1 , 2 ) , MULT ( 3 , ADD ( 4 , 5 ) ) ) ;\n"
@@ -485,7 +485,7 @@
)cpp",
R"(expanded tokens:
<empty>
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define EMPTY # define EMPTY_FUNC ( X ) EMPTY EMPTY_FUNC ( 1 + 2 + 3 )
mappings:
@@ -500,7 +500,7 @@
)cpp",
R"(expanded tokens:
int a = 10 + 10 ;
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define FOO 10 + 10 ; int a = FOO
mappings:
@@ -515,7 +515,7 @@
)cpp",
R"(expanded tokens:
1 + 42
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# define NUM 42 # define ID ( a ) a # define M 1 + ID M ( NUM )
mappings:
@@ -604,19 +604,19 @@
std::string Expected = R"(expanded tokens:
int a = 100 ; int b = 1 + 2 ; int c = 1 + 2 * 3 ;
-file './input.cpp'
+file 'input.cpp'
spelled tokens:
# include "foo.h" int c = ADD ( 1 , MULT ( 2 , 3 ) ) ;
mappings:
['#'_0, 'int'_3) => ['int'_12, 'int'_12)
['ADD'_6, ';'_17) => ['1'_15, ';'_20)
-file './foo.h'
+file 'foo.h'
spelled tokens:
# define ADD ( X , Y ) X + Y int a = 100 ; # include "bar.h"
mappings:
['#'_0, 'int'_11) => ['int'_0, 'int'_0)
['#'_16, '<eof>'_19) => ['int'_5, 'int'_5)
-file './bar.h'
+file 'bar.h'
spelled tokens:
int b = ADD ( 1 , 2 ) ; # define MULT ( X , Y ) X * Y
mappings:
Index: clang/unittests/Lex/HeaderSearchTest.cpp
===================================================================
--- clang/unittests/Lex/HeaderSearchTest.cpp
+++ clang/unittests/Lex/HeaderSearchTest.cpp
@@ -112,6 +112,23 @@
}
TEST_F(HeaderSearchTest, Dots) {
+ VFS->addFile("./inc/./foo.h", 0, nullptr, /*User=*/None, /*Group=*/None,
+ llvm::sys::fs::file_type::regular_file);
+ llvm::Expected<FileEntryRef> FileRef = FileMgr.getFileRef("inc/foo.h", false);
+ assert(FileRef);
+ const auto *const FE = &FileRef->getFileEntry();
+ EXPECT_EQ(StringRef(FileRef->getName()), StringRef("inc/foo.h"));
+
+ FileRef = FileMgr.getFileRef("./inc/./foo.h", false);
+ assert(FileRef);
+ EXPECT_EQ(StringRef(FileRef->getName()), StringRef("inc/foo.h"));
+ EXPECT_EQ(FE, &FileRef->getFileEntry());
+
+ FileRef = FileMgr.getFileRef("inc/./foo.h", false);
+ assert(FileRef);
+ EXPECT_EQ(StringRef(FileRef->getName()), StringRef("inc/foo.h"));
+ EXPECT_EQ(FE, &FileRef->getFileEntry());
+
addSearchDir("/x/./y/");
EXPECT_EQ(Search.suggestPathToFileForDiagnostics("/x/y/./z",
/*WorkingDir=*/"",
Index: clang/test/Modules/filename.cpp
===================================================================
--- clang/test/Modules/filename.cpp
+++ clang/test/Modules/filename.cpp
@@ -5,4 +5,4 @@
// Make sure that headers that are referenced by module maps have __FILE__
// reflect the include path they were found with.
-// CHECK: const char *p = "./Inputs/filename/a.h"
+// CHECK: const char *p = "Inputs/filename/a.h"
Index: clang/test/Modules/cxx20-hu-06.cpp
===================================================================
--- clang/test/Modules/cxx20-hu-06.cpp
+++ clang/test/Modules/cxx20-hu-06.cpp
@@ -65,4 +65,4 @@
return FORTYTWO;
}
#endif
-// CHECK-IMP: remark: importing module './hu-01.h' from 'hu-01.pcm'
+// CHECK-IMP: remark: importing module 'hu-01.h' from 'hu-01.pcm'
Index: clang/test/Modules/cxx20-hu-05.cpp
===================================================================
--- clang/test/Modules/cxx20-hu-05.cpp
+++ clang/test/Modules/cxx20-hu-05.cpp
@@ -29,4 +29,4 @@
#endif // __GUARD
// CHECK-HU: ====== C++20 Module structure ======
-// CHECK-HU-NEXT: Header Unit './hu-01.h' is the Primary Module at index #1
+// CHECK-HU-NEXT: Header Unit 'hu-01.h' is the Primary Module at index #1
Index: clang/test/Modules/cxx20-hu-04.cpp
===================================================================
--- clang/test/Modules/cxx20-hu-04.cpp
+++ clang/test/Modules/cxx20-hu-04.cpp
@@ -39,7 +39,7 @@
// expected-no-diagnostics
// CHECK-HU: ====== C++20 Module structure ======
-// CHECK-HU-NEXT: Header Unit './hu-01.h' is the Primary Module at index #1
+// CHECK-HU-NEXT: Header Unit 'hu-01.h' is the Primary Module at index #1
//--- hu-02.h
export import "hu-01.h";
@@ -73,11 +73,11 @@
}
#endif
-// CHECK-IMP: remark: importing module './hu-01.h' from 'hu-01.pcm'
+// CHECK-IMP: remark: importing module 'hu-01.h' from 'hu-01.pcm'
// CHECK-HU2: ====== C++20 Module structure ======
-// CHECK-HU2-NEXT: Header Unit './hu-02.h' is the Primary Module at index #2
+// CHECK-HU2-NEXT: Header Unit 'hu-02.h' is the Primary Module at index #2
// CHECK-HU2-NEXT: Exports:
-// CHECK-HU2-NEXT: Header Unit './hu-01.h' is at index #1
+// CHECK-HU2-NEXT: Header Unit 'hu-01.h' is at index #1
// expected-no-diagnostics
//--- importer-01.cpp
@@ -101,5 +101,5 @@
return foo(FORTYTWO + x + KAP);
}
-// CHECK-IMP-HU2: remark: importing module './hu-02.h' from 'hu-02.pcm'
-// CHECK-IMP-HU2: remark: importing module './hu-01.h' into './hu-02.h' from '[[TDIR]]{{[/\\]}}hu-01.pcm'
+// CHECK-IMP-HU2: remark: importing module 'hu-02.h' from 'hu-02.pcm'
+// CHECK-IMP-HU2: remark: importing module 'hu-01.h' into 'hu-02.h' from '[[TDIR]]{{[/\\]}}hu-01.pcm'
Index: clang/test/Index/skip-parsed-bodies/compile_commands.json
===================================================================
--- clang/test/Index/skip-parsed-bodies/compile_commands.json
+++ clang/test/Index/skip-parsed-bodies/compile_commands.json
@@ -1,73 +1,73 @@
[
-{
- "directory": ".",
- "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t1.cpp",
- "file": "t1.cpp"
-},
-{
- "directory": ".",
- "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t2.cpp -DBLAH",
- "file": "t2.cpp"
-},
-{
- "directory": ".",
- "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t3.cpp -DBLAH",
- "file": "t3.cpp"
-}
+ {
+ "directory": ".",
+ "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t1.cpp",
+ "file": "t1.cpp"
+ },
+ {
+ "directory": ".",
+ "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t2.cpp -DBLAH",
+ "file": "t2.cpp"
+ },
+ {
+ "directory": ".",
+ "command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t3.cpp -DBLAH",
+ "file": "t3.cpp"
+ }
]
-// RUN: c-index-test -index-compile-db %s | FileCheck %s
+ // RUN: c-index-test -index-compile-db %s | FileCheck %s
-// CHECK: [startedTranslationUnit]
-// CHECK-NEXT: [enteredMainFile]: t1.cpp
-// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:9:27
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
-// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:15:5
-// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:19:5
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val1'
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val2'
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val3'
+ // CHECK: [startedTranslationUnit]
+ // CHECK-NEXT: [enteredMainFile]: t1.cpp
+ // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: t.h:9:27
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
+ // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: t.h:15:5
+ // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: t.h:19:5
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val1'
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val2'
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val3'
-// CHECK-NEXT: [startedTranslationUnit]
-// CHECK-NEXT: [enteredMainFile]: t2.cpp
-// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isContainer: skipped
-// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
-// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
-// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h
-// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:25:5
-// CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./pragma_once.h:8:7
-// CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
-// CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./imported.h:4:5
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val4'
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_tsval'
-// CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_impval'
+ // CHECK-NEXT: [startedTranslationUnit]
+ // CHECK-NEXT: [enteredMainFile]: t2.cpp
+ // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isContainer: skipped
+ // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
+ // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
+ // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [ppIncludedFile]: pragma_once.h
+ // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: t.h:25:5
+ // CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: pragma_once.h:8:7
+ // CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1
+ // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: imported.h:4:5
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val4'
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_tsval'
+ // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_impval'
-// CHECK-NEXT: [startedTranslationUnit]
-// CHECK-NEXT: [enteredMainFile]: t3.cpp
-// CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
-// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
-// CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
-// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [ppIncludedFile]: ./pragma_once.h
-// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NEXT: [indexDeclaration]: kind: variable | {{.*}} | loc: ./pragma_once.h:3:12
-// CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val |
-// CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
-// CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val |
-// CHECK-NOT: [diagnostic]: {{.*}} undeclared identifier
+ // CHECK-NEXT: [startedTranslationUnit]
+ // CHECK-NEXT: [enteredMainFile]: t3.cpp
+ // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0
+ // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS |
+ // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C |
+ // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [ppIncludedFile]: pragma_once.h
+ // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NEXT: [indexDeclaration]: kind: variable | {{.*}} | loc: pragma_once.h:3:12
+ // CHECK: [indexDeclaration]: kind: c++-instance-method | name: tsmeth | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val |
+ // CHECK: [indexDeclaration]: kind: function | name: imp_foo | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped
+ // CHECK-NOT: [indexEntityReference]: kind: variable | name: some_val |
+ // CHECK-NOT: [diagnostic]: {{.*}} undeclared identifier
Index: clang/test/Frontend/dependency-gen.c
===================================================================
--- clang/test/Frontend/dependency-gen.c
+++ clang/test/Frontend/dependency-gen.c
@@ -16,7 +16,7 @@
// RUN: %clang -MD -MF - %s -fsyntax-only -I .//./a/b/ | FileCheck -check-prefix=CHECK-FOUR %s
// CHECK-FOUR: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b/. | FileCheck -check-prefix=CHECK-FIVE %s
-// CHECK-FIVE: {{ }}a{{[/\\]}}b{{[/\\]}}.{{[/\\]}}x.h
+// CHECK-FIVE: {{ }}a{{[/\\]}}b{{[/\\]}}x.h
// RUN: cd a/b
// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
// CHECK-SIX: {{ }}x.h
Index: clang/test/ClangScanDeps/header-search-pruning-transitive.c
===================================================================
--- clang/test/ClangScanDeps/header-search-pruning-transitive.c
+++ clang/test/ClangScanDeps/header-search-pruning-transitive.c
@@ -37,6 +37,9 @@
//--- test.c
#include "X.h"
+// clang-format mangles this .c file in unreasonable ways.
+// clang-format off
+
//--- cdb_with_a.json.template
[{
"file": "DIR/test.c",
@@ -72,8 +75,8 @@
// CHECK: ],
// CHECK-NEXT: "context-hash": "[[HASH_X:.*]]",
// CHECK-NEXT: "file-deps": [
-// CHECK-NEXT: "[[PREFIX]]/./X.h",
-// CHECK-NEXT: "[[PREFIX]]/./module.modulemap"
+// CHECK-NEXT: "[[PREFIX]]/X.h",
+// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "name": "X"
// CHECK-NEXT: },
@@ -84,11 +87,11 @@
// CHECK: ],
// CHECK-NEXT: "context-hash": "[[HASH_Y_WITH_A]]",
// CHECK-NEXT: "file-deps": [
-// CHECK-NEXT: "[[PREFIX]]/./Y.h",
-// CHECK-NEXT: "[[PREFIX]]/./a/a.h",
-// CHECK-NEXT: "[[PREFIX]]/./begin/begin.h",
-// CHECK-NEXT: "[[PREFIX]]/./end/end.h",
-// CHECK-NEXT: "[[PREFIX]]/./module.modulemap"
+// CHECK-NEXT: "[[PREFIX]]/Y.h",
+// CHECK-NEXT: "[[PREFIX]]/a/a.h",
+// CHECK-NEXT: "[[PREFIX]]/begin/begin.h",
+// CHECK-NEXT: "[[PREFIX]]/end/end.h",
+// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "name": "Y"
// CHECK-NEXT: }
@@ -127,8 +130,8 @@
// also has a different context hash from the first version of module X.
// CHECK-NOT: "context-hash": "[[HASH_X]]",
// CHECK: "file-deps": [
-// CHECK-NEXT: "[[PREFIX]]/./X.h",
-// CHECK-NEXT: "[[PREFIX]]/./module.modulemap"
+// CHECK-NEXT: "[[PREFIX]]/X.h",
+// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "name": "X"
// CHECK-NEXT: },
@@ -139,10 +142,10 @@
// CHECK: ],
// CHECK-NEXT: "context-hash": "[[HASH_Y_WITHOUT_A]]",
// CHECK-NEXT: "file-deps": [
-// CHECK-NEXT: "[[PREFIX]]/./Y.h",
-// CHECK-NEXT: "[[PREFIX]]/./begin/begin.h",
-// CHECK-NEXT: "[[PREFIX]]/./end/end.h",
-// CHECK-NEXT: "[[PREFIX]]/./module.modulemap"
+// CHECK-NEXT: "[[PREFIX]]/Y.h",
+// CHECK-NEXT: "[[PREFIX]]/begin/begin.h",
+// CHECK-NEXT: "[[PREFIX]]/end/end.h",
+// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "name": "Y"
// CHECK-NEXT: }
Index: clang/lib/Basic/FileManager.cpp
===================================================================
--- clang/lib/Basic/FileManager.cpp
+++ clang/lib/Basic/FileManager.cpp
@@ -136,6 +136,13 @@
++NumDirLookups;
+ SmallString<128> CleanDirName;
+ if (DirName.size() > 1) {
+ CleanDirName = DirName;
+ llvm::sys::path::remove_dots(CleanDirName);
+ DirName = CleanDirName;
+ }
+
// See if there was already an entry in the map. Note that the map
// contains both virtual and real directories.
auto SeenDirInsertResult =
@@ -205,6 +212,11 @@
FileManager::getFileRef(StringRef Filename, bool openFile, bool CacheFailure) {
++NumFileLookups;
+ SmallString<128> CleanFilename = Filename;
+ // Explicitly not removing "../" because doing so can break symlinks.
+ llvm::sys::path::remove_dots(CleanFilename, /*remove_dot_dot=*/false);
+ Filename = CleanFilename;
+
// See if there is already an entry in the map.
auto SeenFileInsertResult =
SeenFileEntries.insert({Filename, std::errc::no_such_file_or_directory});
Index: clang/bindings/python/tests/cindex/test_translation_unit.py
===================================================================
--- clang/bindings/python/tests/cindex/test_translation_unit.py
+++ clang/bindings/python/tests/cindex/test_translation_unit.py
@@ -85,7 +85,7 @@
int x;
int SOME_DEFINE;
"""),
- ('./fake.h', """
+ ('fake.h', """
#define SOME_DEFINE y
""")
])
Index: clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
===================================================================
--- clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
+++ clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
@@ -1,3 +1,3 @@
# RUN: not modularize %S/Inputs/MissingHeader/module.modulemap 2>&1 | FileCheck %s
-# CHECK: {{.*}}{{[/\\]}}Inputs/MissingHeader/module.modulemap:8:10: error : Header not found: Missing.h
+# CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}MissingHeader{{[/\\]}}module.modulemap:8:10: error : Header not found: Missing.h
Index: clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
@@ -49,14 +49,14 @@
// CHECK-FIXES-ENABLED-NEXT: STYLE_SECOND_BAD();
// CHECK-FIXES-SHARED-NEXT: }
-// CHECK-MESSAGES-DISABLED: global-style1/header.h:3:6: warning: invalid case style for function 'style_first_good'
-// CHECK-MESSAGES-ENABLED: global-style1/header.h:5:6: warning: invalid case style for global function 'styleFirstBad'
-// CHECK-MESSAGES-ENABLED: global-style1/header.h:7:5: warning: invalid case style for global function 'thisIsMainLikeIgnored'
-// CHECK-MESSAGES-DISABLED: global-style1/header.h:7:31: warning: invalid case style for parameter 'argc'
-// CHECK-MESSAGES-DISABLED: global-style1/header.h:7:49: warning: invalid case style for parameter 'argv'
-
-// CHECK-MESSAGES-DISABLED: global-style2/header.h:3:6: warning: invalid case style for function 'STYLE_SECOND_GOOD'
-// CHECK-MESSAGES-ENABLED: global-style2/header.h:5:6: warning: invalid case style for global function 'styleSecondBad'
-// CHECK-MESSAGES-ENABLED: global-style2/header.h:7:5: warning: invalid case style for global function 'thisIsMainLikeNotIgnored'
-// CHECK-MESSAGES-SHARED: global-style2/header.h:7:34: warning: invalid case style for parameter 'argc'
-// CHECK-MESSAGES-SHARED: global-style2/header.h:7:52: warning: invalid case style for parameter 'argv'
+// CHECK-MESSAGES-DISABLED: global-style1{{[/\\]}}header.h:3:6: warning: invalid case style for function 'style_first_good'
+// CHECK-MESSAGES-ENABLED: global-style1{{[/\\]}}header.h:5:6: warning: invalid case style for global function 'styleFirstBad'
+// CHECK-MESSAGES-ENABLED: global-style1{{[/\\]}}header.h:7:5: warning: invalid case style for global function 'thisIsMainLikeIgnored'
+// CHECK-MESSAGES-DISABLED: global-style1{{[/\\]}}header.h:7:31: warning: invalid case style for parameter 'argc'
+// CHECK-MESSAGES-DISABLED: global-style1{{[/\\]}}header.h:7:49: warning: invalid case style for parameter 'argv'
+
+// CHECK-MESSAGES-DISABLED: global-style2{{[/\\]}}header.h:3:6: warning: invalid case style for function 'STYLE_SECOND_GOOD'
+// CHECK-MESSAGES-ENABLED: global-style2{{[/\\]}}header.h:5:6: warning: invalid case style for global function 'styleSecondBad'
+// CHECK-MESSAGES-ENABLED: global-style2{{[/\\]}}header.h:7:5: warning: invalid case style for global function 'thisIsMainLikeNotIgnored'
+// CHECK-MESSAGES-SHARED: global-style2{{[/\\]}}header.h:7:34: warning: invalid case style for parameter 'argc'
+// CHECK-MESSAGES-SHARED: global-style2{{[/\\]}}header.h:7:52: warning: invalid case style for parameter 'argv'
Index: clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
@@ -7,7 +7,7 @@
/// Warning will be triggered on code that is not internal that is included.
#include "absl/external-file.h"
-// CHECK: absl/external-file.h:1:11: warning: namespace 'absl' is reserved
+// CHECK: absl{{[/\\]}}external-file.h:1:11: warning: namespace 'absl' is reserved
namespace absl {}
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl' is reserved for implementation of the Abseil library and should not be opened in user code [abseil-no-namespace]
Index: clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
@@ -6,7 +6,7 @@
// CHECK-NOT: warning:
#include "absl/external-file.h"
-// CHECK: absl/external-file.h:6:24: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil [abseil-no-internal-dependencies]
+// CHECK: absl{{[/\\]}}external-file.h:6:24: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil [abseil-no-internal-dependencies]
void DirectAcess() {
absl::strings_internal::InternalFunction();
Index: clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
===================================================================
--- clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
+++ clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
@@ -4,4 +4,5 @@
// RUN: sed "s#\$(path)#%/T/Inputs/order-dependent#" %S/Inputs/order-dependent/file2.yaml > %T/Inputs/order-dependent/file2.yaml
// RUN: sed "s#\$(path)#%/T/Inputs/order-dependent#" %S/Inputs/order-dependent/expected.txt > %T/Inputs/order-dependent/expected.txt
// RUN: not clang-apply-replacements %T/Inputs/order-dependent > %T/Inputs/order-dependent/output.txt 2>&1
-// RUN: diff -b %T/Inputs/order-dependent/output.txt %T/Inputs/order-dependent/expected.txt
+// RUN: sed 's#\\#/#g' %T/Inputs/order-dependent/output.txt > %T/Inputs/order-dependent/output-u.txt
+// RUN: diff -b %T/Inputs/order-dependent/output-u.txt %T/Inputs/order-dependent/expected.txt
Index: clang-tools-extra/test/clang-apply-replacements/conflict.cpp
===================================================================
--- clang-tools-extra/test/clang-apply-replacements/conflict.cpp
+++ clang-tools-extra/test/clang-apply-replacements/conflict.cpp
@@ -4,7 +4,8 @@
// RUN: sed "s#\$(path)#%/S/Inputs/conflict#" %S/Inputs/conflict/file3.yaml > %T/Inputs/conflict/file3.yaml
// RUN: sed "s#\$(path)#%/S/Inputs/conflict#" %S/Inputs/conflict/expected.txt > %T/Inputs/conflict/expected.txt
// RUN: not clang-apply-replacements %T/Inputs/conflict > %T/Inputs/conflict/output.txt 2>&1
-// RUN: diff -b %T/Inputs/conflict/output.txt %T/Inputs/conflict/expected.txt
+// RUN: sed 's#\\#/#g' %T/Inputs/conflict/output.txt > %T/Inputs/conflict/output-u.txt
+// RUN: diff -b %T/Inputs/conflict/output-u.txt %T/Inputs/conflict/expected.txt
//
// Check that the yaml files are *not* deleted after running clang-apply-replacements without remove-change-desc-files even when there is a failure.
// RUN: ls -1 %T/Inputs/conflict | FileCheck %s --check-prefix=YAML
Index: clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
+++ clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
@@ -100,10 +100,9 @@
// We added a mapping from some/path to <path>.
ASSERT_EQ("<path>", CI.mapHeader(File));
// We should have a path from 'bits/stl_vector.h' to '<vector>'.
- // FIXME: The Standrad Library map in CanonicalIncludes expects forward
- // slashes and Windows would use backward slashes instead, so the headers are
- // not matched appropriately.
- auto STLVectorFile = addFile(*InMemFS, Files, "bits/stl_vector.h");
+ SmallString<32> FileName("bits/stl_vector.h");
+ llvm::sys::path::make_preferred(FileName);
+ auto STLVectorFile = addFile(*InMemFS, Files, FileName);
ASSERT_EQ("<vector>", CI.mapHeader(STLVectorFile));
}
Index: clang-tools-extra/clangd/index/CanonicalIncludes.cpp
===================================================================
--- clang-tools-extra/clangd/index/CanonicalIncludes.cpp
+++ clang-tools-extra/clangd/index/CanonicalIncludes.cpp
@@ -18,6 +18,672 @@
namespace clangd {
namespace {
const char IWYUPragma[] = "// IWYU pragma: private, include ";
+
+const llvm::StringMap<llvm::StringRef> *GetHeaderMapping() {
+ static auto *Mappings =
+ new std::array<std::pair<std::string, std::string>, 645>{{
+ {"algorithm", "<algorithm>"},
+ {"array", "<array>"},
+ {"atomic", "<atomic>"},
+ {"backward/auto_ptr.h", "<memory>"},
+ {"backward/binders.h", "<string>"},
+ {"bits/algorithmfwd.h", "<algorithm>"},
+ {"bits/alloc_traits.h", "<memory>"},
+ {"bits/allocated_ptr.h", "<memory>"},
+ {"bits/allocator.h", "<allocator>"},
+ {"bits/atomic_base.h", "<atomic>"},
+ {"bits/atomic_futex.h", "<atomic>"},
+ {"bits/atomic_lockfree_defines.h", "<exception>"},
+ {"bits/atomic_word.h", "<memory>"},
+ {"bits/auxv.h", "<sys/auxv.h>"},
+ {"bits/basic_file.h", "<fstream>"},
+ {"bits/basic_ios.h", "<ios>"},
+ {"bits/basic_ios.tcc", "<ios>"},
+ {"bits/basic_string.h", "<string>"},
+ {"bits/basic_string.tcc", "<string>"},
+ {"bits/byteswap-16.h", "<byteswap.h>"},
+ {"bits/byteswap.h", "<byteswap.h>"},
+ {"bits/c++allocator.h", "<string>"},
+ {"bits/c++config.h", "<cstddef>"},
+ {"bits/c++io.h", "<ios>"},
+ {"bits/c++locale.h", "<locale>"},
+ {"bits/char_traits.h", "<string>"},
+ {"bits/cmathcalls.h", "<complex.h>"},
+ {"bits/codecvt.h", "<locale>"},
+ {"bits/concept_check.h", "<numeric>"},
+ {"bits/confname.h", "<unistd.h>"},
+ {"bits/cpp_type_traits.h", "<cmath>"},
+ {"bits/cpu_defines.h", "<iosfwd>"},
+ {"bits/ctype_base.h", "<locale>"},
+ {"bits/cxxabi_forced.h", "<cxxabi.h>"},
+ {"bits/cxxabi_tweaks.h", "<cxxabi.h>"},
+ {"bits/deque.tcc", "<deque>"},
+ {"bits/dirent.h", "<dirent.h>"},
+ {"bits/dlfcn.h", "<dlfcn.h>"},
+ {"bits/elfclass.h", "<link.h>"},
+ {"bits/endian.h", "<endian.h>"},
+ {"bits/environments.h", "<unistd.h>"},
+ {"bits/epoll.h", "<sys/epoll.h>"},
+ {"bits/errno.h", "<cerrno>"},
+ {"bits/error_constants.h", "<system_error>"},
+ {"bits/eventfd.h", "<sys/eventfd.h>"},
+ {"bits/exception.h", "<exception>"},
+ {"bits/exception_defines.h", "<exception>"},
+ {"bits/exception_ptr.h", "<exception>"},
+ {"bits/fcntl-linux.h", "<fcntl.h>"},
+ {"bits/fcntl.h", "<fcntl.h>"},
+ {"bits/fenv.h", "<fenv.h>"},
+ {"bits/forward_list.h", "<forward_list>"},
+ {"bits/forward_list.tcc", "<forward_list>"},
+ {"bits/fstream.tcc", "<fstream>"},
+ {"bits/functexcept.h", "<list>"},
+ {"bits/functional_hash.h", "<functional>"},
+ {"bits/gslice.h", "<valarray>"},
+ {"bits/gslice_array.h", "<valarray>"},
+ {"bits/gthr-default.h", "<memory>"},
+ {"bits/gthr.h", "<memory>"},
+ {"bits/hash_bytes.h", "<typeinfo>"},
+ {"bits/hashtable.h", "<unordered_set>"},
+ {"bits/hashtable_policy.h", "<unordered_set>"},
+ {"bits/huge_val.h", "<cmath>"},
+ {"bits/huge_valf.h", "<cmath>"},
+ {"bits/huge_vall.h", "<cmath>"},
+ {"bits/in.h", "<netinet/in.h>"},
+ {"bits/indirect_array.h", "<valarray>"},
+ {"bits/inf.h", "<cmath>"},
+ {"bits/inotify.h", "<sys/inotify.h>"},
+ {"bits/invoke.h", "<functional>"},
+ {"bits/ioctl-types.h", "<sys/ioctl.h>"},
+ {"bits/ioctls.h", "<sys/ioctl.h>"},
+ {"bits/ios_base.h", "<ios>"},
+ {"bits/ipc.h", "<sys/ipc.h>"},
+ {"bits/ipctypes.h", "<sys/ipc.h>"},
+ {"bits/istream.tcc", "<istream>"},
+ {"bits/link.h", "<link.h>"},
+ {"bits/list.tcc", "<list>"},
+ {"bits/local_lim.h", "<climits>"},
+ {"bits/locale.h", "<clocale>"},
+ {"bits/locale_classes.h", "<locale>"},
+ {"bits/locale_classes.tcc", "<locale>"},
+ {"bits/locale_conv.h", "<locale>"},
+ {"bits/locale_facets.h", "<locale>"},
+ {"bits/locale_facets.tcc", "<locale>"},
+ {"bits/locale_facets_nonio.h", "<locale>"},
+ {"bits/locale_facets_nonio.tcc", "<locale>"},
+ {"bits/localefwd.h", "<locale>"},
+ {"bits/mask_array.h", "<valarray>"},
+ {"bits/mathcalls.h", "<math.h>"},
+ {"bits/mathdef.h", "<cmath>"},
+ {"bits/memoryfwd.h", "<memory>"},
+ {"bits/mman-linux.h", "<sys/mman.h>"},
+ {"bits/mman.h", "<sys/mman.h>"},
+ {"bits/move.h", "<utility>"},
+ {"bits/mqueue.h", "<mqueue.h>"},
+ {"bits/msq.h", "<sys/msg.h>"},
+ {"bits/nan.h", "<cmath>"},
+ {"bits/nested_exception.h", "<exception>"},
+ {"bits/netdb.h", "<netdb.h>"},
+ {"bits/opt_random.h", "<random>"},
+ {"bits/os_defines.h", "<iosfwd>"},
+ {"bits/ostream.tcc", "<ostream>"},
+ {"bits/ostream_insert.h", "<ostream>"},
+ {"bits/param.h", "<sys/param.h>"},
+ {"bits/parse_numbers.h", "<chrono>"},
+ {"bits/poll.h", "<sys/poll.h>"},
+ {"bits/posix1_lim.h", "<climits>"},
+ {"bits/posix2_lim.h", "<climits>"},
+ {"bits/posix_opt.h", "<bits/posix_opt.h>"},
+ {"bits/postypes.h", "<ios>"},
+ {"bits/predefined_ops.h", "<algorithm>"},
+ {"bits/pthreadtypes.h", "<pthread.h>"},
+ {"bits/ptr_traits.h", "<memory>"},
+ {"bits/quoted_string.h", "<iomanip>"},
+ {"bits/random.h", "<random>"},
+ {"bits/random.tcc", "<random>"},
+ {"bits/range_access.h", "<iterator>"},
+ {"bits/refwrap.h", "<functional>"},
+ {"bits/regex.h", "<regex>"},
+ {"bits/regex_automaton.h", "<regex>"},
+ {"bits/regex_compiler.h", "<regex>"},
+ {"bits/regex_constants.h", "<regex>"},
+ {"bits/regex_cursor.h", "<regex>"},
+ {"bits/regex_error.h", "<regex>"},
+ {"bits/regex_executor.h", "<regex>"},
+ {"bits/regex_grep_matcher.h", "<regex>"},
+ {"bits/regex_grep_matcher.tcc", "<regex>"},
+ {"bits/regex_nfa.h", "<regex>"},
+ {"bits/regex_scanner.h", "<regex>"},
+ {"bits/resource.h", "<sys/resource.h>"},
+ {"bits/sched.h", "<sched.h>"},
+ {"bits/select.h", "<sys/select.h>"},
+ {"bits/sem.h", "<sys/sem.h>"},
+ {"bits/semaphore.h", "<semaphore.h>"},
+ {"bits/setjmp.h", "<csetjmp>"},
+ {"bits/shared_ptr.h", "<memory>"},
+ {"bits/shared_ptr_atomic.h", "<atomic>"},
+ {"bits/shared_ptr_base.h", "<memory>"},
+ {"bits/shm.h", "<sys/shm.h>"},
+ {"bits/sigaction.h", "<csignal>"},
+ {"bits/sigcontext.h", "<csignal>"},
+ {"bits/siginfo.h", "<csignal>"},
+ {"bits/signalfd.h", "<sys/signalfd.h>"},
+ {"bits/signum.h", "<csignal>"},
+ {"bits/sigset.h", "<csignal>"},
+ {"bits/sigstack.h", "<csignal>"},
+ {"bits/sigthread.h", "<pthread.h>"},
+ {"bits/slice_array.h", "<valarray>"},
+ {"bits/sockaddr.h", "<sys/socket.h>"},
+ {"bits/socket.h", "<sys/socket.h>"},
+ {"bits/socket_type.h", "<sys/socket.h>"},
+ {"bits/sstream.tcc", "<sstream>"},
+ {"bits/stab.def", "<stab.h>"},
+ {"bits/stat.h", "<sys/stat.h>"},
+ {"bits/statfs.h", "<sys/statfs.h>"},
+ {"bits/statvfs.h", "<sys/statvfs.h>"},
+ {"bits/std_abs.h", "<cmath>"},
+ {"bits/std_function.h", "<functional>"},
+ {"bits/std_mutex.h", "<mutex>"},
+ {"bits/stdint-intn.h", "<cstdint>"},
+ {"bits/stdint-uintn.h", "<cstdint>"},
+ {"bits/stdio_lim.h", "<cstdio>"},
+ {"bits/stl_algo.h", "<algorithm>"},
+ {"bits/stl_algobase.h", "<algorithm>"},
+ {"bits/stl_bvector.h", "<vector>"},
+ {"bits/stl_construct.h", "<deque>"},
+ {"bits/stl_deque.h", "<deque>"},
+ {"bits/stl_function.h", "<functional>"},
+ {"bits/stl_heap.h", "<heap>"},
+ {"bits/stl_iterator.h", "<iterator>"},
+ {"bits/stl_iterator_base_funcs.h", "<iterator>"},
+ {"bits/stl_iterator_base_types.h", "<iterator>"},
+ {"bits/stl_list.h", "<list>"},
+ {"bits/stl_map.h", "<map>"},
+ {"bits/stl_multimap.h", "<map>"},
+ {"bits/stl_multiset.h", "<set>"},
+ {"bits/stl_numeric.h", "<numeric>"},
+ {"bits/stl_pair.h", "<utility>"},
+ {"bits/stl_queue.h", "<queue>"},
+ {"bits/stl_raw_storage_iter.h", "<memory>"},
+ {"bits/stl_relops.h", "<utility>"},
+ {"bits/stl_set.h", "<set>"},
+ {"bits/stl_stack.h", "<stack>"},
+ {"bits/stl_tempbuf.h", "<memory>"},
+ {"bits/stl_tree.h", "<map>"},
+ {"bits/stl_uninitialized.h", "<memory>"},
+ {"bits/stl_vector.h", "<vector>"},
+ {"bits/stream_iterator.h", "<iterator>"},
+ {"bits/streambuf.tcc", "<streambuf>"},
+ {"bits/streambuf_iterator.h", "<iterator>"},
+ {"bits/stringfwd.h", "<string>"},
+ {"bits/stropts.h", "<stropts.h>"},
+ {"bits/sys_errlist.h", "<cstdio>"},
+ {"bits/syscall.h", "<sys/syscall.h>"},
+ {"bits/syslog-path.h", "<sys/syslog.h>"},
+ {"bits/termios.h", "<termios.h>"},
+ {"bits/time.h", "<ctime>"},
+ {"bits/timerfd.h", "<sys/timerfd.h>"},
+ {"bits/timex.h", "<ctime>"},
+ {"bits/types.h", "<sys/types.h>"},
+ {"bits/typesizes.h", "<cstdio>"},
+ {"bits/uio.h", "<sys/uio.h>"},
+ {"bits/uniform_int_dist.h", "<random>"},
+ {"bits/unique_ptr.h", "<memory>"},
+ {"bits/unordered_map.h", "<unordered_map>"},
+ {"bits/unordered_set.h", "<unordered_set>"},
+ {"bits/uses_allocator.h", "<memory>"},
+ {"bits/ustat.h", "<sys/ustat.h>"},
+ {"bits/utmp.h", "<utmp.h>"},
+ {"bits/utmpx.h", "<utmpx.h>"},
+ {"bits/utsname.h", "<sys/utsname.h>"},
+ {"bits/valarray_after.h", "<valarray>"},
+ {"bits/valarray_array.h", "<valarray>"},
+ {"bits/valarray_array.tcc", "<valarray>"},
+ {"bits/valarray_before.h", "<valarray>"},
+ {"bits/vector.tcc", "<vector>"},
+ {"bits/waitflags.h", "<sys/wait.h>"},
+ {"bits/waitstatus.h", "<sys/wait.h>"},
+ {"bits/wchar.h", "<cwchar>"},
+ {"bits/wordsize.h", "<csetjmp>"},
+ {"bits/xopen_lim.h", "<climits>"},
+ {"bits/xtitypes.h", "<stropts.h>"},
+ {"bitset", "<bitset>"},
+ {"ccomplex", "<ccomplex>"},
+ {"cctype", "<cctype>"},
+ {"cerrno", "<cerrno>"},
+ {"cfenv", "<cfenv>"},
+ {"cfloat", "<cfloat>"},
+ {"chrono", "<chrono>"},
+ {"cinttypes", "<cinttypes>"},
+ {"climits", "<climits>"},
+ {"clocale", "<clocale>"},
+ {"cmath", "<cmath>"},
+ {"complex", "<complex>"},
+ {"complex.h", "<complex.h>"},
+ {"condition_variable", "<condition_variable>"},
+ {"csetjmp", "<csetjmp>"},
+ {"csignal", "<csignal>"},
+ {"cstdalign", "<cstdalign>"},
+ {"cstdarg", "<cstdarg>"},
+ {"cstdbool", "<cstdbool>"},
+ {"cstdint", "<cstdint>"},
+ {"cstdio", "<cstdio>"},
+ {"cstdlib", "<cstdlib>"},
+ {"cstring", "<cstring>"},
+ {"ctgmath", "<ctgmath>"},
+ {"ctime", "<ctime>"},
+ {"cwchar", "<cwchar>"},
+ {"cwctype", "<cwctype>"},
+ {"cxxabi.h", "<cxxabi.h>"},
+ {"debug/debug.h", "<numeric>"},
+ {"debug/map.h", "<map>"},
+ {"debug/multimap.h", "<multimap>"},
+ {"debug/multiset.h", "<multiset>"},
+ {"debug/set.h", "<set>"},
+ {"deque", "<deque>"},
+ {"exception", "<exception>"},
+ {"ext/alloc_traits.h", "<deque>"},
+ {"ext/atomicity.h", "<memory>"},
+ {"ext/concurrence.h", "<memory>"},
+ {"ext/new_allocator.h", "<string>"},
+ {"ext/numeric_traits.h", "<list>"},
+ {"ext/string_conversions.h", "<string>"},
+ {"ext/type_traits.h", "<cmath>"},
+ {"fenv.h", "<fenv.h>"},
+ {"forward_list", "<forward_list>"},
+ {"fpu_control.h", "<fpu_control.h>"},
+ {"fstream", "<fstream>"},
+ {"functional", "<functional>"},
+ {"future", "<future>"},
+ {"gnu/lib-names.h", "<gnu/lib-names.h>"},
+ {"gnu/libc-version.h", "<gnu/libc-version.h>"},
+ {"gnu/option-groups.h", "<gnu/option-groups.h>"},
+ {"gnu/stubs-32.h", "<gnu/stubs-32.h>"},
+ {"gnu/stubs-64.h", "<gnu/stubs-64.h>"},
+ {"gnu/stubs-x32.h", "<gnu/stubs-x32.h>"},
+ {"ieee754.h", "<ieee754.h>"},
+ {"include/_G_config.h", "<cstdio>"},
+ {"include/__stddef_max_align_t.h", "<cstddef>"},
+ {"include/__wmmintrin_aes.h", "<wmmintrin.h>"},
+ {"include/__wmmintrin_pclmul.h", "<wmmintrin.h>"},
+ {"include/adxintrin.h", "<immintrin.h>"},
+ {"include/aio.h", "<aio.h>"},
+ {"include/aliases.h", "<aliases.h>"},
+ {"include/alloca.h", "<alloca.h>"},
+ {"include/ammintrin.h", "<ammintrin.h>"},
+ {"include/ar.h", "<ar.h>"},
+ {"include/argp.h", "<argp.h>"},
+ {"include/argz.h", "<argz.h>"},
+ {"include/arpa/nameser.h", "<resolv.h>"},
+ {"include/arpa/nameser_compat.h", "<resolv.h>"},
+ {"include/assert.h", "<cassert>"},
+ {"include/avx2intrin.h", "<immintrin.h>"},
+ {"include/avx512bwintrin.h", "<immintrin.h>"},
+ {"include/avx512cdintrin.h", "<immintrin.h>"},
+ {"include/avx512dqintrin.h", "<immintrin.h>"},
+ {"include/avx512erintrin.h", "<immintrin.h>"},
+ {"include/avx512fintrin.h", "<immintrin.h>"},
+ {"include/avx512ifmaintrin.h", "<immintrin.h>"},
+ {"include/avx512ifmavlintrin.h", "<immintrin.h>"},
+ {"include/avx512pfintrin.h", "<immintrin.h>"},
+ {"include/avx512vbmiintrin.h", "<immintrin.h>"},
+ {"include/avx512vbmivlintrin.h", "<immintrin.h>"},
+ {"include/avx512vlbwintrin.h", "<immintrin.h>"},
+ {"include/avx512vlcdintrin.h", "<immintrin.h>"},
+ {"include/avx512vldqintrin.h", "<immintrin.h>"},
+ {"include/avx512vlintrin.h", "<immintrin.h>"},
+ {"include/avxintrin.h", "<immintrin.h>"},
+ {"include/bmi2intrin.h", "<x86intrin.h>"},
+ {"include/bmiintrin.h", "<x86intrin.h>"},
+ {"include/byteswap.h", "<byteswap.h>"},
+ {"include/complex.h", "<complex.h>"},
+ {"include/cpio.h", "<cpio.h>"},
+ {"include/crypt.h", "<crypt.h>"},
+ {"include/ctype.h", "<cctype>"},
+ {"include/dirent.h", "<dirent.h>"},
+ {"include/dlfcn.h", "<dlfcn.h>"},
+ {"include/elf.h", "<elf.h>"},
+ {"include/emmintrin.h", "<emmintrin.h>"},
+ {"include/endian.h", "<endian.h>"},
+ {"include/envz.h", "<envz.h>"},
+ {"include/err.h", "<err.h>"},
+ {"include/errno.h", "<cerrno>"},
+ {"include/error.h", "<error.h>"},
+ {"include/execinfo.h", "<execinfo.h>"},
+ {"include/f16cintrin.h", "<emmintrin.h>"},
+ {"include/fcntl.h", "<fcntl.h>"},
+ {"include/features.h", "<features.h>"},
+ {"include/fenv.h", "<fenv.h>"},
+ {"include/float.h", "<cfloat>"},
+ {"include/fma4intrin.h", "<x86intrin.h>"},
+ {"include/fmaintrin.h", "<immintrin.h>"},
+ {"include/fmtmsg.h", "<fmtmsg.h>"},
+ {"include/fnmatch.h", "<fnmatch.h>"},
+ {"include/fstab.h", "<fstab.h>"},
+ {"include/fts.h", "<fts.h>"},
+ {"include/ftw.h", "<ftw.h>"},
+ {"include/fxsrintrin.h", "<immintrin.h>"},
+ {"include/gconv.h", "<gconv.h>"},
+ {"include/getopt.h", "<getopt.h>"},
+ {"include/glob.h", "<glob.h>"},
+ {"include/grp.h", "<grp.h>"},
+ {"include/gshadow.h", "<gshadow.h>"},
+ {"include/ia32intrin.h", "<x86intrin.h>"},
+ {"include/iconv.h", "<iconv.h>"},
+ {"include/ifaddrs.h", "<ifaddrs.h>"},
+ {"include/immintrin.h", "<immintrin.h>"},
+ {"include/inttypes.h", "<cinttypes>"},
+ {"include/kdb.h", "<kdb.h>"},
+ {"include/langinfo.h", "<langinfo.h>"},
+ {"include/libgen.h", "<libgen.h>"},
+ {"include/libintl.h", "<libintl.h>"},
+ {"include/libio.h", "<cstdio>"},
+ {"include/limits.h", "<climits>"},
+ {"include/link.h", "<link.h>"},
+ {"include/locale.h", "<clocale>"},
+ {"include/lzcntintrin.h", "<x86intrin.h>"},
+ {"include/malloc.h", "<malloc.h>"},
+ {"include/math.h", "<cmath>"},
+ {"include/mcheck.h", "<mcheck.h>"},
+ {"include/memory.h", "<memory.h>"},
+ {"include/mm3dnow.h", "<mm3dnow.h>"},
+ {"include/mm_malloc.h", "<mm_malloc.h>"},
+ {"include/mmintrin.h", "<mmintrin>"},
+ {"include/mntent.h", "<mntent.h>"},
+ {"include/monetary.h", "<monetary.h>"},
+ {"include/mqueue.h", "<mqueue.h>"},
+ {"include/mwaitxintrin.h", "<x86intrin.h>"},
+ {"include/netatalk/at.h", "<netatalk/at.h>"},
+ {"include/netdb.h", "<netdb.h>"},
+ {"include/netinet/ether.h", "<netinet/ether.h>"},
+ {"include/netinet/icmp6.h", "<netinet/icmp6.h>"},
+ {"include/netinet/if_ether.h", "<netinet/if_ether.h>"},
+ {"include/netinet/if_fddi.h", "<netinet/if_fddi.h>"},
+ {"include/netinet/if_tr.h", "<netinet/if_tr.h>"},
+ {"include/netinet/igmp.h", "<netinet/igmp.h>"},
+ {"include/netinet/in.h", "<netinet/in.h>"},
+ {"include/netinet/in_systm.h", "<netinet/in_systm.h>"},
+ {"include/netinet/ip.h", "<netinet/ip.h>"},
+ {"include/netinet/ip6.h", "<netinet/ip6.h>"},
+ {"include/netinet/ip_icmp.h", "<netinet/ip_icmp.h>"},
+ {"include/netinet/tcp.h", "<netinet/tcp.h>"},
+ {"include/netinet/udp.h", "<netinet/udp.h>"},
+ {"include/netrom/netrom.h", "<netrom/netrom.h>"},
+ {"include/netrose/rose.h", "<netrose/rose.h>"},
+ {"include/nfs/nfs.h", "<nfs/nfs.h>"},
+ {"include/nl_types.h", "<nl_types.h>"},
+ {"include/nss.h", "<nss.h>"},
+ {"include/obstack.h", "<obstack.h>"},
+ {"include/panel.h", "<panel.h>"},
+ {"include/paths.h", "<paths.h>"},
+ {"include/pkuintrin.h", "<immintrin.h>"},
+ {"include/pmmintrin.h", "<pmmintrin.h>"},
+ {"include/popcntintrin.h", "<popcntintrin.h>"},
+ {"include/prfchwintrin.h", "<x86intrin.h>"},
+ {"include/printf.h", "<printf.h>"},
+ {"include/profile.h", "<profile.h>"},
+ {"include/protocols/routed.h", "<protocols/routed.h>"},
+ {"include/protocols/rwhod.h", "<protocols/rwhod.h>"},
+ {"include/protocols/talkd.h", "<protocols/talkd.h>"},
+ {"include/protocols/timed.h", "<protocols/timed.h>"},
+ {"include/pthread.h", "<pthread.h>"},
+ {"include/pty.h", "<pty.h>"},
+ {"include/pwd.h", "<pwd.h>"},
+ {"include/rdseedintrin.h", "<x86intrin.h>"},
+ {"include/re_comp.h", "<re_comp.h>"},
+ {"include/regex.h", "<regex.h>"},
+ {"include/regexp.h", "<regexp.h>"},
+ {"include/resolv.h", "<resolv.h>"},
+ {"include/rpc/auth.h", "<rpc/auth.h>"},
+ {"include/rpc/auth_des.h", "<rpc/auth_des.h>"},
+ {"include/rpc/auth_unix.h", "<rpc/auth_unix.h>"},
+ {"include/rpc/clnt.h", "<rpc/clnt.h>"},
+ {"include/rpc/des_crypt.h", "<rpc/des_crypt.h>"},
+ {"include/rpc/key_prot.h", "<rpc/key_prot.h>"},
+ {"include/rpc/netdb.h", "<netdb.h>"},
+ {"include/rpc/pmap_clnt.h", "<rpc/pmap_clnt.h>"},
+ {"include/rpc/pmap_prot.h", "<rpc/pmap_prot.h>"},
+ {"include/rpc/pmap_rmt.h", "<rpc/pmap_rmt.h>"},
+ {"include/rpc/rpc.h", "<rpc/rpc.h>"},
+ {"include/rpc/rpc_des.h", "<rpc/rpc_des.h>"},
+ {"include/rpc/rpc_msg.h", "<rpc/rpc_msg.h>"},
+ {"include/rpc/svc.h", "<rpc/svc.h>"},
+ {"include/rpc/svc_auth.h", "<rpc/svc_auth.h>"},
+ {"include/rpc/types.h", "<rpc/types.h>"},
+ {"include/rpc/xdr.h", "<rpc/xdr.h>"},
+ {"include/rpcsvc/bootparam.h", "<rpcsvc/bootparam.h>"},
+ {"include/rpcsvc/bootparam_prot.h", "<rpcsvc/bootparam_prot.h>"},
+ {"include/rpcsvc/bootparam_prot.x", "<rpcsvc/bootparam_prot.x>"},
+ {"include/rpcsvc/key_prot.h", "<rpcsvc/key_prot.h>"},
+ {"include/rpcsvc/key_prot.x", "<rpcsvc/key_prot.x>"},
+ {"include/rpcsvc/klm_prot.h", "<rpcsvc/klm_prot.h>"},
+ {"include/rpcsvc/klm_prot.x", "<rpcsvc/klm_prot.x>"},
+ {"include/rpcsvc/mount.h", "<rpcsvc/mount.h>"},
+ {"include/rpcsvc/mount.x", "<rpcsvc/mount.x>"},
+ {"include/rpcsvc/nfs_prot.h", "<rpcsvc/nfs_prot.h>"},
+ {"include/rpcsvc/nfs_prot.x", "<rpcsvc/nfs_prot.x>"},
+ {"include/rpcsvc/nis.h", "<rpcsvc/nis.h>"},
+ {"include/rpcsvc/nis.x", "<rpcsvc/nis.x>"},
+ {"include/rpcsvc/nis_callback.h", "<rpcsvc/nis_callback.h>"},
+ {"include/rpcsvc/nis_callback.x", "<rpcsvc/nis_callback.x>"},
+ {"include/rpcsvc/nis_object.x", "<rpcsvc/nis_object.x>"},
+ {"include/rpcsvc/nis_tags.h", "<rpcsvc/nis_tags.h>"},
+ {"include/rpcsvc/nislib.h", "<rpcsvc/nislib.h>"},
+ {"include/rpcsvc/nlm_prot.h", "<rpcsvc/nlm_prot.h>"},
+ {"include/rpcsvc/nlm_prot.x", "<rpcsvc/nlm_prot.x>"},
+ {"include/rpcsvc/rex.h", "<rpcsvc/rex.h>"},
+ {"include/rpcsvc/rex.x", "<rpcsvc/rex.x>"},
+ {"include/rpcsvc/rquota.h", "<rpcsvc/rquota.h>"},
+ {"include/rpcsvc/rquota.x", "<rpcsvc/rquota.x>"},
+ {"include/rpcsvc/rstat.h", "<rpcsvc/rstat.h>"},
+ {"include/rpcsvc/rstat.x", "<rpcsvc/rstat.x>"},
+ {"include/rpcsvc/rusers.h", "<rpcsvc/rusers.h>"},
+ {"include/rpcsvc/rusers.x", "<rpcsvc/rusers.x>"},
+ {"include/rpcsvc/sm_inter.h", "<rpcsvc/sm_inter.h>"},
+ {"include/rpcsvc/sm_inter.x", "<rpcsvc/sm_inter.x>"},
+ {"include/rpcsvc/spray.h", "<rpcsvc/spray.h>"},
+ {"include/rpcsvc/spray.x", "<rpcsvc/spray.x>"},
+ {"include/rpcsvc/yp.h", "<rpcsvc/yp.h>"},
+ {"include/rpcsvc/yp.x", "<rpcsvc/yp.x>"},
+ {"include/rpcsvc/yp_prot.h", "<rpcsvc/yp_prot.h>"},
+ {"include/rpcsvc/ypclnt.h", "<rpcsvc/ypclnt.h>"},
+ {"include/rpcsvc/yppasswd.h", "<rpcsvc/yppasswd.h>"},
+ {"include/rpcsvc/yppasswd.x", "<rpcsvc/yppasswd.x>"},
+ {"include/rpcsvc/ypupd.h", "<rpcsvc/ypupd.h>"},
+ {"include/rtmintrin.h", "<immintrin.h>"},
+ {"include/sched.h", "<sched.h>"},
+ {"include/scsi/scsi.h", "<scsi/scsi.h>"},
+ {"include/scsi/scsi_ioctl.h", "<scsi/scsi_ioctl>"},
+ {"include/scsi/sg.h", "<scsi/sg.h>"},
+ {"include/search.h", "<search.h>"},
+ {"include/semaphore.h", "<semaphore.h>"},
+ {"include/setjmp.h", "<csetjmp>"},
+ {"include/sgtty.h", "<sgtty.h>"},
+ {"include/shadow.h", "<shadow.h>"},
+ {"include/shaintrin.h", "<immintrin.h>"},
+ {"include/signal.h", "<csignal>"},
+ {"include/smmintrin.h", "<smmintrin.h>"},
+ {"include/spawn.h", "<spawn.h>"},
+ {"include/stab.h", "<stab.h>"},
+ {"include/stdalign.h", "<cstdalign>"},
+ {"include/stdarg.h", "<cstdarg>"},
+ {"include/stdbool.h", "<cstdbool>"},
+ {"include/stdc-predef.h", "<stdc-predef.h>"},
+ {"include/stddef.h", "<cstddef>"},
+ {"include/stdint.h", "<cstdint>"},
+ {"include/stdio.h", "<cstdio>"},
+ {"include/stdio_ext.h", "<stdio_ext.h>"},
+ {"include/stdlib.h", "<cstdlib>"},
+ {"include/string.h", "<cstring>"},
+ {"include/strings.h", "<strings.h>"},
+ {"include/stropts.h", "<stropts.h>"},
+ {"include/sudo_plugin.h", "<sudo_plugin.h>"},
+ {"include/sysexits.h", "<sysexits.h>"},
+ {"include/tar.h", "<tar.h>"},
+ {"include/tbmintrin.h", "<x86intrin.h>"},
+ {"include/tcpd.h", "<tcpd.h>"},
+ {"include/term.h", "<term.h>"},
+ {"include/term_entry.h", "<term_entry.h>"},
+ {"include/termcap.h", "<termcap.h>"},
+ {"include/termios.h", "<termios.h>"},
+ {"include/thread_db.h", "<thread_db.h>"},
+ {"include/tic.h", "<tic.h>"},
+ {"include/time.h", "<ctime>"},
+ {"include/tmmintrin.h", "<tmmintrin.h>"},
+ {"include/ttyent.h", "<ttyent.h>"},
+ {"include/uchar.h", "<uchar.h>"},
+ {"include/ucontext.h", "<ucontext.h>"},
+ {"include/ulimit.h", "<ulimit.h>"},
+ {"include/unctrl.h", "<unctrl.h>"},
+ {"include/unistd.h", "<unistd.h>"},
+ {"include/utime.h", "<utime.h>"},
+ {"include/utmp.h", "<utmp.h>"},
+ {"include/utmpx.h", "<utmpx.h>"},
+ {"include/values.h", "<values.h>"},
+ {"include/wchar.h", "<cwchar>"},
+ {"include/wctype.h", "<cwctype>"},
+ {"include/wmmintrin.h", "<wmmintrin.h>"},
+ {"include/wordexp.h", "<wordexp.h>"},
+ {"include/x86intrin.h", "<x86intrin.h>"},
+ {"include/xlocale.h", "<cstring>"},
+ {"include/xmmintrin.h", "<xmmintrin.h>"},
+ {"include/xopintrin.h", "<x86intrin.h>"},
+ {"include/xsavecintrin.h", "<immintrin.h>"},
+ {"include/xsaveintrin.h", "<immintrin.h>"},
+ {"include/xsaveoptintrin.h", "<immintrin.h>"},
+ {"include/xsavesintrin.h", "<immintrin.h>"},
+ {"include/xtestintrin.h", "<immintrin.h>"},
+ {"initializer_list", "<initializer_list>"},
+ {"iomanip", "<iomanip>"},
+ {"ios", "<ios>"},
+ {"iosfwd", "<iosfwd>"},
+ {"iostream", "<iostream>"},
+ {"istream", "<istream>"},
+ {"iterator", "<iterator>"},
+ {"limits", "<limits>"},
+ {"list", "<list>"},
+ {"locale", "<locale>"},
+ {"map", "<map>"},
+ {"memory", "<memory>"},
+ {"mutex", "<mutex>"},
+ {"new", "<new>"},
+ {"numeric", "<numeric>"},
+ {"ostream", "<ostream>"},
+ {"queue", "<queue>"},
+ {"random", "<random>"},
+ {"ratio", "<ratio>"},
+ {"regex", "<regex>"},
+ {"scoped_allocator", "<scoped_allocator>"},
+ {"set", "<set>"},
+ {"shared_mutex", "<shared_mutex>"},
+ {"sstream", "<sstream>"},
+ {"stack", "<stack>"},
+ {"stdexcept", "<stdexcept>"},
+ {"streambuf", "<streambuf>"},
+ {"string", "<string>"},
+ {"sys/acct.h", "<sys/acct.h>"},
+ {"sys/auxv.h", "<sys/auxv.h>"},
+ {"sys/cdefs.h", "<sys/cdefs.h>"},
+ {"sys/debugreg.h", "<sys/debugreg.h>"},
+ {"sys/dir.h", "<sys/dir.h>"},
+ {"sys/elf.h", "<sys/elf.h>"},
+ {"sys/epoll.h", "<sys/epoll.h>"},
+ {"sys/eventfd.h", "<sys/eventfd.h>"},
+ {"sys/fanotify.h", "<sys/fanotify.h>"},
+ {"sys/file.h", "<sys/file.h>"},
+ {"sys/fsuid.h", "<sys/fsuid.h>"},
+ {"sys/gmon.h", "<sys/gmon.h>"},
+ {"sys/gmon_out.h", "<sys/gmon_out.h>"},
+ {"sys/inotify.h", "<sys/inotify.h>"},
+ {"sys/io.h", "<sys/io.h>"},
+ {"sys/ioctl.h", "<sys/ioctl.h>"},
+ {"sys/ipc.h", "<sys/ipc.h>"},
+ {"sys/kd.h", "<sys/kd.h>"},
+ {"sys/kdaemon.h", "<sys/kdaemon.h>"},
+ {"sys/klog.h", "<sys/klog.h>"},
+ {"sys/mman.h", "<sys/mman.h>"},
+ {"sys/mount.h", "<sys/mount.h>"},
+ {"sys/msg.h", "<sys/msg.h>"},
+ {"sys/mtio.h", "<sys/mtio.h>"},
+ {"sys/param.h", "<sys/param.h>"},
+ {"sys/pci.h", "<sys/pci.h>"},
+ {"sys/perm.h", "<sys/perm.h>"},
+ {"sys/personality.h", "<sys/personality.h>"},
+ {"sys/poll.h", "<sys/poll.h>"},
+ {"sys/prctl.h", "<sys/prctl.h>"},
+ {"sys/procfs.h", "<sys/procfs.h>"},
+ {"sys/profil.h", "<sys/profil.h>"},
+ {"sys/ptrace.h", "<sys/ptrace.h>"},
+ {"sys/queue.h", "<sys/queue.h>"},
+ {"sys/quota.h", "<sys/quota.h>"},
+ {"sys/raw.h", "<sys/raw.h>"},
+ {"sys/reboot.h", "<sys/reboot.h>"},
+ {"sys/reg.h", "<sys/reg.h>"},
+ {"sys/resource.h", "<sys/resource.h>"},
+ {"sys/select.h", "<sys/select.h>"},
+ {"sys/sem.h", "<sys/sem.h>"},
+ {"sys/sendfile.h", "<sys/sendfile.h>"},
+ {"sys/shm.h", "<sys/shm.h>"},
+ {"sys/signalfd.h", "<sys/signalfd.h>"},
+ {"sys/socket.h", "<sys/socket.h>"},
+ {"sys/stat.h", "<sys/stat.h>"},
+ {"sys/statfs.h", "<sys/statfs.h>"},
+ {"sys/statvfs.h", "<sys/statvfs.h>"},
+ {"sys/swap.h", "<sys/swap.h>"},
+ {"sys/syscall.h", "<sys/syscall.h>"},
+ {"sys/sysctl.h", "<sys/sysctl.h>"},
+ {"sys/sysinfo.h", "<sys/sysinfo.h>"},
+ {"sys/syslog.h", "<sys/syslog.h>"},
+ {"sys/sysmacros.h", "<sys/sysmacros.h>"},
+ {"sys/termios.h", "<sys/termios.h>"},
+ {"sys/time.h", "<sys/select.h>"},
+ {"sys/timeb.h", "<sys/timeb.h>"},
+ {"sys/timerfd.h", "<sys/timerfd.h>"},
+ {"sys/times.h", "<sys/times.h>"},
+ {"sys/timex.h", "<sys/timex.h>"},
+ {"sys/ttychars.h", "<sys/ttychars.h>"},
+ {"sys/ttydefaults.h", "<sys/ttydefaults.h>"},
+ {"sys/types.h", "<sys/types.h>"},
+ {"sys/ucontext.h", "<sys/ucontext.h>"},
+ {"sys/uio.h", "<sys/uio.h>"},
+ {"sys/un.h", "<sys/un.h>"},
+ {"sys/user.h", "<sys/user.h>"},
+ {"sys/ustat.h", "<sys/ustat.h>"},
+ {"sys/utsname.h", "<sys/utsname.h>"},
+ {"sys/vlimit.h", "<sys/vlimit.h>"},
+ {"sys/vm86.h", "<sys/vm86.h>"},
+ {"sys/vtimes.h", "<sys/vtimes.h>"},
+ {"sys/wait.h", "<sys/wait.h>"},
+ {"sys/xattr.h", "<sys/xattr.h>"},
+ {"system_error", "<system_error>"},
+ {"tgmath.h", "<tgmath.h>"},
+ {"thread", "<thread>"},
+ {"tuple", "<tuple>"},
+ {"type_traits", "<type_traits>"},
+ {"typeindex", "<typeindex>"},
+ {"typeinfo", "<typeinfo>"},
+ {"unordered_map", "<unordered_map>"},
+ {"unordered_set", "<unordered_set>"},
+ {"utility", "<utility>"},
+ {"valarray", "<valarray>"},
+ {"vector", "<vector>"},
+ }};
+ auto *HeaderMapping = new llvm::StringMap<llvm::StringRef>(Mappings->size());
+
+ auto Canonicalize = [](std::string &S) {
+ SmallString<32> Tmp(S);
+ llvm::sys::path::make_preferred(Tmp);
+ S.assign(Tmp.data(), Tmp.size());
+ };
+ for (auto &p : *Mappings) {
+ Canonicalize(p.first);
+ Canonicalize(p.second);
+
+ auto Result = HeaderMapping->insert(p);
+ assert(Result.second); // No duplicates.
+ }
+ return HeaderMapping;
+}
+
} // namespace
void CanonicalIncludes::addMapping(FileEntryRef Header,
@@ -109,677 +775,23 @@
// FIXME: remove the std header mapping once we support ambiguous symbols, now
// it serves as a fallback to disambiguate:
// - symbols with multiple headers (e.g. std::move)
- static const auto *SystemHeaderMap = new llvm::StringMap<llvm::StringRef>({
- {"include/__stddef_max_align_t.h", "<cstddef>"},
- {"include/__wmmintrin_aes.h", "<wmmintrin.h>"},
- {"include/__wmmintrin_pclmul.h", "<wmmintrin.h>"},
- {"include/adxintrin.h", "<immintrin.h>"},
- {"include/ammintrin.h", "<ammintrin.h>"},
- {"include/avx2intrin.h", "<immintrin.h>"},
- {"include/avx512bwintrin.h", "<immintrin.h>"},
- {"include/avx512cdintrin.h", "<immintrin.h>"},
- {"include/avx512dqintrin.h", "<immintrin.h>"},
- {"include/avx512erintrin.h", "<immintrin.h>"},
- {"include/avx512fintrin.h", "<immintrin.h>"},
- {"include/avx512ifmaintrin.h", "<immintrin.h>"},
- {"include/avx512ifmavlintrin.h", "<immintrin.h>"},
- {"include/avx512pfintrin.h", "<immintrin.h>"},
- {"include/avx512vbmiintrin.h", "<immintrin.h>"},
- {"include/avx512vbmivlintrin.h", "<immintrin.h>"},
- {"include/avx512vlbwintrin.h", "<immintrin.h>"},
- {"include/avx512vlcdintrin.h", "<immintrin.h>"},
- {"include/avx512vldqintrin.h", "<immintrin.h>"},
- {"include/avx512vlintrin.h", "<immintrin.h>"},
- {"include/avxintrin.h", "<immintrin.h>"},
- {"include/bmi2intrin.h", "<x86intrin.h>"},
- {"include/bmiintrin.h", "<x86intrin.h>"},
- {"include/emmintrin.h", "<emmintrin.h>"},
- {"include/f16cintrin.h", "<emmintrin.h>"},
- {"include/float.h", "<cfloat>"},
- {"include/fma4intrin.h", "<x86intrin.h>"},
- {"include/fmaintrin.h", "<immintrin.h>"},
- {"include/fxsrintrin.h", "<immintrin.h>"},
- {"include/ia32intrin.h", "<x86intrin.h>"},
- {"include/immintrin.h", "<immintrin.h>"},
- {"include/inttypes.h", "<cinttypes>"},
- {"include/limits.h", "<climits>"},
- {"include/lzcntintrin.h", "<x86intrin.h>"},
- {"include/mm3dnow.h", "<mm3dnow.h>"},
- {"include/mm_malloc.h", "<mm_malloc.h>"},
- {"include/mmintrin.h", "<mmintrin>"},
- {"include/mwaitxintrin.h", "<x86intrin.h>"},
- {"include/pkuintrin.h", "<immintrin.h>"},
- {"include/pmmintrin.h", "<pmmintrin.h>"},
- {"include/popcntintrin.h", "<popcntintrin.h>"},
- {"include/prfchwintrin.h", "<x86intrin.h>"},
- {"include/rdseedintrin.h", "<x86intrin.h>"},
- {"include/rtmintrin.h", "<immintrin.h>"},
- {"include/shaintrin.h", "<immintrin.h>"},
- {"include/smmintrin.h", "<smmintrin.h>"},
- {"include/stdalign.h", "<cstdalign>"},
- {"include/stdarg.h", "<cstdarg>"},
- {"include/stdbool.h", "<cstdbool>"},
- {"include/stddef.h", "<cstddef>"},
- {"include/stdint.h", "<cstdint>"},
- {"include/tbmintrin.h", "<x86intrin.h>"},
- {"include/tmmintrin.h", "<tmmintrin.h>"},
- {"include/wmmintrin.h", "<wmmintrin.h>"},
- {"include/x86intrin.h", "<x86intrin.h>"},
- {"include/xmmintrin.h", "<xmmintrin.h>"},
- {"include/xopintrin.h", "<x86intrin.h>"},
- {"include/xsavecintrin.h", "<immintrin.h>"},
- {"include/xsaveintrin.h", "<immintrin.h>"},
- {"include/xsaveoptintrin.h", "<immintrin.h>"},
- {"include/xsavesintrin.h", "<immintrin.h>"},
- {"include/xtestintrin.h", "<immintrin.h>"},
- {"include/_G_config.h", "<cstdio>"},
- {"include/assert.h", "<cassert>"},
- {"algorithm", "<algorithm>"},
- {"valarray", "<valarray>"},
- {"array", "<array>"},
- {"atomic", "<atomic>"},
- {"backward/auto_ptr.h", "<memory>"},
- {"backward/binders.h", "<string>"},
- {"bits/algorithmfwd.h", "<algorithm>"},
- {"bits/alloc_traits.h", "<memory>"},
- {"bits/allocated_ptr.h", "<memory>"},
- {"bits/allocator.h", "<allocator>"},
- {"bits/atomic_base.h", "<atomic>"},
- {"bits/atomic_lockfree_defines.h", "<exception>"},
- {"bits/atomic_futex.h", "<atomic>"},
- {"bits/basic_ios.h", "<ios>"},
- {"bits/basic_ios.tcc", "<ios>"},
- {"bits/basic_string.h", "<string>"},
- {"bits/basic_string.tcc", "<string>"},
- {"bits/char_traits.h", "<string>"},
- {"bits/codecvt.h", "<locale>"},
- {"bits/concept_check.h", "<numeric>"},
- {"bits/cpp_type_traits.h", "<cmath>"},
- {"bits/cxxabi_forced.h", "<cxxabi.h>"},
- {"bits/deque.tcc", "<deque>"},
- {"bits/exception.h", "<exception>"},
- {"bits/exception_defines.h", "<exception>"},
- {"bits/exception_ptr.h", "<exception>"},
- {"bits/forward_list.h", "<forward_list>"},
- {"bits/forward_list.tcc", "<forward_list>"},
- {"bits/fstream.tcc", "<fstream>"},
- {"bits/functexcept.h", "<list>"},
- {"bits/functional_hash.h", "<functional>"},
- {"bits/gslice.h", "<valarray>"},
- {"bits/gslice_array.h", "<valarray>"},
- {"bits/hash_bytes.h", "<typeinfo>"},
- {"bits/hashtable.h", "<unordered_set>"},
- {"bits/hashtable_policy.h", "<unordered_set>"},
- {"bits/indirect_array.h", "<valarray>"},
- {"bits/invoke.h", "<functional>"},
- {"bits/ios_base.h", "<ios>"},
- {"bits/istream.tcc", "<istream>"},
- {"bits/list.tcc", "<list>"},
- {"bits/locale_classes.h", "<locale>"},
- {"bits/locale_classes.tcc", "<locale>"},
- {"bits/locale_conv.h", "<locale>"},
- {"bits/locale_facets.h", "<locale>"},
- {"bits/locale_facets.tcc", "<locale>"},
- {"bits/locale_facets_nonio.h", "<locale>"},
- {"bits/locale_facets_nonio.tcc", "<locale>"},
- {"bits/localefwd.h", "<locale>"},
- {"bits/mask_array.h", "<valarray>"},
- {"bits/memoryfwd.h", "<memory>"},
- {"bits/move.h", "<utility>"},
- {"bits/nested_exception.h", "<exception>"},
- {"bits/ostream.tcc", "<ostream>"},
- {"bits/ostream_insert.h", "<ostream>"},
- {"bits/parse_numbers.h", "<chrono>"},
- {"bits/postypes.h", "<ios>"},
- {"bits/predefined_ops.h", "<algorithm>"},
- {"bits/ptr_traits.h", "<memory>"},
- {"bits/quoted_string.h", "<iomanip>"},
- {"bits/random.h", "<random>"},
- {"bits/random.tcc", "<random>"},
- {"bits/range_access.h", "<iterator>"},
- {"bits/refwrap.h", "<functional>"},
- {"bits/regex.h", "<regex>"},
- {"bits/regex_automaton.h", "<regex>"},
- {"bits/regex_compiler.h", "<regex>"},
- {"bits/regex_constants.h", "<regex>"},
- {"bits/regex_cursor.h", "<regex>"},
- {"bits/regex_error.h", "<regex>"},
- {"bits/regex_executor.h", "<regex>"},
- {"bits/regex_grep_matcher.h", "<regex>"},
- {"bits/regex_grep_matcher.tcc", "<regex>"},
- {"bits/regex_nfa.h", "<regex>"},
- {"bits/regex_scanner.h", "<regex>"},
- {"bits/shared_ptr.h", "<memory>"},
- {"bits/shared_ptr_base.h", "<memory>"},
- {"bits/shared_ptr_atomic.h", "<atomic>"},
- {"bits/slice_array.h", "<valarray>"},
- {"bits/sstream.tcc", "<sstream>"},
- {"bits/std_abs.h", "<cmath>"},
- {"bits/std_function.h", "<functional>"},
- {"bits/std_mutex.h", "<mutex>"},
- {"bits/stl_algo.h", "<algorithm>"},
- {"bits/stl_algobase.h", "<algorithm>"},
- {"bits/stl_bvector.h", "<vector>"},
- {"bits/stl_construct.h", "<deque>"},
- {"bits/stl_deque.h", "<deque>"},
- {"bits/stl_function.h", "<functional>"},
- {"bits/stl_heap.h", "<heap>"},
- {"bits/stl_iterator.h", "<iterator>"},
- {"bits/stl_iterator_base_funcs.h", "<iterator>"},
- {"bits/stl_iterator_base_types.h", "<iterator>"},
- {"bits/stl_list.h", "<list>"},
- {"bits/stl_map.h", "<map>"},
- {"bits/stl_multimap.h", "<map>"},
- {"bits/stl_multiset.h", "<set>"},
- {"bits/stl_numeric.h", "<numeric>"},
- {"bits/stl_pair.h", "<utility>"},
- {"bits/stl_queue.h", "<queue>"},
- {"bits/stl_raw_storage_iter.h", "<memory>"},
- {"bits/stl_relops.h", "<utility>"},
- {"bits/stl_set.h", "<set>"},
- {"bits/stl_stack.h", "<stack>"},
- {"bits/stl_tempbuf.h", "<memory>"},
- {"bits/stl_tree.h", "<map>"},
- {"bits/stl_uninitialized.h", "<memory>"},
- {"bits/stl_vector.h", "<vector>"},
- {"bits/stream_iterator.h", "<iterator>"},
- {"bits/streambuf.tcc", "<streambuf>"},
- {"bits/streambuf_iterator.h", "<iterator>"},
- {"bits/stringfwd.h", "<string>"},
- {"bits/uniform_int_dist.h", "<random>"},
- {"bits/unique_ptr.h", "<memory>"},
- {"bits/unordered_map.h", "<unordered_map>"},
- {"bits/unordered_set.h", "<unordered_set>"},
- {"bits/uses_allocator.h", "<memory>"},
- {"bits/valarray_after.h", "<valarray>"},
- {"bits/valarray_array.h", "<valarray>"},
- {"bits/valarray_array.tcc", "<valarray>"},
- {"bits/valarray_before.h", "<valarray>"},
- {"bits/vector.tcc", "<vector>"},
- {"bitset", "<bitset>"},
- {"ccomplex", "<ccomplex>"},
- {"cctype", "<cctype>"},
- {"cerrno", "<cerrno>"},
- {"cfenv", "<cfenv>"},
- {"cfloat", "<cfloat>"},
- {"chrono", "<chrono>"},
- {"cinttypes", "<cinttypes>"},
- {"climits", "<climits>"},
- {"clocale", "<clocale>"},
- {"cmath", "<cmath>"},
- {"complex", "<complex>"},
- {"complex.h", "<complex.h>"},
- {"condition_variable", "<condition_variable>"},
- {"csetjmp", "<csetjmp>"},
- {"csignal", "<csignal>"},
- {"cstdalign", "<cstdalign>"},
- {"cstdarg", "<cstdarg>"},
- {"cstdbool", "<cstdbool>"},
- {"cstdint", "<cstdint>"},
- {"cstdio", "<cstdio>"},
- {"cstdlib", "<cstdlib>"},
- {"cstring", "<cstring>"},
- {"ctgmath", "<ctgmath>"},
- {"ctime", "<ctime>"},
- {"cwchar", "<cwchar>"},
- {"cwctype", "<cwctype>"},
- {"cxxabi.h", "<cxxabi.h>"},
- {"debug/debug.h", "<numeric>"},
- {"debug/map.h", "<map>"},
- {"debug/multimap.h", "<multimap>"},
- {"debug/multiset.h", "<multiset>"},
- {"debug/set.h", "<set>"},
- {"deque", "<deque>"},
- {"exception", "<exception>"},
- {"ext/alloc_traits.h", "<deque>"},
- {"ext/atomicity.h", "<memory>"},
- {"ext/concurrence.h", "<memory>"},
- {"ext/new_allocator.h", "<string>"},
- {"ext/numeric_traits.h", "<list>"},
- {"ext/string_conversions.h", "<string>"},
- {"ext/type_traits.h", "<cmath>"},
- {"fenv.h", "<fenv.h>"},
- {"forward_list", "<forward_list>"},
- {"fstream", "<fstream>"},
- {"functional", "<functional>"},
- {"future", "<future>"},
- {"initializer_list", "<initializer_list>"},
- {"iomanip", "<iomanip>"},
- {"ios", "<ios>"},
- {"iosfwd", "<iosfwd>"},
- {"iostream", "<iostream>"},
- {"istream", "<istream>"},
- {"iterator", "<iterator>"},
- {"limits", "<limits>"},
- {"list", "<list>"},
- {"locale", "<locale>"},
- {"map", "<map>"},
- {"memory", "<memory>"},
- {"shared_mutex", "<shared_mutex>"},
- {"mutex", "<mutex>"},
- {"new", "<new>"},
- {"numeric", "<numeric>"},
- {"ostream", "<ostream>"},
- {"queue", "<queue>"},
- {"random", "<random>"},
- {"ratio", "<ratio>"},
- {"regex", "<regex>"},
- {"scoped_allocator", "<scoped_allocator>"},
- {"set", "<set>"},
- {"sstream", "<sstream>"},
- {"stack", "<stack>"},
- {"stdexcept", "<stdexcept>"},
- {"streambuf", "<streambuf>"},
- {"string", "<string>"},
- {"system_error", "<system_error>"},
- {"tgmath.h", "<tgmath.h>"},
- {"thread", "<thread>"},
- {"tuple", "<tuple>"},
- {"type_traits", "<type_traits>"},
- {"typeindex", "<typeindex>"},
- {"typeinfo", "<typeinfo>"},
- {"unordered_map", "<unordered_map>"},
- {"unordered_set", "<unordered_set>"},
- {"utility", "<utility>"},
- {"valarray", "<valarray>"},
- {"vector", "<vector>"},
- {"include/complex.h", "<complex.h>"},
- {"include/ctype.h", "<cctype>"},
- {"include/errno.h", "<cerrno>"},
- {"include/fenv.h", "<fenv.h>"},
- {"include/inttypes.h", "<cinttypes>"},
- {"include/libio.h", "<cstdio>"},
- {"include/limits.h", "<climits>"},
- {"include/locale.h", "<clocale>"},
- {"include/math.h", "<cmath>"},
- {"include/setjmp.h", "<csetjmp>"},
- {"include/signal.h", "<csignal>"},
- {"include/stdint.h", "<cstdint>"},
- {"include/stdio.h", "<cstdio>"},
- {"include/stdlib.h", "<cstdlib>"},
- {"include/string.h", "<cstring>"},
- {"include/time.h", "<ctime>"},
- {"include/wchar.h", "<cwchar>"},
- {"include/wctype.h", "<cwctype>"},
- {"bits/cmathcalls.h", "<complex.h>"},
- {"bits/errno.h", "<cerrno>"},
- {"bits/fenv.h", "<fenv.h>"},
- {"bits/huge_val.h", "<cmath>"},
- {"bits/huge_valf.h", "<cmath>"},
- {"bits/huge_vall.h", "<cmath>"},
- {"bits/inf.h", "<cmath>"},
- {"bits/local_lim.h", "<climits>"},
- {"bits/locale.h", "<clocale>"},
- {"bits/mathcalls.h", "<math.h>"},
- {"bits/mathdef.h", "<cmath>"},
- {"bits/nan.h", "<cmath>"},
- {"bits/posix1_lim.h", "<climits>"},
- {"bits/posix2_lim.h", "<climits>"},
- {"bits/setjmp.h", "<csetjmp>"},
- {"bits/sigaction.h", "<csignal>"},
- {"bits/sigcontext.h", "<csignal>"},
- {"bits/siginfo.h", "<csignal>"},
- {"bits/signum.h", "<csignal>"},
- {"bits/sigset.h", "<csignal>"},
- {"bits/sigstack.h", "<csignal>"},
- {"bits/stdint-intn.h", "<cstdint>"},
- {"bits/stdint-uintn.h", "<cstdint>"},
- {"bits/stdio_lim.h", "<cstdio>"},
- {"bits/sys_errlist.h", "<cstdio>"},
- {"bits/time.h", "<ctime>"},
- {"bits/timex.h", "<ctime>"},
- {"bits/typesizes.h", "<cstdio>"},
- {"bits/wchar.h", "<cwchar>"},
- {"bits/wordsize.h", "<csetjmp>"},
- {"bits/xopen_lim.h", "<climits>"},
- {"include/xlocale.h", "<cstring>"},
- {"bits/atomic_word.h", "<memory>"},
- {"bits/basic_file.h", "<fstream>"},
- {"bits/c\\+\\+allocator.h", "<string>"},
- {"bits/c\\+\\+config.h", "<cstddef>"},
- {"bits/c\\+\\+io.h", "<ios>"},
- {"bits/c\\+\\+locale.h", "<locale>"},
- {"bits/cpu_defines.h", "<iosfwd>"},
- {"bits/ctype_base.h", "<locale>"},
- {"bits/cxxabi_tweaks.h", "<cxxabi.h>"},
- {"bits/error_constants.h", "<system_error>"},
- {"bits/gthr-default.h", "<memory>"},
- {"bits/gthr.h", "<memory>"},
- {"bits/opt_random.h", "<random>"},
- {"bits/os_defines.h", "<iosfwd>"},
- // GNU C headers
- {"include/aio.h", "<aio.h>"},
- {"include/aliases.h", "<aliases.h>"},
- {"include/alloca.h", "<alloca.h>"},
- {"include/ar.h", "<ar.h>"},
- {"include/argp.h", "<argp.h>"},
- {"include/argz.h", "<argz.h>"},
- {"include/arpa/nameser.h", "<resolv.h>"},
- {"include/arpa/nameser_compat.h", "<resolv.h>"},
- {"include/byteswap.h", "<byteswap.h>"},
- {"include/cpio.h", "<cpio.h>"},
- {"include/crypt.h", "<crypt.h>"},
- {"include/dirent.h", "<dirent.h>"},
- {"include/dlfcn.h", "<dlfcn.h>"},
- {"include/elf.h", "<elf.h>"},
- {"include/endian.h", "<endian.h>"},
- {"include/envz.h", "<envz.h>"},
- {"include/err.h", "<err.h>"},
- {"include/error.h", "<error.h>"},
- {"include/execinfo.h", "<execinfo.h>"},
- {"include/fcntl.h", "<fcntl.h>"},
- {"include/features.h", "<features.h>"},
- {"include/fenv.h", "<fenv.h>"},
- {"include/fmtmsg.h", "<fmtmsg.h>"},
- {"include/fnmatch.h", "<fnmatch.h>"},
- {"include/fstab.h", "<fstab.h>"},
- {"include/fts.h", "<fts.h>"},
- {"include/ftw.h", "<ftw.h>"},
- {"include/gconv.h", "<gconv.h>"},
- {"include/getopt.h", "<getopt.h>"},
- {"include/glob.h", "<glob.h>"},
- {"include/grp.h", "<grp.h>"},
- {"include/gshadow.h", "<gshadow.h>"},
- {"include/iconv.h", "<iconv.h>"},
- {"include/ifaddrs.h", "<ifaddrs.h>"},
- {"include/kdb.h", "<kdb.h>"},
- {"include/langinfo.h", "<langinfo.h>"},
- {"include/libgen.h", "<libgen.h>"},
- {"include/libintl.h", "<libintl.h>"},
- {"include/link.h", "<link.h>"},
- {"include/malloc.h", "<malloc.h>"},
- {"include/mcheck.h", "<mcheck.h>"},
- {"include/memory.h", "<memory.h>"},
- {"include/mntent.h", "<mntent.h>"},
- {"include/monetary.h", "<monetary.h>"},
- {"include/mqueue.h", "<mqueue.h>"},
- {"include/netdb.h", "<netdb.h>"},
- {"include/netinet/in.h", "<netinet/in.h>"},
- {"include/nl_types.h", "<nl_types.h>"},
- {"include/nss.h", "<nss.h>"},
- {"include/obstack.h", "<obstack.h>"},
- {"include/panel.h", "<panel.h>"},
- {"include/paths.h", "<paths.h>"},
- {"include/printf.h", "<printf.h>"},
- {"include/profile.h", "<profile.h>"},
- {"include/pthread.h", "<pthread.h>"},
- {"include/pty.h", "<pty.h>"},
- {"include/pwd.h", "<pwd.h>"},
- {"include/re_comp.h", "<re_comp.h>"},
- {"include/regex.h", "<regex.h>"},
- {"include/regexp.h", "<regexp.h>"},
- {"include/resolv.h", "<resolv.h>"},
- {"include/rpc/netdb.h", "<netdb.h>"},
- {"include/sched.h", "<sched.h>"},
- {"include/search.h", "<search.h>"},
- {"include/semaphore.h", "<semaphore.h>"},
- {"include/sgtty.h", "<sgtty.h>"},
- {"include/shadow.h", "<shadow.h>"},
- {"include/spawn.h", "<spawn.h>"},
- {"include/stab.h", "<stab.h>"},
- {"include/stdc-predef.h", "<stdc-predef.h>"},
- {"include/stdio_ext.h", "<stdio_ext.h>"},
- {"include/strings.h", "<strings.h>"},
- {"include/stropts.h", "<stropts.h>"},
- {"include/sudo_plugin.h", "<sudo_plugin.h>"},
- {"include/sysexits.h", "<sysexits.h>"},
- {"include/tar.h", "<tar.h>"},
- {"include/tcpd.h", "<tcpd.h>"},
- {"include/term.h", "<term.h>"},
- {"include/term_entry.h", "<term_entry.h>"},
- {"include/termcap.h", "<termcap.h>"},
- {"include/termios.h", "<termios.h>"},
- {"include/thread_db.h", "<thread_db.h>"},
- {"include/tic.h", "<tic.h>"},
- {"include/ttyent.h", "<ttyent.h>"},
- {"include/uchar.h", "<uchar.h>"},
- {"include/ucontext.h", "<ucontext.h>"},
- {"include/ulimit.h", "<ulimit.h>"},
- {"include/unctrl.h", "<unctrl.h>"},
- {"include/unistd.h", "<unistd.h>"},
- {"include/utime.h", "<utime.h>"},
- {"include/utmp.h", "<utmp.h>"},
- {"include/utmpx.h", "<utmpx.h>"},
- {"include/values.h", "<values.h>"},
- {"include/wordexp.h", "<wordexp.h>"},
- {"fpu_control.h", "<fpu_control.h>"},
- {"ieee754.h", "<ieee754.h>"},
- {"include/xlocale.h", "<xlocale.h>"},
- {"gnu/lib-names.h", "<gnu/lib-names.h>"},
- {"gnu/libc-version.h", "<gnu/libc-version.h>"},
- {"gnu/option-groups.h", "<gnu/option-groups.h>"},
- {"gnu/stubs-32.h", "<gnu/stubs-32.h>"},
- {"gnu/stubs-64.h", "<gnu/stubs-64.h>"},
- {"gnu/stubs-x32.h", "<gnu/stubs-x32.h>"},
- {"include/rpc/auth_des.h", "<rpc/auth_des.h>"},
- {"include/rpc/rpc_msg.h", "<rpc/rpc_msg.h>"},
- {"include/rpc/pmap_clnt.h", "<rpc/pmap_clnt.h>"},
- {"include/rpc/rpc.h", "<rpc/rpc.h>"},
- {"include/rpc/types.h", "<rpc/types.h>"},
- {"include/rpc/auth_unix.h", "<rpc/auth_unix.h>"},
- {"include/rpc/key_prot.h", "<rpc/key_prot.h>"},
- {"include/rpc/pmap_prot.h", "<rpc/pmap_prot.h>"},
- {"include/rpc/auth.h", "<rpc/auth.h>"},
- {"include/rpc/svc_auth.h", "<rpc/svc_auth.h>"},
- {"include/rpc/xdr.h", "<rpc/xdr.h>"},
- {"include/rpc/pmap_rmt.h", "<rpc/pmap_rmt.h>"},
- {"include/rpc/des_crypt.h", "<rpc/des_crypt.h>"},
- {"include/rpc/svc.h", "<rpc/svc.h>"},
- {"include/rpc/rpc_des.h", "<rpc/rpc_des.h>"},
- {"include/rpc/clnt.h", "<rpc/clnt.h>"},
- {"include/scsi/scsi.h", "<scsi/scsi.h>"},
- {"include/scsi/sg.h", "<scsi/sg.h>"},
- {"include/scsi/scsi_ioctl.h", "<scsi/scsi_ioctl>"},
- {"include/netrose/rose.h", "<netrose/rose.h>"},
- {"include/nfs/nfs.h", "<nfs/nfs.h>"},
- {"include/netatalk/at.h", "<netatalk/at.h>"},
- {"include/netinet/ether.h", "<netinet/ether.h>"},
- {"include/netinet/icmp6.h", "<netinet/icmp6.h>"},
- {"include/netinet/if_ether.h", "<netinet/if_ether.h>"},
- {"include/netinet/if_fddi.h", "<netinet/if_fddi.h>"},
- {"include/netinet/if_tr.h", "<netinet/if_tr.h>"},
- {"include/netinet/igmp.h", "<netinet/igmp.h>"},
- {"include/netinet/in.h", "<netinet/in.h>"},
- {"include/netinet/in_systm.h", "<netinet/in_systm.h>"},
- {"include/netinet/ip.h", "<netinet/ip.h>"},
- {"include/netinet/ip6.h", "<netinet/ip6.h>"},
- {"include/netinet/ip_icmp.h", "<netinet/ip_icmp.h>"},
- {"include/netinet/tcp.h", "<netinet/tcp.h>"},
- {"include/netinet/udp.h", "<netinet/udp.h>"},
- {"include/netrom/netrom.h", "<netrom/netrom.h>"},
- {"include/protocols/routed.h", "<protocols/routed.h>"},
- {"include/protocols/rwhod.h", "<protocols/rwhod.h>"},
- {"include/protocols/talkd.h", "<protocols/talkd.h>"},
- {"include/protocols/timed.h", "<protocols/timed.h>"},
- {"include/rpcsvc/klm_prot.x", "<rpcsvc/klm_prot.x>"},
- {"include/rpcsvc/rstat.h", "<rpcsvc/rstat.h>"},
- {"include/rpcsvc/spray.x", "<rpcsvc/spray.x>"},
- {"include/rpcsvc/nlm_prot.x", "<rpcsvc/nlm_prot.x>"},
- {"include/rpcsvc/nis_callback.x", "<rpcsvc/nis_callback.x>"},
- {"include/rpcsvc/yp.h", "<rpcsvc/yp.h>"},
- {"include/rpcsvc/yp.x", "<rpcsvc/yp.x>"},
- {"include/rpcsvc/nfs_prot.h", "<rpcsvc/nfs_prot.h>"},
- {"include/rpcsvc/rex.h", "<rpcsvc/rex.h>"},
- {"include/rpcsvc/yppasswd.h", "<rpcsvc/yppasswd.h>"},
- {"include/rpcsvc/rex.x", "<rpcsvc/rex.x>"},
- {"include/rpcsvc/nis_tags.h", "<rpcsvc/nis_tags.h>"},
- {"include/rpcsvc/nis_callback.h", "<rpcsvc/nis_callback.h>"},
- {"include/rpcsvc/nfs_prot.x", "<rpcsvc/nfs_prot.x>"},
- {"include/rpcsvc/bootparam_prot.x", "<rpcsvc/bootparam_prot.x>"},
- {"include/rpcsvc/rusers.x", "<rpcsvc/rusers.x>"},
- {"include/rpcsvc/rquota.x", "<rpcsvc/rquota.x>"},
- {"include/rpcsvc/nis.h", "<rpcsvc/nis.h>"},
- {"include/rpcsvc/nislib.h", "<rpcsvc/nislib.h>"},
- {"include/rpcsvc/ypupd.h", "<rpcsvc/ypupd.h>"},
- {"include/rpcsvc/bootparam.h", "<rpcsvc/bootparam.h>"},
- {"include/rpcsvc/spray.h", "<rpcsvc/spray.h>"},
- {"include/rpcsvc/key_prot.h", "<rpcsvc/key_prot.h>"},
- {"include/rpcsvc/klm_prot.h", "<rpcsvc/klm_prot.h>"},
- {"include/rpcsvc/sm_inter.h", "<rpcsvc/sm_inter.h>"},
- {"include/rpcsvc/nlm_prot.h", "<rpcsvc/nlm_prot.h>"},
- {"include/rpcsvc/yp_prot.h", "<rpcsvc/yp_prot.h>"},
- {"include/rpcsvc/ypclnt.h", "<rpcsvc/ypclnt.h>"},
- {"include/rpcsvc/rstat.x", "<rpcsvc/rstat.x>"},
- {"include/rpcsvc/rusers.h", "<rpcsvc/rusers.h>"},
- {"include/rpcsvc/key_prot.x", "<rpcsvc/key_prot.x>"},
- {"include/rpcsvc/sm_inter.x", "<rpcsvc/sm_inter.x>"},
- {"include/rpcsvc/rquota.h", "<rpcsvc/rquota.h>"},
- {"include/rpcsvc/nis.x", "<rpcsvc/nis.x>"},
- {"include/rpcsvc/bootparam_prot.h", "<rpcsvc/bootparam_prot.h>"},
- {"include/rpcsvc/mount.h", "<rpcsvc/mount.h>"},
- {"include/rpcsvc/mount.x", "<rpcsvc/mount.x>"},
- {"include/rpcsvc/nis_object.x", "<rpcsvc/nis_object.x>"},
- {"include/rpcsvc/yppasswd.x", "<rpcsvc/yppasswd.x>"},
- {"sys/acct.h", "<sys/acct.h>"},
- {"sys/auxv.h", "<sys/auxv.h>"},
- {"sys/cdefs.h", "<sys/cdefs.h>"},
- {"sys/debugreg.h", "<sys/debugreg.h>"},
- {"sys/dir.h", "<sys/dir.h>"},
- {"sys/elf.h", "<sys/elf.h>"},
- {"sys/epoll.h", "<sys/epoll.h>"},
- {"sys/eventfd.h", "<sys/eventfd.h>"},
- {"sys/fanotify.h", "<sys/fanotify.h>"},
- {"sys/file.h", "<sys/file.h>"},
- {"sys/fsuid.h", "<sys/fsuid.h>"},
- {"sys/gmon.h", "<sys/gmon.h>"},
- {"sys/gmon_out.h", "<sys/gmon_out.h>"},
- {"sys/inotify.h", "<sys/inotify.h>"},
- {"sys/io.h", "<sys/io.h>"},
- {"sys/ioctl.h", "<sys/ioctl.h>"},
- {"sys/ipc.h", "<sys/ipc.h>"},
- {"sys/kd.h", "<sys/kd.h>"},
- {"sys/kdaemon.h", "<sys/kdaemon.h>"},
- {"sys/klog.h", "<sys/klog.h>"},
- {"sys/mman.h", "<sys/mman.h>"},
- {"sys/mount.h", "<sys/mount.h>"},
- {"sys/msg.h", "<sys/msg.h>"},
- {"sys/mtio.h", "<sys/mtio.h>"},
- {"sys/param.h", "<sys/param.h>"},
- {"sys/pci.h", "<sys/pci.h>"},
- {"sys/perm.h", "<sys/perm.h>"},
- {"sys/personality.h", "<sys/personality.h>"},
- {"sys/poll.h", "<sys/poll.h>"},
- {"sys/prctl.h", "<sys/prctl.h>"},
- {"sys/procfs.h", "<sys/procfs.h>"},
- {"sys/profil.h", "<sys/profil.h>"},
- {"sys/ptrace.h", "<sys/ptrace.h>"},
- {"sys/queue.h", "<sys/queue.h>"},
- {"sys/quota.h", "<sys/quota.h>"},
- {"sys/raw.h", "<sys/raw.h>"},
- {"sys/reboot.h", "<sys/reboot.h>"},
- {"sys/reg.h", "<sys/reg.h>"},
- {"sys/resource.h", "<sys/resource.h>"},
- {"sys/select.h", "<sys/select.h>"},
- {"sys/sem.h", "<sys/sem.h>"},
- {"sys/sendfile.h", "<sys/sendfile.h>"},
- {"sys/shm.h", "<sys/shm.h>"},
- {"sys/signalfd.h", "<sys/signalfd.h>"},
- {"sys/socket.h", "<sys/socket.h>"},
- {"sys/stat.h", "<sys/stat.h>"},
- {"sys/statfs.h", "<sys/statfs.h>"},
- {"sys/statvfs.h", "<sys/statvfs.h>"},
- {"sys/swap.h", "<sys/swap.h>"},
- {"sys/syscall.h", "<sys/syscall.h>"},
- {"sys/sysctl.h", "<sys/sysctl.h>"},
- {"sys/sysinfo.h", "<sys/sysinfo.h>"},
- {"sys/syslog.h", "<sys/syslog.h>"},
- {"sys/sysmacros.h", "<sys/sysmacros.h>"},
- {"sys/termios.h", "<sys/termios.h>"},
- {"sys/time.h", "<sys/select.h>"},
- {"sys/timeb.h", "<sys/timeb.h>"},
- {"sys/timerfd.h", "<sys/timerfd.h>"},
- {"sys/times.h", "<sys/times.h>"},
- {"sys/timex.h", "<sys/timex.h>"},
- {"sys/ttychars.h", "<sys/ttychars.h>"},
- {"sys/ttydefaults.h", "<sys/ttydefaults.h>"},
- {"sys/types.h", "<sys/types.h>"},
- {"sys/ucontext.h", "<sys/ucontext.h>"},
- {"sys/uio.h", "<sys/uio.h>"},
- {"sys/un.h", "<sys/un.h>"},
- {"sys/user.h", "<sys/user.h>"},
- {"sys/ustat.h", "<sys/ustat.h>"},
- {"sys/utsname.h", "<sys/utsname.h>"},
- {"sys/vlimit.h", "<sys/vlimit.h>"},
- {"sys/vm86.h", "<sys/vm86.h>"},
- {"sys/vtimes.h", "<sys/vtimes.h>"},
- {"sys/wait.h", "<sys/wait.h>"},
- {"sys/xattr.h", "<sys/xattr.h>"},
- {"bits/epoll.h", "<sys/epoll.h>"},
- {"bits/eventfd.h", "<sys/eventfd.h>"},
- {"bits/inotify.h", "<sys/inotify.h>"},
- {"bits/ipc.h", "<sys/ipc.h>"},
- {"bits/ipctypes.h", "<sys/ipc.h>"},
- {"bits/mman-linux.h", "<sys/mman.h>"},
- {"bits/mman.h", "<sys/mman.h>"},
- {"bits/msq.h", "<sys/msg.h>"},
- {"bits/resource.h", "<sys/resource.h>"},
- {"bits/sem.h", "<sys/sem.h>"},
- {"bits/shm.h", "<sys/shm.h>"},
- {"bits/signalfd.h", "<sys/signalfd.h>"},
- {"bits/statfs.h", "<sys/statfs.h>"},
- {"bits/statvfs.h", "<sys/statvfs.h>"},
- {"bits/timerfd.h", "<sys/timerfd.h>"},
- {"bits/utsname.h", "<sys/utsname.h>"},
- {"bits/auxv.h", "<sys/auxv.h>"},
- {"bits/byteswap-16.h", "<byteswap.h>"},
- {"bits/byteswap.h", "<byteswap.h>"},
- {"bits/confname.h", "<unistd.h>"},
- {"bits/dirent.h", "<dirent.h>"},
- {"bits/dlfcn.h", "<dlfcn.h>"},
- {"bits/elfclass.h", "<link.h>"},
- {"bits/endian.h", "<endian.h>"},
- {"bits/environments.h", "<unistd.h>"},
- {"bits/fcntl-linux.h", "<fcntl.h>"},
- {"bits/fcntl.h", "<fcntl.h>"},
- {"bits/in.h", "<netinet/in.h>"},
- {"bits/ioctl-types.h", "<sys/ioctl.h>"},
- {"bits/ioctls.h", "<sys/ioctl.h>"},
- {"bits/link.h", "<link.h>"},
- {"bits/mqueue.h", "<mqueue.h>"},
- {"bits/netdb.h", "<netdb.h>"},
- {"bits/param.h", "<sys/param.h>"},
- {"bits/poll.h", "<sys/poll.h>"},
- {"bits/posix_opt.h", "<bits/posix_opt.h>"},
- {"bits/pthreadtypes.h", "<pthread.h>"},
- {"bits/sched.h", "<sched.h>"},
- {"bits/select.h", "<sys/select.h>"},
- {"bits/semaphore.h", "<semaphore.h>"},
- {"bits/sigthread.h", "<pthread.h>"},
- {"bits/sockaddr.h", "<sys/socket.h>"},
- {"bits/socket.h", "<sys/socket.h>"},
- {"bits/socket_type.h", "<sys/socket.h>"},
- {"bits/stab.def", "<stab.h>"},
- {"bits/stat.h", "<sys/stat.h>"},
- {"bits/stropts.h", "<stropts.h>"},
- {"bits/syscall.h", "<sys/syscall.h>"},
- {"bits/syslog-path.h", "<sys/syslog.h>"},
- {"bits/termios.h", "<termios.h>"},
- {"bits/types.h", "<sys/types.h>"},
- {"bits/typesizes.h", "<sys/types.h>"},
- {"bits/uio.h", "<sys/uio.h>"},
- {"bits/ustat.h", "<sys/ustat.h>"},
- {"bits/utmp.h", "<utmp.h>"},
- {"bits/utmpx.h", "<utmpx.h>"},
- {"bits/waitflags.h", "<sys/wait.h>"},
- {"bits/waitstatus.h", "<sys/wait.h>"},
- {"bits/xtitypes.h", "<stropts.h>"},
- });
+ static const auto *SystemHeaderMap = GetHeaderMapping();
+
// Check MaxSuffixComponents constant is correct.
assert(llvm::all_of(SystemHeaderMap->keys(), [](llvm::StringRef Path) {
return std::distance(
- llvm::sys::path::begin(Path, llvm::sys::path::Style::posix),
+ llvm::sys::path::begin(Path, llvm::sys::path::Style::native),
llvm::sys::path::end(Path)) <= MaxSuffixComponents;
}));
// ... and precise.
assert(llvm::find_if(SystemHeaderMap->keys(), [](llvm::StringRef Path) {
return std::distance(llvm::sys::path::begin(
- Path, llvm::sys::path::Style::posix),
+ Path, llvm::sys::path::Style::native),
llvm::sys::path::end(Path)) ==
MaxSuffixComponents;
}) != SystemHeaderMap->keys().end());
- // FIXME: Suffix mapping contains invalid entries for C, so only enable it for
- // CPP.
+ // Suffix mapping contains invalid entries for C, so only enable it for CPP.
if (Language.CPlusPlus)
StdSuffixHeaderMapping = SystemHeaderMap;
}
Index: clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
+++ clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
@@ -61,6 +61,8 @@
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
SmallString<128> CompilerIncudeDir =
StringRef(PP->getHeaderSearchInfo().getHeaderSearchOpts().ResourceDir);
+ // Canonicalize the path since we will compare to it later.
+ llvm::sys::path::remove_dots(CompilerIncudeDir);
llvm::sys::path::append(CompilerIncudeDir, "include");
PP->addPPCallbacks(std::make_unique<RestrictedIncludesPPCallbacks>(
*this, SM, CompilerIncudeDir));
Index: clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
+++ clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
@@ -67,7 +67,9 @@
// recent enough version of Google Test.
llvm::StringRef FileName = PP->getSourceManager().getFilename(
MD->getMacroInfo()->getDefinitionLoc());
- ReplacementFound = FileName.endswith("gtest/gtest-typed-test.h") &&
+ SmallString<32> TypedTestFileName("gtest/gtest-typed-test.h");
+ llvm::sys::path::make_preferred(TypedTestFileName);
+ ReplacementFound = FileName.endswith(TypedTestFileName) &&
PP->getSpelling(MacroNameTok) == "TYPED_TEST_SUITE";
}
}
@@ -103,7 +105,9 @@
llvm::StringRef FileName = PP->getSourceManager().getFilename(
MD.getMacroInfo()->getDefinitionLoc());
- if (!FileName.endswith("gtest/gtest-typed-test.h"))
+ SmallString<32> TypedTestFileName("gtest/gtest-typed-test.h");
+ llvm::sys::path::make_preferred(TypedTestFileName);
+ if (!FileName.endswith(TypedTestFileName))
return;
DiagnosticBuilder Diag = Check->diag(Loc, RenameCaseToSuiteMessage);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits