Skip to content

Commit b6dd41f

Browse files
authored
Merge branch 'main' into feat/28334
2 parents 02184d0 + 5bf3748 commit b6dd41f

File tree

207 files changed

+2883
-1182
lines changed

Some content is hidden

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

207 files changed

+2883
-1182
lines changed

.github/workflows/premerge.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ on:
1414
# do this is that it allows us to take advantage of concurrency groups
1515
# to cancel in progress CI jobs whenever the PR is closed.
1616
- closed
17-
paths:
18-
- .github/workflows/premerge.yaml
1917
push:
2018
branches:
2119
- 'main'

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
498498
if (!IslandOffset)
499499
return;
500500

501+
// Print label if it exists at this offset.
502+
if (const BinaryData *BD =
503+
BC.getBinaryDataAtAddress(getAddress() + *IslandOffset))
504+
OS << BD->getName() << ":\n";
505+
501506
const size_t IslandSize = getSizeOfDataInCodeAt(*IslandOffset);
502507
BC.printData(OS, BC.extractData(getAddress() + *IslandOffset, IslandSize),
503508
*IslandOffset);
@@ -1066,7 +1071,7 @@ size_t BinaryFunction::getSizeOfDataInCodeAt(uint64_t Offset) const {
10661071
auto Iter = Islands->CodeOffsets.upper_bound(Offset);
10671072
if (Iter != Islands->CodeOffsets.end())
10681073
return *Iter - Offset;
1069-
return getSize() - Offset;
1074+
return getMaxSize() - Offset;
10701075
}
10711076

10721077
std::optional<uint64_t>

bolt/test/AArch64/data-in-code.s

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
## Check disassembly of BOLT input.
88
# RUN: llvm-objdump %t.exe -d | FileCheck %s
99

10-
# RUN: llvm-bolt %t.exe -o %t.bolt --print-disasm | FileCheck %s
10+
# RUN: llvm-bolt %t.exe -o %t.bolt --print-disasm \
11+
# RUN: | FileCheck %s --check-prefixes CHECK,CHECK-BOLT-ONLY
1112

1213
.text
1314
.balign 4
@@ -16,16 +17,21 @@
1617
.type _start, %function
1718
_start:
1819
mov x0, #0x0
20+
ldr x1, .L1
1921
.word 0x4f82e010
2022
ret
23+
.size _start, .-_start
24+
.L1:
2125
.byte 0x0, 0xff, 0x42
2226
# CHECK-LABEL: _start
2327
# CHECK: mov x0, #0x0
28+
# CHECK-NEXT: ldr x1
29+
# CHECK-BOLT-ONLY-SAME: ISLANDat[[ADDR:]]
2430
# CHECK-NEXT: .word 0x4f82e010
2531
# CHECK-NEXT: ret
32+
# CHECK-BOLT-ONLY-NEXT: ISLANDat[[ADDR]]
2633
# CHECK-NEXT: .short 0xff00
2734
# CHECK-NEXT: .byte 0x42
28-
.size _start, .-_start
2935

