Skip to content

Commit 3bb5867

Browse files
committed
Fix formatting
Created using spr 1.3.5
2 parents 57a6b05 + ffc5d2b commit 3bb5867

File tree

1,379 files changed

+64903
-27184
lines changed

Some content is hidden

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

1,379 files changed

+64903
-27184
lines changed

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
# 2-3 hours to build on macOS, much slower than on Linux.
143143
# The long build time causes the release build to time out on x86_64,
144144
# so we need to disable flang there.
145-
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;bolt;polly;mlir'"
145+
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;polly;mlir'"
146146
fi
147147
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
148148
fi

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "bolt/Core/DynoStats.h"
1616
#include "bolt/Core/HashUtilities.h"
1717
#include "bolt/Core/MCPlusBuilder.h"
18+
#include "bolt/Utils/CommandLineOpts.h"
1819
#include "bolt/Utils/NameResolver.h"
1920
#include "bolt/Utils/NameShortener.h"
2021
#include "bolt/Utils/Utils.h"
@@ -1753,8 +1754,8 @@ void BinaryFunction::postProcessEntryPoints() {
17531754
// In non-relocation mode there's potentially an external undetectable
17541755
// reference to the entry point and hence we cannot move this entry
17551756
// point. Optimizing without moving could be difficult.
1756-
// In BAT mode, register any known entry points for CFG construction.
1757-
if (!BC.HasRelocations && !BC.HasBATSection)
1757+
// In aggregation, register any known entry points for CFG construction.
1758+
if (!BC.HasRelocations && !opts::AggregateOnly)
17581759
setSimple(false);
17591760

17601761
const uint32_t Offset = KV.first;

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,10 @@ bool DataAggregator::doTrace(const LBREntry &First, const LBREntry &Second,
831831
ParentFunc = FromFunc;
832832
ParentFunc->SampleCountInBytes += Count * (Second.From - First.To);
833833

834+
const uint64_t FuncAddress = FromFunc->getAddress();
834835
std::optional<BoltAddressTranslation::FallthroughListTy> FTs =
835-
BAT ? BAT->getFallthroughsInTrace(FromFunc->getAddress(), First.To,
836-
Second.From)
836+
BAT && BAT->isBATFunction(FuncAddress)
837+
? BAT->getFallthroughsInTrace(FuncAddress, First.To, Second.From)
837838
: getFallthroughsInTrace(*FromFunc, First, Second, Count);
838839
if (!FTs) {
839840
LLVM_DEBUG(

bolt/test/X86/bolt-address-translation-yaml.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ YAML-BAT-CHECK-NEXT: - bid: 0
6161
YAML-BAT-CHECK-NEXT: insns: 26
6262
YAML-BAT-CHECK-NEXT: hash: 0xA900AE79CFD40000
6363
YAML-BAT-CHECK-NEXT: succ: [ { bid: 3, cnt: 0 }, { bid: 1, cnt: 0 } ]
64+
# Check fallthroughs in non-BAT function
65+
YAML-BAT-CHECK-NEXT: - bid: 27
66+
YAML-BAT-CHECK-NEXT: insns: 3
67+
YAML-BAT-CHECK-NEXT: hash: 0x30A1EBA77A903F0
68+
YAML-BAT-CHECK-NEXT: succ: [ { bid: 28, cnt: 1 } ]
6469
# Calls from no-BAT to BAT function
6570
YAML-BAT-CHECK: - bid: 28
6671
YAML-BAT-CHECK-NEXT: insns: 13
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Checks that fallthroughs spanning entry points are accepted in aggregation
2+
## mode.
3+
4+
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
5+
# RUN: ld.lld %t.o -o %t
6+
# RUN: link_fdata %s %t %t.preagg PREAGG
7+
# RUN: perf2bolt %t -p %t.preagg --pa -o %t.fdata | FileCheck %s
8+
# CHECK: traces mismatching disassembled function contents: 0
9+
10+
.globl main
11+
main:
12+
.cfi_startproc
13+
vmovaps %zmm31,%zmm3
14+
15+
next:
16+
add $0x4,%r9
17+
add $0x40,%r10
18+
dec %r14
19+
Ljmp:
20+
jne main
21+
# PREAGG: T #Ljmp# #main# #Ljmp# 1
22+
ret
23+
.cfi_endproc
24+
.size main,.-main

bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

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

bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ f_crossbb1:
1515
1:
1616
ret
1717
.size f_crossbb1, .-f_crossbb1
18-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block .L{{[^,]+}}, at address
18+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block {{[^,]+}}, at address
1919
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
2020
// CHECK-NEXT: The 2 instructions that write to the return register after any authentication are:
2121
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -37,7 +37,7 @@ f_mergebb1:
3737
1:
3838
ret
3939
.size f_mergebb1, .-f_mergebb1
40-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block .L{{[^,]+}}, at address
40+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block {{[^,]+}}, at address
4141
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
4242
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
4343
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10

clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ clang_target_link_libraries(clangTidyBugproneModule
117117
clangASTMatchers
118118
clangBasic
119119
clangLex
120+
clangSema
120121
clangTooling
121122
clangTransformer
122123
)

clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "clang/Basic/Diagnostic.h"
2121
#include "clang/Basic/SourceLocation.h"
2222
#include "clang/Lex/Lexer.h"
23+
#include "clang/Sema/HeuristicResolver.h"
2324
#include "llvm/ADT/STLExtras.h"
2425
#include "llvm/ADT/SmallVector.h"
2526
#include "llvm/Support/Casting.h"
@@ -125,8 +126,8 @@ void StandaloneEmptyCheck::check(const MatchFinder::MatchResult &Result) {
125126
DeclarationName Name =
126127
Context.DeclarationNames.getIdentifier(&Context.Idents.get("clear"));
127128

128-
auto Candidates = MemberCall->getRecordDecl()->lookupDependentName(
129-
Name, [](const NamedDecl *ND) {
129+
auto Candidates = HeuristicResolver(Context).lookupDependentName(
130+
MemberCall->getRecordDecl(), Name, [](const NamedDecl *ND) {
130131
return isa<CXXMethodDecl>(ND) &&
131132
llvm::cast<CXXMethodDecl>(ND)->getMinRequiredArguments() ==
132133
0 &&
@@ -174,8 +175,8 @@ void StandaloneEmptyCheck::check(const MatchFinder::MatchResult &Result) {
174175
DeclarationName Name =
175176
Context.DeclarationNames.getIdentifier(&Context.Idents.get("clear"));
176177

177-
auto Candidates =
178-
ArgRecordDecl->lookupDependentName(Name, [](const NamedDecl *ND) {
178+
auto Candidates = HeuristicResolver(Context).lookupDependentName(
179+
ArgRecordDecl, Name, [](const NamedDecl *ND) {
179180
return isa<CXXMethodDecl>(ND) &&
180181
llvm::cast<CXXMethodDecl>(ND)->getMinRequiredArguments() ==
181182
0 &&

clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "UnnecessaryValueParamCheck.h"
10-
1110
#include "../utils/DeclRefExprUtils.h"
1211
#include "../utils/FixItHintUtils.h"
1312
#include "../utils/Matchers.h"
@@ -30,14 +29,6 @@ std::string paramNameOrIndex(StringRef Name, size_t Index) {
3029
.str();
3130
}
3231

33-
bool isReferencedOutsideOfCallExpr(const FunctionDecl &Function,
34-
ASTContext &Context) {
35-
auto Matches = match(declRefExpr(to(functionDecl(equalsNode(&Function))),
36-
unless(hasAncestor(callExpr()))),
37-
Context);
38-
return !Matches.empty();
39-
}
40-
4132
bool hasLoopStmtAncestor(const DeclRefExpr &DeclRef, const Decl &Decl,
4233
ASTContext &Context) {
4334
auto Matches = match(
@@ -155,12 +146,9 @@ void UnnecessaryValueParamCheck::handleConstRefFix(const FunctionDecl &Function,
155146
// Do not propose fixes when:
156147
// 1. the ParmVarDecl is in a macro, since we cannot place them correctly
157148
// 2. the function is virtual as it might break overrides
158-
// 3. the function is referenced outside of a call expression within the
159-
// compilation unit as the signature change could introduce build errors.
160-
// 4. the function is an explicit template/ specialization.
149+
// 3. the function is an explicit template/ specialization.
161150
const auto *Method = llvm::dyn_cast<CXXMethodDecl>(&Function);
162151
if (Param.getBeginLoc().isMacroID() || (Method && Method->isVirtual()) ||
163-
isReferencedOutsideOfCallExpr(Function, Context) ||
164152
Function.getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
165153
return;
166154
for (const auto *FunctionDecl = &Function; FunctionDecl != nullptr;

0 commit comments

Comments
 (0)