Skip to content

Commit 7bedccc

Browse files
committed
Merge from 'main' to 'sycl-web' (124 commits)
CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp CONFLICT (content): Merge conflict in clang/lib/Driver/Driver.cpp
2 parents cd9abfe + 4a7be42 commit 7bedccc

File tree

655 files changed

+16591
-6974
lines changed

Some content is hidden

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

655 files changed

+16591
-6974
lines changed

bolt/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set(BOLT_RT_FLAGS
2828
-fno-rtti
2929
-fno-stack-protector
3030
-mno-sse
31-
-fPIE)
31+
-fPIC)
3232

3333
# Don't let the compiler think it can create calls to standard libs
3434
target_compile_options(bolt_rt_instr PRIVATE ${BOLT_RT_FLAGS})

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
5454
Finder->addMatcher(loc(templateSpecializationType(forEachTemplateArgument(
5555
templateArgument().bind("used")))),
5656
this);
57+
Finder->addMatcher(userDefinedLiteral().bind("used"), this);
5758
// Cases where we can identify the UsingShadowDecl directly, rather than
5859
// just its target.
5960
// FIXME: cover more cases in this way, as the AST supports it.
@@ -150,7 +151,11 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
150151
if (const auto *USD = dyn_cast<UsingShadowDecl>(ND))
151152
removeFromFoundDecls(USD->getTargetDecl()->getCanonicalDecl());
152153
}
154+
return;
153155
}
156+
// Check user-defined literals
157+
if (const auto *UDL = Result.Nodes.getNodeAs<UserDefinedLiteral>("used"))
158+
removeFromFoundDecls(UDL->getCalleeDecl());
154159
}
155160

156161
void UnusedUsingDeclsCheck::removeFromFoundDecls(const Decl *D) {

clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ using UsedSymbolCB = llvm::function_ref<void(const SymbolReference &SymRef,
4545
/// the headers for any referenced symbol
4646
void walkUsed(llvm::ArrayRef<Decl *> ASTRoots,
4747
llvm::ArrayRef<SymbolReference> MacroRefs,
48-
const PragmaIncludes &PI, const SourceManager &, UsedSymbolCB CB);
48+
const PragmaIncludes *PI, const SourceManager &, UsedSymbolCB CB);
4949

5050
} // namespace include_cleaner
5151
} // namespace clang

clang-tools-extra/include-cleaner/lib/Analysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ namespace clang::include_cleaner {
1919

2020
void walkUsed(llvm::ArrayRef<Decl *> ASTRoots,
2121
llvm::ArrayRef<SymbolReference> MacroRefs,
22-
const PragmaIncludes &PI, const SourceManager &SM,
22+
const PragmaIncludes *PI, const SourceManager &SM,
2323
UsedSymbolCB CB) {
24+
// This is duplicated in writeHTMLReport, changes should be mirrored there.
2425
tooling::stdlib::Recognizer Recognizer;
2526
for (auto *Root : ASTRoots) {
2627
auto &SM = Root->getASTContext().getSourceManager();

clang-tools-extra/include-cleaner/lib/AnalysisInternal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ struct SymbolLocation {
7575
// Order must match Kind enum!
7676
std::variant<SourceLocation, tooling::stdlib::Symbol> Storage;
7777
};
78-
llvm::raw_ostream &operator<<(llvm::raw_ostream &, const Header &);
78+
llvm::raw_ostream &operator<<(llvm::raw_ostream &, const SymbolLocation &);
7979

8080
/// Finds the headers that provide the symbol location.
8181
// FIXME: expose signals
8282
llvm::SmallVector<Header> findHeaders(const SymbolLocation &Loc,
8383
const SourceManager &SM,
84-
const PragmaIncludes &PI);
84+
const PragmaIncludes *PI);
8585

8686
/// Write an HTML summary of the analysis to the given stream.
87-
/// FIXME: Once analysis has a public API, this should be public too.
88-
void writeHTMLReport(FileID File, llvm::ArrayRef<Decl *> Roots, ASTContext &Ctx,
89-
llvm::raw_ostream &OS);
87+
void writeHTMLReport(FileID File, llvm::ArrayRef<Decl *> Roots,
88+
llvm::ArrayRef<SymbolReference> MacroRefs, ASTContext &Ctx,
89+
PragmaIncludes *PI, llvm::raw_ostream &OS);
9090

9191
} // namespace include_cleaner
9292
} // namespace clang

clang-tools-extra/include-cleaner/lib/FindHeaders.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace clang::include_cleaner {
1414

1515
llvm::SmallVector<Header> findHeaders(const SymbolLocation &Loc,
1616
const SourceManager &SM,
17-
const PragmaIncludes &PI) {
17+
const PragmaIncludes *PI) {
1818
llvm::SmallVector<Header> Results;
1919
switch (Loc.kind()) {
2020
case SymbolLocation::Physical: {
@@ -25,18 +25,21 @@ llvm::SmallVector<Header> findHeaders(const SymbolLocation &Loc,
2525
if (!FE)
2626
return {};
2727

28-
// We treat the spelling header in the IWYU pragma as the final public
29-
// header.
30-
// FIXME: look for exporters if the public header is exported by another
31-
// header.
32-
llvm::StringRef VerbatimSpelling = PI.getPublic(FE);
33-
if (!VerbatimSpelling.empty())
34-
return {Header(VerbatimSpelling)};
35-
3628
Results = {Header(FE)};
37-
// FIXME: compute transitive exporter headers.
38-
for (const auto *Export : PI.getExporters(FE, SM.getFileManager()))
39-
Results.push_back(Export);
29+
if (PI) {
30+
// We treat the spelling header in the IWYU pragma as the final public
31+
// header.
32+
// FIXME: look for exporters if the public header is exported by another
33+
// header.
34+
llvm::StringRef VerbatimSpelling = PI->getPublic(FE);
35+
if (!VerbatimSpelling.empty())
36+
return {Header(VerbatimSpelling)};
37+
38+
// FIXME: compute transitive exporter headers.
39+
for (const auto *Export : PI->getExporters(FE, SM.getFileManager()))
40+
Results.push_back(Export);
41+
}
42+
4043
return Results;
4144
}
4245
case SymbolLocation::Standard: {

0 commit comments

Comments
 (0)