Skip to content

Commit e8266fe

Browse files
committed
Merge from 'main' to 'sycl-web' (161 commits)
CONFLICT (content): Merge conflict in clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp CONFLICT (content): Merge conflict in clang/test/CodeGenSYCL/unique_stable_name.cpp
2 parents 9b8cd6b + 0745b0c commit e8266fe

File tree

523 files changed

+34557
-4820
lines changed

Some content is hidden

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

523 files changed

+34557
-4820
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,7 @@ bool BinaryContext::handleAArch64Veneer(uint64_t Address, bool MatchOnly) {
11911191
MIB->addAnnotation(Instruction, "AArch64Veneer", true);
11921192
Veneer->addInstruction(Offset, std::move(Instruction));
11931193
--Count;
1194-
for (auto It = std::prev(Instructions.end()); Count != 0;
1195-
It = std::prev(It), --Count) {
1194+
for (auto It = Instructions.rbegin(); Count != 0; ++It, --Count) {
11961195
MIB->addAnnotation(It->second, "AArch64Veneer", true);
11971196
Veneer->addInstruction(It->first, std::move(It->second));
11981197
}

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static cl::opt<bool> KeepARanges(
9191

9292
static cl::opt<bool>
9393
DeterministicDebugInfo("deterministic-debuginfo",
94-
cl::desc("disables parallel execution of tasks that may produce"
94+
cl::desc("disables parallel execution of tasks that may produce "
9595
"nondeterministic debug info"),
9696
cl::init(true),
9797
cl::cat(BoltCategory));

bolt/test/Unit/lit.site.cfg.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
99
config.bolt_obj_root = "@BOLT_BINARY_DIR@"
1010
config.bolt_src_root = "@BOLT_SOURCE_DIR@"
1111
config.target_triple = "@LLVM_TARGET_TRIPLE@"
12-
config.python_executable = "@Python3_EXECUTABLE@"
1312

1413
import lit.llvm
1514
lit.llvm.initialize(lit_config, config)

bolt/test/X86/end-symbol.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %p/Inputs/plt-sec.yaml &> %t.exe
22
# RUN: llvm-bolt %t.exe -o %t.out
3-
# RUN: (llvm-readelf --program-headers %t.out | tac ; llvm-nm %t.out) \
3+
# RUN: (llvm-readelf --program-headers %t.out | grep LOAD | tail -n 1 ; llvm-nm %t.out) \
44
# RUN: | FileCheck %s
55

66
## Check that llvm-bolt correctly updates _end symbol to match the end of the

bolt/test/X86/is-strip.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This test checks whether a binary is stripped or not.
22

3-
# RUN: %clang++ %p/Inputs/linenumber.cpp -o %t -Wl,-q
3+
# RUN: %clang++ %cflags %p/Inputs/linenumber.cpp -o %t -Wl,-q
44
# RUN: llvm-bolt %t -o %t.out 2>&1 | FileCheck %s -check-prefix=CHECK-NOSTRIP
55
# RUN: cp %t %t.stripped
66
# RUN: llvm-strip -s %t.stripped

bolt/test/lit.site.cfg.py.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
1414
config.host_triple = "@LLVM_HOST_TRIPLE@"
1515
config.target_triple = "@LLVM_TARGET_TRIPLE@"
1616
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
17-
config.enable_shared = @ENABLE_SHARED@
18-
config.enable_backtrace = @ENABLE_BACKTRACES@
1917
config.host_arch = "@HOST_ARCH@"
20-
config.enable_abi_breaking_checks = "@LLVM_ENABLE_ABI_BREAKING_CHECKS@"
21-
config.python_executable = "@PYTHON_EXECUTABLE@"
18+
config.python_executable = "@Python3_EXECUTABLE@"
2219
config.bolt_clang = "@BOLT_CLANG_EXE@"
2320
config.bolt_lld = "@BOLT_LLD_EXE@"
2421
config.targets_to_build = "@TARGETS_TO_BUILD@"

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
107107
} else if (const auto *Specialization =
108108
dyn_cast<ClassTemplateSpecializationDecl>(Used)) {
109109
removeFromFoundDecls(Specialization->getSpecializedTemplate());
110-
} else if (const auto *FD = dyn_cast<FunctionDecl>(Used)) {
111-
if (const auto *FDT = FD->getPrimaryTemplate())
112-
removeFromFoundDecls(FDT);
113110
} else if (const auto *ECD = dyn_cast<EnumConstantDecl>(Used)) {
114111
if (const auto *ET = ECD->getType()->getAs<EnumType>())
115112
removeFromFoundDecls(ET->getDecl());

clang-tools-extra/clangd/unittests/Annotations.cpp

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,78 @@ namespace clang {
1313
namespace clangd {
1414

1515
Position Annotations::point(llvm::StringRef Name) const {
16-
return offsetToPosition(code(), Base::point(Name));
16+
return pointWithPayload(Name).first;
17+
}
18+
19+
std::pair<Position, llvm::StringRef>
20+
Annotations::pointWithPayload(llvm::StringRef Name) const {
21+
auto [BasePoint, Payload] = Base::pointWithPayload(Name);
22+
return {offsetToPosition(code(), BasePoint), Payload};
1723
}
1824

1925
std::vector<Position> Annotations::points(llvm::StringRef Name) const {
20-
auto Offsets = Base::points(Name);
26+
auto BasePoints = Base::points(Name);
2127

2228
std::vector<Position> Ps;
23-
Ps.reserve(Offsets.size());
24-
for (size_t O : Offsets)
25-
Ps.push_back(offsetToPosition(code(), O));
29+
Ps.reserve(BasePoints.size());
30+
for (const auto Point : BasePoints)
31+
Ps.push_back(offsetToPosition(code(), Point));
32+
33+
return Ps;
34+
}
35+
36+
std::vector<std::pair<Position, llvm::StringRef>>
37+
Annotations::pointsWithPayload(llvm::StringRef Name) const {
38+
auto BasePoints = Base::pointsWithPayload(Name);
39+
40+
std::vector<std::pair<Position, llvm::StringRef>> Ps;
41+
Ps.reserve(BasePoints.size());
42+
for (const auto &[Point, Payload] : BasePoints)
43+
Ps.push_back({offsetToPosition(code(), Point), Payload});
2644

2745
return Ps;
2846
}
2947

30-
static clangd::Range toLSPRange(llvm::StringRef Code, Annotations::Range R) {
48+
static clangd::Range toLSPRange(llvm::StringRef Code,
49+
llvm::Annotations::Range R) {
3150
clangd::Range LSPRange;
3251
LSPRange.start = offsetToPosition(Code, R.Begin);
3352
LSPRange.end = offsetToPosition(Code, R.End);
3453
return LSPRange;
3554
}
3655

37-
clangd::Range Annotations::range(llvm::StringRef Name) const {
38-
return toLSPRange(code(), Base::range(Name));
56+
Range Annotations::range(llvm::StringRef Name) const {
57+
return rangeWithPayload(Name).first;
3958
}
4059

41-
std::vector<clangd::Range> Annotations::ranges(llvm::StringRef Name) const {
60+
std::pair<clangd::Range, llvm::StringRef>
61+
Annotations::rangeWithPayload(llvm::StringRef Name) const {
62+
auto [BaseRange, Payload] = Base::rangeWithPayload(Name);
63+
return {toLSPRange(code(), BaseRange), Payload};
64+
}
65+
66+
std::vector<Range> Annotations::ranges(llvm::StringRef Name) const {
4267
auto OffsetRanges = Base::ranges(Name);
4368

4469
std::vector<clangd::Range> Rs;
4570
Rs.reserve(OffsetRanges.size());
46-
for (Annotations::Range R : OffsetRanges)
71+
for (const auto &R : OffsetRanges)
4772
Rs.push_back(toLSPRange(code(), R));
4873

4974
return Rs;
5075
}
5176

77+
std::vector<std::pair<clangd::Range, llvm::StringRef>>
78+
Annotations::rangesWithPayload(llvm::StringRef Name) const {
79+
auto OffsetRanges = Base::rangesWithPayload(Name);
80+
81+
std::vector<std::pair<clangd::Range, llvm::StringRef>> Rs;
82+
Rs.reserve(OffsetRanges.size());
83+
for (const auto &[R, Payload] : OffsetRanges)
84+
Rs.push_back({toLSPRange(code(), R), Payload});
85+
86+
return Rs;
87+
}
88+
5289
} // namespace clangd
5390
} // namespace clang

clang-tools-extra/clangd/unittests/Annotations.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@ class Annotations : public llvm::Annotations {
2727
using llvm::Annotations::Annotations;
2828

2929
Position point(llvm::StringRef Name = "") const;
30+
std::pair<Position, llvm::StringRef>
31+
pointWithPayload(llvm::StringRef Name = "") const;
3032
std::vector<Position> points(llvm::StringRef Name = "") const;
33+
std::vector<std::pair<Position, llvm::StringRef>>
34+
pointsWithPayload(llvm::StringRef Name = "") const;
3135

3236
clangd::Range range(llvm::StringRef Name = "") const;
37+
std::pair<clangd::Range, llvm::StringRef>
38+
rangeWithPayload(llvm::StringRef Name = "") const;
3339
std::vector<clangd::Range> ranges(llvm::StringRef Name = "") const;
40+
std::vector<std::pair<clangd::Range, llvm::StringRef>>
41+
rangesWithPayload(llvm::StringRef Name = "") const;
3442
};
3543

3644
} // namespace clangd

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class PragmaIncludes {
7070
llvm::SmallVector<const FileEntry *> getExporters(const FileEntry *File,
7171
FileManager &FM) const;
7272

73+
/// Returns true if the given file is a self-contained file.
74+
bool isSelfContained(const FileEntry *File) const;
75+
7376
private:
7477
class RecordPragma;
7578
/// 1-based Line numbers for the #include directives of the main file that
@@ -94,11 +97,13 @@ class PragmaIncludes {
9497
llvm::SmallVector</*RealPathNames*/ llvm::StringRef>>
9598
IWYUExportBy;
9699

100+
/// Contains all non self-contained files detected during the parsing.
101+
llvm::DenseSet<llvm::sys::fs::UniqueID> NonSelfContainedFiles;
102+
97103
/// Owns the strings.
98104
llvm::BumpPtrAllocator Arena;
99105

100106
// FIXME: add support for clang use_instead pragma
101-
// FIXME: add selfcontained file.
102107
};
103108

104109
/// Recorded main-file parser events relevant to include-cleaner.

0 commit comments

Comments
 (0)