Skip to content

Commit 23de0af

Browse files
authored
Merge branch 'main' into ReductionCombinerLoweringSemaChanges
2 parents e1f3fa6 + 41f5f3b commit 23de0af

File tree

546 files changed

+30659
-29428
lines changed

Some content is hidden

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

546 files changed

+30659
-29428
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,12 @@ void RewriteInstance::registerFragments() {
15141514
}
15151515
if (BD) {
15161516
BinaryFunction *BF = BC->getFunctionForSymbol(BD->getSymbol());
1517+
if (BF == &Function) {
1518+
BC->errs()
1519+
<< "BOLT-WARNING: fragment maps to the same function as parent: "
1520+
<< Function << '\n';
1521+
continue;
1522+
}
15171523
if (BF) {
15181524
BC->registerFragment(Function, *BF);
15191525
continue;
@@ -4005,10 +4011,12 @@ void RewriteInstance::mapCodeSections(BOLTLinker::SectionMapper MapSection) {
40054011
BC->outs() << '\n';
40064012
AllocationDone = true;
40074013
} else {
4008-
BC->errs() << "BOLT-WARNING: original .text too small to fit the new code"
4009-
<< " using 0x" << Twine::utohexstr(opts::AlignText)
4010-
<< " alignment. " << CodeSize << " bytes needed, have "
4011-
<< BC->OldTextSectionSize << " bytes available.\n";
4014+
BC->errs() << "BOLT-WARNING: --use-old-text failed. The original .text "
4015+
"too small to fit the new code using 0x"
4016+
<< Twine::utohexstr(opts::AlignText) << " alignment. "
4017+
<< CodeSize << " bytes needed, have " << BC->OldTextSectionSize
4018+
<< " bytes available. Rebuilding without --use-old-text may "
4019+
"produce a smaller binary\n";
40124020
opts::UseOldText = false;
40134021
}
40144022
}

bolt/test/X86/fragment-alias.s

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## This test reproduces the issue where a fragment has the same address as
2+
## parent function.
3+
# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
4+
# RUN: %clang %cflags %t.o -o %t
5+
# RUN: llvm-bolt %t -o %t.out 2>&1 | FileCheck %s
6+
# CHECK: BOLT-WARNING: fragment maps to the same function as parent: main/1(*2)
7+
.type main, @function
8+
.type main.cold, @function
9+
main.cold:
10+
main:
11+
ret
12+
.size main, .-main
13+
.size main.cold, .-main.cold

clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void InitVariablesCheck::check(const MatchFinder::MatchResult &Result) {
108108
<< MatchedDecl;
109109
if (*InitializationString != nullptr)
110110
Diagnostic << FixItHint::CreateInsertion(
111-
utils::lexer::findNextTerminator(MatchedDecl->getLocation(),
111+
utils::lexer::findNextTerminator(MatchedDecl->getEndLoc(),
112112
*Result.SourceManager,
113113
Result.Context->getLangOpts()),
114114
*InitializationString);

clang-tools-extra/clangd/Hover.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,12 @@ markup::Document HoverInfo::presentDoxygen() const {
15371537
SymbolDocCommentVisitor SymbolDoc(Documentation, CommentOpts);
15381538

15391539
if (SymbolDoc.hasBriefCommand()) {
1540+
if (Kind != index::SymbolKind::Parameter &&
1541+
Kind != index::SymbolKind::TemplateTypeParm)
1542+
// Only add a "Brief" heading if we are not documenting a parameter.
1543+
// Parameters only have a brief section and adding the brief header would
1544+
// be redundant.
1545+
Output.addHeading(3).appendText("Brief");
15401546
SymbolDoc.briefToMarkup(Output.addParagraph());
15411547
Output.addRuler();
15421548
}
@@ -1550,7 +1556,7 @@ markup::Document HoverInfo::presentDoxygen() const {
15501556
// Returns
15511557
// `type` - description
15521558
if (TemplateParameters && !TemplateParameters->empty()) {
1553-
Output.addParagraph().appendBoldText("Template Parameters:");
1559+
Output.addHeading(3).appendText("Template Parameters");
15541560
markup::BulletList &L = Output.addBulletList();
15551561
for (const auto &Param : *TemplateParameters) {
15561562
markup::Paragraph &P = L.addItem().addParagraph();
@@ -1564,7 +1570,7 @@ markup::Document HoverInfo::presentDoxygen() const {
15641570
}
15651571

15661572
if (Parameters && !Parameters->empty()) {
1567-
Output.addParagraph().appendBoldText("Parameters:");
1573+
Output.addHeading(3).appendText("Parameters");
15681574
markup::BulletList &L = Output.addBulletList();
15691575
for (const auto &Param : *Parameters) {
15701576
markup::Paragraph &P = L.addItem().addParagraph();
@@ -1583,23 +1589,23 @@ markup::Document HoverInfo::presentDoxygen() const {
15831589
if (ReturnType &&
15841590
((ReturnType->Type != "void" && !ReturnType->AKA.has_value()) ||
15851591
(ReturnType->AKA.has_value() && ReturnType->AKA != "void"))) {
1586-
Output.addParagraph().appendBoldText("Returns:");
1592+
Output.addHeading(3).appendText("Returns");
15871593
markup::Paragraph &P = Output.addParagraph();
15881594
P.appendCode(llvm::to_string(*ReturnType));
15891595

15901596
if (SymbolDoc.hasReturnCommand()) {
15911597
P.appendText(" - ");
15921598
SymbolDoc.returnToMarkup(P);
15931599
}
1600+
1601+
SymbolDoc.retvalsToMarkup(Output);
15941602
Output.addRuler();
15951603
}
15961604

1597-
// add specially handled doxygen commands.
1598-
SymbolDoc.warningsToMarkup(Output);
1599-
SymbolDoc.notesToMarkup(Output);
1600-
1601-
// add any other documentation.
1602-
SymbolDoc.docToMarkup(Output);
1605+
if (SymbolDoc.hasDetailedDoc()) {
1606+
Output.addHeading(3).appendText("Details");
1607+
SymbolDoc.detailedDocToMarkup(Output);
1608+
}
16031609

16041610
Output.addRuler();
16051611

0 commit comments

Comments
 (0)