Skip to content

Commit 4dee192

Browse files
authored
LLVM and SPIRV-LLVM-Translator pulldown
LLVM: 67121d7 LLVM-SPIRV-Translator: KhronosGroup/SPIRV-LLVM-Translator@f8b112a
2 parents 49b6223 + 3a2ec88 commit 4dee192

File tree

2,654 files changed

+98143
-46473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,654 files changed

+98143
-46473
lines changed

clang-tools-extra/clang-apply-replacements/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ set(LLVM_LINK_COMPONENTS
44

55
add_clang_library(clangApplyReplacements
66
lib/Tooling/ApplyReplacements.cpp
7+
)
78

8-
LINK_LIBS
9+
clang_target_link_libraries(clangApplyReplacements
10+
PRIVATE
911
clangAST
1012
clangBasic
1113
clangRewrite

clang-tools-extra/clang-change-namespace/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ set(LLVM_LINK_COMPONENTS
55

66
add_clang_library(clangChangeNamespace
77
ChangeNamespace.cpp
8+
)
89

9-
LINK_LIBS
10+
clang_target_link_libraries(clangChangeNamespace
11+
PRIVATE
1012
clangAST
1113
clangASTMatchers
1214
clangBasic

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ bool isTemplateParameter(TypeLoc Type) {
347347

348348
ChangeNamespaceTool::ChangeNamespaceTool(
349349
llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef FilePattern,
350-
llvm::ArrayRef<std::string> WhiteListedSymbolPatterns,
350+
llvm::ArrayRef<std::string> AllowedSymbolPatterns,
351351
std::map<std::string, tooling::Replacements> *FileToReplacements,
352352
llvm::StringRef FallbackStyle)
353353
: FallbackStyle(FallbackStyle), FileToReplacements(*FileToReplacements),
@@ -365,8 +365,8 @@ ChangeNamespaceTool::ChangeNamespaceTool(
365365
DiffOldNamespace = joinNamespaces(OldNsSplitted);
366366
DiffNewNamespace = joinNamespaces(NewNsSplitted);
367367

368-
for (const auto &Pattern : WhiteListedSymbolPatterns)
369-
WhiteListedSymbolRegexes.emplace_back(Pattern);
368+
for (const auto &Pattern : AllowedSymbolPatterns)
369+
AllowedSymbolRegexes.emplace_back(Pattern);
370370
}
371371

372372
void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
@@ -800,7 +800,7 @@ void ChangeNamespaceTool::replaceQualifiedSymbolInDeclContext(
800800
Result.SourceManager->getSpellingLoc(End)),
801801
*Result.SourceManager, Result.Context->getLangOpts());
802802
std::string FromDeclName = FromDecl->getQualifiedNameAsString();
803-
for (llvm::Regex &RE : WhiteListedSymbolRegexes)
803+
for (llvm::Regex &RE : AllowedSymbolRegexes)
804804
if (RE.match(FromDeclName))
805805
return;
806806
std::string ReplaceName =

clang-tools-extra/clang-change-namespace/ChangeNamespace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ChangeNamespaceTool : public ast_matchers::MatchFinder::MatchCallback {
4949
// files matching `FilePattern`.
5050
ChangeNamespaceTool(
5151
llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef FilePattern,
52-
llvm::ArrayRef<std::string> WhiteListedSymbolPatterns,
52+
llvm::ArrayRef<std::string> AllowedSymbolPatterns,
5353
std::map<std::string, tooling::Replacements> *FileToReplacements,
5454
llvm::StringRef FallbackStyle = "LLVM");
5555

@@ -166,7 +166,7 @@ class ChangeNamespaceTool : public ast_matchers::MatchFinder::MatchCallback {
166166
llvm::SmallPtrSet<const clang::DeclRefExpr*, 16> ProcessedFuncRefs;
167167
// Patterns of symbol names whose references are not expected to be updated
168168
// when changing namespaces around them.
169-
std::vector<llvm::Regex> WhiteListedSymbolRegexes;
169+
std::vector<llvm::Regex> AllowedSymbolRegexes;
170170
};
171171

172172
} // namespace change_namespace

clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ cl::opt<std::string> Style("style",
7272
cl::desc("The style name used for reformatting."),
7373
cl::init("LLVM"), cl::cat(ChangeNamespaceCategory));
7474

75-
cl::opt<std::string> WhiteListFile(
76-
"whitelist_file",
75+
cl::opt<std::string> AllowedFile(
76+
"allowed_file",
7777
cl::desc("A file containing regexes of symbol names that are not expected "
7878
"to be updated when changing namespaces around them."),
7979
cl::init(""), cl::cat(ChangeNamespaceCategory));
8080

81-
llvm::ErrorOr<std::vector<std::string>> GetWhiteListedSymbolPatterns() {
81+
llvm::ErrorOr<std::vector<std::string>> GetAllowedSymbolPatterns() {
8282
std::vector<std::string> Patterns;
83-
if (WhiteListFile.empty())
83+
if (AllowedFile.empty())
8484
return Patterns;
8585

8686
llvm::SmallVector<StringRef, 8> Lines;
8787
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
88-
llvm::MemoryBuffer::getFile(WhiteListFile);
88+
llvm::MemoryBuffer::getFile(AllowedFile);
8989
if (!File)
9090
return File.getError();
9191
llvm::StringRef Content = File.get()->getBuffer();
@@ -103,15 +103,15 @@ int main(int argc, const char **argv) {
103103
ChangeNamespaceCategory);
104104
const auto &Files = OptionsParser.getSourcePathList();
105105
tooling::RefactoringTool Tool(OptionsParser.getCompilations(), Files);
106-
llvm::ErrorOr<std::vector<std::string>> WhiteListPatterns =
107-
GetWhiteListedSymbolPatterns();
108-
if (!WhiteListPatterns) {
109-
llvm::errs() << "Failed to open whitelist file " << WhiteListFile << ". "
110-
<< WhiteListPatterns.getError().message() << "\n";
106+
llvm::ErrorOr<std::vector<std::string>> AllowedPatterns =
107+
GetAllowedSymbolPatterns();
108+
if (!AllowedPatterns) {
109+
llvm::errs() << "Failed to open allow file " << AllowedFile << ". "
110+
<< AllowedPatterns.getError().message() << "\n";
111111
return 1;
112112
}
113113
change_namespace::ChangeNamespaceTool NamespaceTool(
114-
OldNamespace, NewNamespace, FilePattern, *WhiteListPatterns,
114+
OldNamespace, NewNamespace, FilePattern, *AllowedPatterns,
115115
&Tool.getReplacements(), Style);
116116
ast_matchers::MatchFinder Finder;
117117
NamespaceTool.registerMatchers(&Finder);

clang-tools-extra/clang-doc/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ add_clang_library(clangDoc
1515
Representation.cpp
1616
Serialize.cpp
1717
YAMLGenerator.cpp
18+
)
1819

19-
LINK_LIBS
20+
clang_target_link_libraries(clangDoc
21+
PRIVATE
2022
clangAnalysis
2123
clangAST
2224
clangASTMatchers

clang-tools-extra/clang-doc/Generators.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ namespace doc {
1515

1616
llvm::Expected<std::unique_ptr<Generator>>
1717
findGeneratorByName(llvm::StringRef Format) {
18-
for (auto I = GeneratorRegistry::begin(), E = GeneratorRegistry::end();
19-
I != E; ++I) {
20-
if (I->getName() != Format)
18+
for (const auto &Generator : GeneratorRegistry::entries()) {
19+
if (Generator.getName() != Format)
2120
continue;
22-
return I->instantiate();
21+
return Generator.instantiate();
2322
}
2423
return createStringError(llvm::inconvertibleErrorCode(),
2524
"can't find generator: " + Format);

clang-tools-extra/clang-include-fixer/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ add_clang_library(clangIncludeFixer
1111
YamlSymbolIndex.cpp
1212

1313
LINK_LIBS
14+
findAllSymbols
15+
)
16+
17+
clang_target_link_libraries(clangIncludeFixer
18+
PRIVATE
1419
clangAST
1520
clangBasic
1621
clangFormat
@@ -21,7 +26,6 @@ add_clang_library(clangIncludeFixer
2126
clangSerialization
2227
clangTooling
2328
clangToolingCore
24-
findAllSymbols
2529
)
2630

2731
add_subdirectory(plugin)

clang-tools-extra/clang-include-fixer/find-all-symbols/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ add_clang_library(findAllSymbols
1212
PragmaCommentHandler.cpp
1313
STLPostfixHeaderMap.cpp
1414
SymbolInfo.cpp
15+
)
1516

16-
LINK_LIBS
17+
clang_target_link_libraries(findAllSymbols
18+
PRIVATE
1719
clangAST
1820
clangASTMatchers
1921
clangBasic

clang-tools-extra/clang-move/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ set(LLVM_LINK_COMPONENTS
66
add_clang_library(clangMove
77
Move.cpp
88
HelperDeclRefGraph.cpp
9+
)
910

10-
LINK_LIBS
11+
clang_target_link_libraries(clangMove
12+
PRIVATE
1113
clangAnalysis
1214
clangAST
1315
clangASTMatchers

0 commit comments

Comments
 (0)