Skip to content

Commit 298e746

Browse files
committed
Merge from 'main' to 'sycl-web' (4 commits)
CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticSemaKinds.td
2 parents a21c843 + 196edb9 commit 298e746

22 files changed

+145
-150
lines changed

clang/include/clang/Basic/Diagnostic.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ include "DiagnosticGroups.td"
7575

7676

7777
// All diagnostics emitted by the compiler are an indirect subclass of this.
78-
class Diagnostic<string summary, DiagClass DC, Severity defaultmapping> {
78+
class Diagnostic<string text, DiagClass DC, Severity defaultmapping> {
7979
/// Component is specified by the file with a big let directive.
8080
string Component = ?;
81-
string Summary = summary;
81+
string Text = text;
8282
DiagClass Class = DC;
8383
SFINAEResponse SFINAE = SFINAE_Suppress;
8484
bit AccessControl = 0;

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def note_constexpr_invalid_template_arg : Note<
269269
"%select{type_info object|string literal|temporary object|"
270270
"predefined '%3' variable}2 is not allowed in a template argument">;
271271
def err_constexpr_invalid_template_arg : Error<
272-
note_constexpr_invalid_template_arg.Summary>;
272+
note_constexpr_invalid_template_arg.Text>;
273273

274274
// Sema && Frontend
275275
let CategoryName = "Inline Assembly Issue" in {

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def warn_avx_calling_convention
276276
: Warning<"AVX vector %select{return|argument}0 of type %1 without '%2' "
277277
"enabled changes the ABI">,
278278
InGroup<DiagGroup<"psabi">>;
279-
def err_avx_calling_convention : Error<warn_avx_calling_convention.Summary>;
279+
def err_avx_calling_convention : Error<warn_avx_calling_convention.Text>;
280280

281281
def warn_sycl_device_has_aspect_mismatch
282282
: Warning<"function '%0' uses aspect '%1' not listed in its "

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def ext_pp_gnu_line_directive : Extension<
461461
def err_pp_invalid_directive : Error<
462462
"invalid preprocessing directive%select{|, did you mean '#%1'?}0">;
463463
def warn_pp_invalid_directive : Warning<
464-
err_pp_invalid_directive.Summary>, InGroup<DiagGroup<"unknown-directives">>;
464+
err_pp_invalid_directive.Text>, InGroup<DiagGroup<"unknown-directives">>;
465465
def err_pp_directive_required : Error<
466466
"%0 must be used within a preprocessing directive">;
467467
def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
@@ -704,7 +704,7 @@ def ext_pp_bad_paste_ms : ExtWarn<
704704
def err_pp_operator_used_as_macro_name : Error<
705705
"C++ operator %0 (aka %1) used as a macro name">;
706706
def ext_pp_operator_used_as_macro_name : Extension<
707-
err_pp_operator_used_as_macro_name.Summary>, InGroup<MicrosoftCppMacro>;
707+
err_pp_operator_used_as_macro_name.Text>, InGroup<MicrosoftCppMacro>;
708708
def err_pp_illegal_floating_literal : Error<
709709
"floating point literal in preprocessor expression">;
710710
def err_pp_line_requires_integer : Error<

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.

clang/test/TableGen/DiagnosticBase.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class InGroup<DiagGroup G> { DiagGroup Group = G; }
6767
include "DiagnosticDocs.inc"
6868

6969
// All diagnostics emitted by the compiler are an indirect subclass of this.
70-
class Diagnostic<string summary, DiagClass DC, Severity defaultmapping> {
70+
class Diagnostic<string text, DiagClass DC, Severity defaultmapping> {
7171
/// Component is specified by the file with a big let directive.
7272
string Component = ?;
73-
string Summary = summary;
73+
string Text = text;
7474
DiagClass Class = DC;
7575
SFINAEResponse SFINAE = SFINAE_Suppress;
7676
bit AccessControl = 0;

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ std::vector<std::string>
11651165
DiagnosticTextBuilder::buildForDocumentation(StringRef Severity,
11661166
const Record *R) {
11671167
EvaluatingRecordGuard Guard(&EvaluatingRecord, R);
1168-
StringRef Text = R->getValueAsString("Summary");
1168+
StringRef Text = R->getValueAsString("Text");
11691169

11701170
DiagText D(*this, Text);
11711171
TextPiece *Prefix = D.New<TextPiece>(Severity, Severity);
@@ -1184,7 +1184,7 @@ DiagnosticTextBuilder::buildForDocumentation(StringRef Severity,
11841184

11851185
std::string DiagnosticTextBuilder::buildForDefinition(const Record *R) {
11861186
EvaluatingRecordGuard Guard(&EvaluatingRecord, R);
1187-
StringRef Text = R->getValueAsString("Summary");
1187+
StringRef Text = R->getValueAsString("Text");
11881188
DiagText D(*this, Text);
11891189
std::string Result;
11901190
DiagTextPrinter{*this, Result}.Visit(D.Root);
@@ -1702,7 +1702,7 @@ void writeHeader(StringRef Str, raw_ostream &OS, char Kind = '-') {
17021702

17031703
void writeDiagnosticText(DiagnosticTextBuilder &Builder, const Record *R,
17041704
StringRef Role, raw_ostream &OS) {
1705-
StringRef Text = R->getValueAsString("Summary");
1705+
StringRef Text = R->getValueAsString("Text");
17061706
if (Text == "%0")
17071707
OS << "The text of this diagnostic is not controlled by Clang.\n\n";
17081708
else {

lld/ELF/AArch64ErrataFix.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,10 @@ static void implementPatch(uint64_t adrpAddr, uint64_t patcheeOffset,
544544
// and replace the relocation with a R_AARCH_JUMP26 branch relocation.
545545
// Case 4: No relocation. We must create a new R_AARCH64_JUMP26 branch
546546
// relocation at the offset.
547-
auto relIt = llvm::find_if(isec->relocations, [=](const Relocation &r) {
547+
auto relIt = llvm::find_if(isec->relocs(), [=](const Relocation &r) {
548548
return r.offset == patcheeOffset;
549549
});
550-
if (relIt != isec->relocations.end() &&
550+
if (relIt != isec->relocs().end() &&
551551
(relIt->type == R_AARCH64_JUMP26 || relIt->expr == R_RELAX_TLS_IE_TO_LE))
552552
return;
553553

@@ -561,12 +561,11 @@ static void implementPatch(uint64_t adrpAddr, uint64_t patcheeOffset,
561561
return Relocation{R_PC, R_AARCH64_JUMP26, offset, 0, patchSym};
562562
};
563563

564-
if (relIt != isec->relocations.end()) {
565-
ps->relocations.push_back(
566-
{relIt->expr, relIt->type, 0, relIt->addend, relIt->sym});
564+
if (relIt != isec->relocs().end()) {
565+
ps->addReloc({relIt->expr, relIt->type, 0, relIt->addend, relIt->sym});
567566
*relIt = makeRelToPatch(patcheeOffset, ps->patchSym);
568567
} else
569-
isec->relocations.push_back(makeRelToPatch(patcheeOffset, ps->patchSym));
568+
isec->addReloc(makeRelToPatch(patcheeOffset, ps->patchSym));
570569
}
571570

572571
// Scan all the instructions in InputSectionDescription, for each instance of

lld/ELF/ARMErrataFix.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void Patch657417Section::writeTo(uint8_t *buf) {
181181
else
182182
write32le(buf, 0x9000f000);
183183
// If we have a relocation then apply it.
184-
if (!relocations.empty()) {
184+
if (!relocs().empty()) {
185185
target->relocateAlloc(*this, buf);
186186
return;
187187
}
@@ -281,12 +281,12 @@ static ScanResult scanCortexA8Errata657417(InputSection *isec, uint64_t &off,
281281
// Find a relocation for the branch if it exists. This will be used
282282
// to determine the target.
283283
uint64_t branchOff = off + 4;
284-
auto relIt = llvm::find_if(isec->relocations, [=](const Relocation &r) {
284+
auto relIt = llvm::find_if(isec->relocs(), [=](const Relocation &r) {
285285
return r.offset == branchOff &&
286286
(r.type == R_ARM_THM_JUMP19 || r.type == R_ARM_THM_JUMP24 ||
287287
r.type == R_ARM_THM_CALL);
288288
});
289-
if (relIt != isec->relocations.end())
289+
if (relIt != isec->relocs().end())
290290
scanRes.rel = &(*relIt);
291291
if (branchDestInFirstRegion(isec, branchOff, instr2, scanRes.rel)) {
292292
if (patchInRange(isec, branchOff, instr2)) {
@@ -451,7 +451,7 @@ static void implementPatch(ScanResult sr, InputSection *isec,
451451
patchRelType = R_ARM_JUMP24;
452452
patchRelAddend -= 4;
453453
}
454-
psec->relocations.push_back(
454+
psec->addReloc(
455455
Relocation{sr.rel->expr, patchRelType, 0, patchRelAddend, sr.rel->sym});
456456
// Redirect the existing branch relocation to the patch.
457457
sr.rel->expr = R_PC;
@@ -470,8 +470,7 @@ static void implementPatch(ScanResult sr, InputSection *isec,
470470
type = R_ARM_THM_JUMP24;
471471
else
472472
type = R_ARM_THM_CALL;
473-
isec->relocations.push_back(
474-
Relocation{R_PC, type, sr.off, -4, psec->patchSym});
473+
isec->addReloc(Relocation{R_PC, type, sr.off, -4, psec->patchSym});
475474
}
476475
patches.push_back(psec);
477476
}

lld/ELF/Arch/AArch64.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -747,24 +747,24 @@ void AArch64::relocateAlloc(InputSectionBase &sec, uint8_t *buf) const {
747747
uint64_t secAddr = sec.getOutputSection()->addr;
748748
if (auto *s = dyn_cast<InputSection>(&sec))
749749
secAddr += s->outSecOff;
750-
AArch64Relaxer relaxer(sec.relocations);
751-
for (size_t i = 0, size = sec.relocations.size(); i != size; ++i) {
752-
const Relocation &rel = sec.relocations[i];
750+
AArch64Relaxer relaxer(sec.relocs());
751+
for (size_t i = 0, size = sec.relocs().size(); i != size; ++i) {
752+
const Relocation &rel = sec.relocs()[i];
753753
uint8_t *loc = buf + rel.offset;
754754
const uint64_t val =
755755
sec.getRelocTargetVA(sec.file, rel.type, rel.addend,
756756
secAddr + rel.offset, *rel.sym, rel.expr);
757757
switch (rel.expr) {
758758
case R_AARCH64_GOT_PAGE_PC:
759759
if (i + 1 < size &&
760-
relaxer.tryRelaxAdrpLdr(rel, sec.relocations[i + 1], secAddr, buf)) {
760+
relaxer.tryRelaxAdrpLdr(rel, sec.relocs()[i + 1], secAddr, buf)) {
761761
++i;
762762
continue;
763763
}
764764
break;
765765
case R_AARCH64_PAGE_PC:
766766
if (i + 1 < size &&
767-
relaxer.tryRelaxAdrpAdd(rel, sec.relocations[i + 1], secAddr, buf)) {
767+
relaxer.tryRelaxAdrpAdd(rel, sec.relocs()[i + 1], secAddr, buf)) {
768768
++i;
769769
continue;
770770
}

0 commit comments

Comments
 (0)