Skip to content

Commit

Permalink
Merge from 'master' to 'sycl-web' (intel#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtoguchi committed Oct 8, 2019
2 parents 2d4f887 + c382d03 commit 2b97380
Show file tree
Hide file tree
Showing 774 changed files with 42,542 additions and 12,169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ set(LLVM_LINK_COMPONENTS
add_clang_tool(clang-apply-replacements
ClangApplyReplacementsMain.cpp
)
target_link_libraries(clang-apply-replacements
clang_target_link_libraries(clang-apply-replacements
PRIVATE
clangApplyReplacements
clangBasic
clangFormat
clangRewrite
clangToolingCore
clangToolingRefactoring
)
target_link_libraries(clang-apply-replacements
PRIVATE
clangApplyReplacements
)
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-change-namespace/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ set(LLVM_LINK_COMPONENTS
add_clang_tool(clang-change-namespace
ClangChangeNamespace.cpp
)
target_link_libraries(clang-change-namespace
clang_target_link_libraries(clang-change-namespace
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangChangeNamespace
clangFormat
clangFrontend
clangRewrite
clangSerialization
clangTooling
clangToolingCore
)
target_link_libraries(clang-change-namespace
PRIVATE
clangChangeNamespace
)
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-doc/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ add_clang_tool(clang-doc
ClangDocMain.cpp
)

target_link_libraries(clang-doc
clang_target_link_libraries(clang-doc
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangFrontend
clangDoc
clangTooling
clangToolingCore
)
target_link_libraries(clang-doc
PRIVATE
clangDoc
)

install(FILES ../assets/clang-doc-default-stylesheet.css
DESTINATION share/clang
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_clang_tool(find-all-symbols
FindAllSymbolsMain.cpp
)

target_link_libraries(find-all-symbols
clang_target_link_libraries(find-all-symbols
PRIVATE
clangAST
clangASTMatchers
Expand All @@ -13,6 +13,9 @@ target_link_libraries(find-all-symbols
clangLex
clangSerialization
clangTooling
)
target_link_libraries(find-all-symbols
PRIVATE
findAllSymbols
)

Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ add_clang_tool(clang-include-fixer
ClangIncludeFixer.cpp
)

target_link_libraries(clang-include-fixer
clang_target_link_libraries(clang-include-fixer
PRIVATE
clangBasic
clangFormat
clangFrontend
clangIncludeFixer
clangRewrite
clangSerialization
clangTooling
clangToolingCore
)
target_link_libraries(clang-include-fixer
PRIVATE
clangIncludeFixer
findAllSymbols
)

Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-move/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ add_clang_tool(clang-move
ClangMove.cpp
)

target_link_libraries(clang-move
clang_target_link_libraries(clang-move
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangFormat
clangFrontend
clangMove
clangRewrite
clangSerialization
clangTooling
clangToolingCore
)
target_link_libraries(clang-move
PRIVATE
clangMove
)
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-query/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
add_clang_tool(clang-query
ClangQuery.cpp
)
target_link_libraries(clang-query
clang_target_link_libraries(clang-query
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangDynamicASTMatchers
clangFrontend
clangQuery
clangSerialization
clangTooling
)
target_link_libraries(clang-query
PRIVATE
clangQuery
)
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-reorder-fields/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ add_clang_tool(clang-reorder-fields
ClangReorderFields.cpp
)

target_link_libraries(clang-reorder-fields
clang_target_link_libraries(clang-reorder-fields
PRIVATE
clangBasic
clangFrontend
clangReorderFields
clangRewrite
clangSerialization
clangTooling
clangToolingCore
)
target_link_libraries(clang-reorder-fields
PRIVATE
clangReorderFields
)
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ add_clang_library(clangTidy
)

if(CLANG_ENABLE_STATIC_ANALYZER)
target_link_libraries(clangTidy PRIVATE
clang_target_link_libraries(clangTidy PRIVATE
clangStaticAnalyzerCore
clangStaticAnalyzerFrontend
)
Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-tidy/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ add_clang_tool(clang-tidy
add_dependencies(clang-tidy
clang-resource-headers
)
target_link_libraries(clang-tidy
clang_target_link_libraries(clang-tidy
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangTidy
clangTooling
clangToolingCore
)
target_link_libraries(clang-tidy
PRIVATE
clangTidy
${ALL_CLANG_TIDY_CHECKS}
)

Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ClangdLSPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ void ClangdLSPServer::onSwitchSourceHeader(
if (!Path)
return Reply(Path.takeError());
if (*Path)
Reply(URIForFile::canonicalize(**Path, Params.uri.file()));
return Reply(URIForFile::canonicalize(**Path, Params.uri.file()));
return Reply(llvm::None);
});
}
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ClangdServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void ClangdServer::switchSourceHeader(
if (auto CorrespondingFile =
getCorrespondingHeaderOrSource(Path, FSProvider.getFileSystem()))
return CB(std::move(CorrespondingFile));
auto Action = [Path, CB = std::move(CB),
auto Action = [Path = Path.str(), CB = std::move(CB),
this](llvm::Expected<InputsAndAST> InpAST) mutable {
if (!InpAST)
return CB(InpAST.takeError());
Expand Down
26 changes: 24 additions & 2 deletions clang-tools-extra/clangd/CollectMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct MainFileMacros {
std::vector<Range> Ranges;
};

/// Collects macro definitions and expansions in the main file. It is used to:
/// Collects macro references (e.g. definitions, expansions) in the main file.
/// It is used to:
/// - collect macros in the preamble section of the main file (in Preamble.cpp)
/// - collect macros after the preamble of the main file (in ParsedAST.cpp)
class CollectMainFileMacros : public PPCallbacks {
Expand All @@ -49,6 +50,27 @@ class CollectMainFileMacros : public PPCallbacks {
add(MacroName, MD.getMacroInfo());
}

void MacroUndefined(const clang::Token &MacroName,
const clang::MacroDefinition &MD,
const clang::MacroDirective *Undef) override {
add(MacroName, MD.getMacroInfo());
}

void Ifdef(SourceLocation Loc, const Token &MacroName,
const MacroDefinition &MD) override {
add(MacroName, MD.getMacroInfo());
}

void Ifndef(SourceLocation Loc, const Token &MacroName,
const MacroDefinition &MD) override {
add(MacroName, MD.getMacroInfo());
}

void Defined(const Token &MacroName, const MacroDefinition &MD,
SourceRange Range) override {
add(MacroName, MD.getMacroInfo());
}

private:
void add(const Token &MacroNameTok, const MacroInfo *MI) {
if (!InMainFile)
Expand All @@ -57,7 +79,7 @@ class CollectMainFileMacros : public PPCallbacks {
if (Loc.isMacroID())
return;

if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) {
if (auto Range = getTokenRange(SM, LangOpts, Loc)) {
Out.Names.insert(MacroNameTok.getIdentifierInfo()->getName());
Out.Ranges.push_back(*Range);
}
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clangd/HeaderSourceSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ llvm::Optional<Path> getCorrespondingHeaderOrSource(const Path &OriginalFile,
if (auto TargetPath = URI::resolve(TargetURI, OriginalFile)) {
if (*TargetPath != OriginalFile) // exclude the original file.
++Candidates[*TargetPath];
};
} else {
elog("Failed to resolve URI {0}: {1}", TargetURI, TargetPath.takeError());
}
};
// If we switch from a header, we are looking for the implementation
// file, so we use the definition loc; otherwise we look for the header file,
Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clangd/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ add_llvm_fuzzer(clangd-fuzzer
DUMMY_MAIN DummyClangdMain.cpp
)

target_link_libraries(clangd-fuzzer
clang_target_link_libraries(clangd-fuzzer
PRIVATE
clangBasic
clangDaemon
clangFormat
clangFrontend
clangSema
clangTooling
clangToolingCore
)
target_link_libraries(clangd-fuzzer
PRIVATE
clangDaemon
)
5 changes: 4 additions & 1 deletion clang-tools-extra/clangd/index/Merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ Symbol mergeSymbol(const Symbol &L, const Symbol &R) {
S.Signature = O.Signature;
if (S.CompletionSnippetSuffix == "")
S.CompletionSnippetSuffix = O.CompletionSnippetSuffix;
if (S.Documentation == "")
// Don't accept documentation from bare forward declarations, if there is a
// definition and it didn't provide one. S is often an undocumented class,
// and O is a non-canonical forward decl preceded by an irrelevant comment.
if (S.Documentation == "" && !S.Definition)
S.Documentation = O.Documentation;
if (S.ReturnType == "")
S.ReturnType = O.ReturnType;
Expand Down
5 changes: 4 additions & 1 deletion clang-tools-extra/clangd/index/dex/dexp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ add_clang_executable(dexp
Dexp.cpp
)

target_link_libraries(dexp
clang_target_link_libraries(dexp
PRIVATE
clangBasic
)
target_link_libraries(dexp
PRIVATE
clangDaemon
)
7 changes: 5 additions & 2 deletions clang-tools-extra/clangd/indexer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ add_clang_executable(clangd-indexer
IndexerMain.cpp
)

target_link_libraries(clangd-indexer
clang_target_link_libraries(clangd-indexer
PRIVATE
clangAST
clangBasic
clangDaemon
clangFrontend
clangIndex
clangLex
clangTooling
)
target_link_libraries(clangd-indexer
PRIVATE
clangDaemon
)
4 changes: 3 additions & 1 deletion clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ bool ExpandAutoType::prepare(const Selection& Inputs) {
if (auto *Node = Inputs.ASTSelection.commonAncestor()) {
if (auto *TypeNode = Node->ASTNode.get<TypeLoc>()) {
if (const AutoTypeLoc Result = TypeNode->getAs<AutoTypeLoc>()) {
CachedLocation = Result;
// Code in apply() does handle 'decltype(auto)' yet.
if (!Result.getTypePtr()->isDecltypeAuto())
CachedLocation = Result;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions clang-tools-extra/clangd/test/semantic-highlighting.test
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ],
# CHECK-NEXT: "textDocument": {
# CHECK-NEXT: "uri": "file:///clangd-test/foo.cpp"
# CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/foo.cpp"
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT:}
Expand All @@ -84,7 +84,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ],
# CHECK-NEXT: "textDocument": {
# CHECK-NEXT: "uri": "file:///clangd-test/foo2.cpp"
# CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/foo2.cpp"
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT:}
Expand All @@ -99,7 +99,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ],
# CHECK-NEXT: "textDocument": {
# CHECK-NEXT: "uri": "file:///clangd-test/foo.cpp"
# CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/foo.cpp"
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT:}
Expand All @@ -114,7 +114,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ],
# CHECK-NEXT: "textDocument": {
# CHECK-NEXT: "uri": "file:///clangd-test/foo.cpp"
# CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/foo.cpp"
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT:}
Expand Down
Loading

0 comments on commit 2b97380

Please sign in to comment.