Skip to content

Commit c862bd4

Browse files
committed
rebase
Created using spr 1.3.6
2 parents 3a37c92 + c83e932 commit c862bd4

File tree

679 files changed

+38472
-26854
lines changed

Some content is hidden

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

679 files changed

+38472
-26854
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
fetch-depth: 2
6161
- name: Get subprojects that have doc changes
6262
id: docs-changed-subprojects
63-
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
63+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
6464
with:
6565
skip_initial_fetch: true
6666
base_sha: 'HEAD~1'

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Get changed files
2727
id: changed-files
28-
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
28+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
2929
with:
3030
separator: ","
3131
skip_initial_fetch: true

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,8 @@ class MCPlusBuilder {
22162216
}
22172217

22182218
/// Print each annotation attached to \p Inst.
2219-
void printAnnotations(const MCInst &Inst, raw_ostream &OS) const;
2219+
void printAnnotations(const MCInst &Inst, raw_ostream &OS,
2220+
bool PrintMemData = false) const;
22202221

22212222
/// Remove annotation with a given \p Index.
22222223
///

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ void BinaryContext::printInstruction(raw_ostream &OS, const MCInst &Instruction,
20442044
if (MCSymbol *Label = MIB->getInstLabel(Instruction))
20452045
OS << " # Label: " << *Label;
20462046

2047-
MIB->printAnnotations(Instruction, OS);
2047+
MIB->printAnnotations(Instruction, OS, PrintMemData || opts::PrintMemData);
20482048

20492049
if (opts::PrintDebugInfo)
20502050
printDebugInfo(OS, Instruction, Function, DwCtx.get());

bolt/lib/Core/MCPlusBuilder.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ void MCPlusBuilder::stripAnnotations(MCInst &Inst, bool KeepTC) const {
378378
setTailCall(Inst);
379379
}
380380

381-
void MCPlusBuilder::printAnnotations(const MCInst &Inst,
382-
raw_ostream &OS) const {
381+
void MCPlusBuilder::printAnnotations(const MCInst &Inst, raw_ostream &OS,
382+
bool PrintMemData) const {
383383
std::optional<unsigned> FirstAnnotationOp = getFirstAnnotationOpIndex(Inst);
384384
if (!FirstAnnotationOp)
385385
return;
@@ -390,7 +390,11 @@ void MCPlusBuilder::printAnnotations(const MCInst &Inst,
390390
const int64_t Value = extractAnnotationValue(Imm);
391391
const auto *Annotation = reinterpret_cast<const MCAnnotation *>(Value);
392392
if (Index >= MCAnnotation::kGeneric) {
393-
OS << " # " << AnnotationNames[Index - MCAnnotation::kGeneric] << ": ";
393+
std::string AnnotationName =
394+
AnnotationNames[Index - MCAnnotation::kGeneric];
395+
if (!PrintMemData && AnnotationName == "MemoryAccessProfile")
396+
continue;
397+
OS << " # " << AnnotationName << ": ";
394398
Annotation->print(OS);
395399
}
396400
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Check that --print-mem-data option works properly in llvm-bolt
2+
3+
# RUN: split-file %s %t
4+
# RUN: %clang %cflags -fPIC -pie %t/main.s -o %t.exe -nostdlib -Wl,-q
5+
# RUN: llvm-bolt %t.exe -o %t.bolt --print-mem-data=true --print-cfg \
6+
# RUN: --data %t/fdata | FileCheck %s -check-prefix=CHECK-PRINT
7+
# RUN: llvm-bolt %t.exe -o %t.bolt --print-cfg \
8+
# RUN: --data %t/fdata | FileCheck %s -check-prefix=CHECK-DEFAULT
9+
10+
# CHECK-PRINT: ldr w2, [x1], #0x4 # MemoryAccessProfile: 7 total counts :
11+
# CHECK-PRINT-NEXT: { 0x123: 1 },
12+
# CHECK-PRINT-NEXT: { 0x456: 2 },
13+
# CHECK-PRINT-NEXT: { 0xabc: 4 }
14+
# CHECK-DEFAULT-NOT: MemoryAccessProfile
15+
16+
#--- main.s
17+
.text
18+
.align 4
19+
.global main
20+
.type main, %function
21+
main:
22+
sub sp, sp, #48
23+
add x1, sp, 8
24+
add x3, sp, 48
25+
mov w0, 0
26+
.L2:
27+
ldr w2, [x1], 4
28+
add w0, w0, w2
29+
cmp x1, x3
30+
bne .L2
31+
add sp, sp, 48
32+
ret
33+
.size main, .-main
34+
35+
# The three memory access data generated by the load at
36+
# offset 0x10 in the main.
37+
#--- fdata
38+
4 main 10 4 otherSym 123 1
39+
4 main 10 4 otherSym 456 2
40+
4 main 10 4 otherSym abc 4

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ class RenamerClangTidyVisitor
350350
const TemplateDecl *Decl =
351351
Loc.getTypePtr()->getTemplateName().getAsTemplateDecl(
352352
/*IgnoreDeduced=*/true);
353+
if (!Decl)
354+
return true;
353355

354356
if (const auto *ClassDecl = dyn_cast<TemplateDecl>(Decl))
355357
if (const NamedDecl *TemplDecl = ClassDecl->getTemplatedDecl())

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,6 @@ struct TargetFinder {
406406
}
407407
}
408408
}
409-
void VisitDependentTemplateSpecializationType(
410-
const DependentTemplateSpecializationType *DTST) {
411-
if (Outer.Resolver) {
412-
for (const NamedDecl *ND :
413-
Outer.Resolver->resolveTemplateSpecializationType(DTST)) {
414-
Outer.add(ND, Flags);
415-
}
416-
}
417-
}
418409
void VisitTypedefType(const TypedefType *TT) {
419410
if (shouldSkipTypedef(TT->getDecl()))
420411
return;
@@ -455,11 +446,13 @@ struct TargetFinder {
455446
// class template specializations have a (specialized) CXXRecordDecl.
456447
else if (const CXXRecordDecl *RD = TST->getAsCXXRecordDecl())
457448
Outer.add(RD, Flags); // add(Decl) will despecialize if needed.
458-
else {
449+
else if (auto *TD = TST->getTemplateName().getAsTemplateDecl())
459450
// fallback: the (un-specialized) declaration from primary template.
460-
if (auto *TD = TST->getTemplateName().getAsTemplateDecl())
461-
Outer.add(TD->getTemplatedDecl(), Flags | Rel::TemplatePattern);
462-
}
451+
Outer.add(TD->getTemplatedDecl(), Flags | Rel::TemplatePattern);
452+
else if (Outer.Resolver)
453+
for (const NamedDecl *ND :
454+
Outer.Resolver->resolveTemplateSpecializationType(TST))
455+
Outer.add(ND, Flags);
463456
}
464457
void
465458
VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT) {
@@ -900,15 +893,6 @@ refInTypeLoc(TypeLoc L, const HeuristicResolver *Resolver) {
900893
DeclRelation::Alias, Resolver)});
901894
}
902895