3036
## Force relocation mode.
3137
.reloc 0, R_AARCH64_NONE

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ TEST(ClangdAST, GetContainedAutoParamType) {
329329
auto &&d,
330330
auto *&e,
331331
auto (*f)(int)
332-
){};
332+
){ return 0; };
333333
334334
int withoutAuto(
335335
int a,
@@ -338,7 +338,7 @@ TEST(ClangdAST, GetContainedAutoParamType) {
338338
int &&d,
339339
int *&e,
340340
int (*f)(int)
341-
){};
341+
){ return 0; };
342342
)cpp");
343343
TU.ExtraArgs.push_back("-std=c++20");
344344
auto AST = TU.build();

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ TEST(WorkspaceSymbols, Unnamed) {
113113
TEST(WorkspaceSymbols, InMainFile) {
114114
TestTU TU;
115115
TU.Code = R"cpp(
116-
int test() {}
116+
int test() { return 0; }
117117
static void test2() {}
118118
)cpp";
119119
EXPECT_THAT(getSymbols(TU, "test"),
@@ -537,12 +537,14 @@ TEST(DocumentSymbols, InHeaderFile) {
537537
TestTU TU;
538538
TU.AdditionalFiles["bar.h"] = R"cpp(
539539
int foo() {
540+
return 0;
540541
}
541542
)cpp";
542543
TU.Code = R"cpp(
543544
int i; // declaration to finish preamble
544545
#include "bar.h"
545546
int test() {
547+
return 0;
546548
}
547549
)cpp";
548550
EXPECT_THAT(getSymbols(TU.build()),
@@ -780,7 +782,7 @@ TEST(DocumentSymbols, FuncTemplates) {
780782
TestTU TU;
781783
Annotations Source(R"cpp(
782784
template <class T>
783-
T foo() {}
785+
T foo() { return T{}; }
784786
785787
auto x = foo<int>();
786788
auto y = foo<double>();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ TEST(ParsedASTTest, NoCrashOnTokensWithTidyCheck) {
251251
// this check runs the preprocessor, we need to make sure it does not break
252252
// our recording logic.
253253
TU.ClangTidyProvider = addTidyChecks("modernize-use-trailing-return-type");
254-
TU.Code = "inline int foo() {}";
254+
TU.Code = "inline int foo() { return 0; }";
255255

256256
auto AST = TU.build();
257257
const syntax::TokenBuffer &T = AST.getTokens();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ TEST(QualityTests, SymbolRelevanceSignalExtraction) {
108108
109109
using flags::FLAGS_FOO;
110110
111-
int ::header_main() {}
111+
int ::header_main() { return 0; }
112112
int main();
113113
114114
[[deprecated]]

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ TEST(RenameTest, WithinFileRename) {
214214
template<typename T>
215215
class Foo {
216216
public:
217-
static T [[f^oo]]() {}
217+
static T [[f^oo]]() { return T(); }
218218
};
219219
220220
void bar() {
@@ -225,7 +225,7 @@ TEST(RenameTest, WithinFileRename) {
225225
template<typename T>
226226
class Foo {
227227
public:
228-
T [[f^oo]]() {}
228+
T [[f^oo]]() { return T(); }
229229
};
230230
231231
void bar() {
@@ -827,7 +827,7 @@ TEST(RenameTest, WithinFileRename) {
827827

828828
// Issue 170: Rename symbol introduced by UsingDecl
829829
R"cpp(
830-
namespace ns { void [[f^oo]](); }
830+
namespace ns { void [[f^oo]](); }
831831
832832
using ns::[[f^oo]];
833833
@@ -1307,7 +1307,7 @@ TEST(RenameTest, Renameable) {
13071307
"no symbol", false},
13081308

13091309
{R"cpp(// FIXME we probably want to rename both overloads here,
1310-
// but renaming currently assumes there's only a
1310+
// but renaming currently assumes there's only a
13111311
// single canonical declaration.
13121312
namespace ns { int foo(int); char foo(char); }
13131313
using ns::^foo;
@@ -1776,7 +1776,7 @@ TEST(CrossFileRenameTests, WithUpToDateIndex) {
17761776
void [[foo]]() override {};
17771777
};
17781778
1779-
void func(Base* b, Derived1* d1,
1779+
void func(Base* b, Derived1* d1,
17801780
Derived2* d2, NotDerived* nd) {
17811781
b->[[foo]]();
17821782
d1->[[foo]]();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ sizeof...($TemplateParameter[[Elements]]);
741741
$Class[[Foo]].$Field_static[[sharedInstance]].$Field[[someProperty]] $Operator[[=]] 1;
742742
self.$Field[[someProperty]] $Operator[[=]] self.$Field[[someProperty]] $Operator[[+]] self.$Field[[otherMethod]] $Operator[[+]] 1;
743743
self->$Field[[_someProperty]] $Operator[[=]] $Field[[_someProperty]] $Operator[[+]] 1;
744+
return 0;
744745
}
745746
@end
746747
)cpp",

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ TEST(FoldingRanges, ASTAll) {
201201
R"cpp(
202202
#define FOO int foo() {\
203203
int Variable = 42; \
204+
return 0; \
204205
}
205206
206207
// Do not generate folding range for braces within macro expansion.
@@ -336,18 +337,18 @@ TEST(FoldingRanges, PseudoParserWithoutLineFoldings) {
336337
]]};
337338
)cpp",
338339
R"cpp(
339-
/*[[ Multi
340+
/*[[ Multi
340341
* line
341-
* comment
342+
* comment
342343
]]*/
343344
)cpp",
344345
R"cpp(
345346
//[[ Comment
346347
// 1]]
347-
348+
348349
//[[ Comment
349350
// 2]]
350-
351+
351352
// No folding for single line comment.
352353
353354
/*[[ comment 3

0 commit comments

Comments
 (0)