903-
void VisitDependentTemplateSpecializationTypeLoc(
904-
DependentTemplateSpecializationTypeLoc L) {
905-
Refs.push_back(
906-
ReferenceLoc{L.getQualifierLoc(), L.getTemplateNameLoc(),
907-
/*IsDecl=*/false,
908-
explicitReferenceTargets(
909-
DynTypedNode::create(L.getType()), {}, Resolver)});
910-
}
911-
912896
void VisitDependentNameTypeLoc(DependentNameTypeLoc L) {
913897
Refs.push_back(
914898
ReferenceLoc{L.getQualifierLoc(), L.getNameLoc(),

clang-tools-extra/clangd/SemanticHighlighting.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,6 @@ class CollectExtraHighlightings
728728
return true;
729729
}
730730

731-
bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc L) {
732-
H.addAngleBracketTokens(L.getLAngleLoc(), L.getRAngleLoc());
733-
return true;
734-
}
735-
736731
bool VisitFunctionDecl(FunctionDecl *D) {
737732
if (D->isOverloadedOperator()) {
738733
const auto AddOpDeclToken = [&](SourceLocation Loc) {
@@ -1087,11 +1082,12 @@ class CollectExtraHighlightings
10871082
return true;
10881083
}
10891084

1090-
bool VisitDependentTemplateSpecializationTypeLoc(
1091-
DependentTemplateSpecializationTypeLoc L) {
1092-
H.addToken(L.getTemplateNameLoc(), HighlightingKind::Type)
1093-
.addModifier(HighlightingModifier::DependentName)
1094-
.addModifier(HighlightingModifier::ClassScope);
1085+
bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc L) {
1086+
if (!L.getTypePtr()->getTemplateName().getAsTemplateDecl(
1087+
/*IgnoreDeduced=*/true))
1088+
H.addToken(L.getTemplateNameLoc(), HighlightingKind::Type)
1089+
.addModifier(HighlightingModifier::DependentName)
1090+
.addModifier(HighlightingModifier::ClassScope);
10951091
H.addAngleBracketTokens(L.getLAngleLoc(), L.getRAngleLoc());
10961092
return true;
10971093
}

0 commit comments

Comments
 (0)