Skip to content

Commit a038c27

Browse files
authored
Merge branch 'main' into dependent-new-fix
2 parents d9069b0 + 47d42cf commit a038c27

File tree

2,315 files changed

+124707
-57475
lines changed

Some content is hidden

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

2,315 files changed

+124707
-57475
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,24 @@ jobs:
193193
**/crash_diagnostics/*
194194
195195
macos:
196-
runs-on: macos-14
197196
needs: [ stage1 ]
198197
strategy:
199-
fail-fast: true
198+
fail-fast: false
200199
matrix:
201-
config: [
202-
generic-cxx03,
203-
generic-cxx23,
204-
generic-modules,
205-
apple-configuration
206-
]
200+
include:
201+
- config: generic-cxx03
202+
os: macos-latest
203+
- config: generic-cxx23
204+
os: macos-latest
205+
- config: generic-modules
206+
os: macos-latest
207+
- config: apple-configuration
208+
os: macos-latest
209+
- config: apple-system
210+
os: macos-13
211+
- config: apple-system-hardened
212+
os: macos-13
213+
runs-on: ${{ matrix.os }}
207214
steps:
208215
- uses: actions/checkout@v4
209216
- uses: maxim-lobanov/setup-xcode@v1

.github/workflows/release-binaries-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ on:
4343
- '.github/workflows/release-binaries.yml'
4444
- '.github/workflows/release-binaries-setup-stage/*'
4545
- '.github/workflows/release-binaries-save-stage/*'
46+
- 'clang/cmake/caches/Release.cmake'
4647

4748
concurrency:
4849
group: ${{ github.workflow }}-${{ github.event.pull_request.number || 'dispatch' }}

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ bool shouldPrint(const BinaryFunction &Function) {
165165
}
166166
}
167167

168+
std::optional<StringRef> Origin = Function.getOriginSectionName();
169+
if (Origin && llvm::any_of(opts::PrintOnly, [&](const std::string &Name) {
170+
return Name == *Origin;
171+
}))
172+
return true;
173+
168174
return false;
169175
}
170176

bolt/test/AArch64/constant_island_pie_update.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.rela.exe -nostdlib \
99
# RUN: -Wl,-q -Wl,-z,notext
1010
# RUN: llvm-bolt %t.rela.exe -o %t.rela.bolt --use-old-text=0 --lite=0
11-
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.rela.bolt | FileCheck %s
11+
# RUN: llvm-objdump -j .text -d -z --show-all-symbols %t.rela.bolt | FileCheck %s
1212
# RUN: llvm-readelf -rsW %t.rela.bolt | FileCheck --check-prefix=ELFCHECK %s
1313
// .relr.dyn
1414
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.relr.exe -nostdlib \
1515
# RUN: -Wl,-q -Wl,-z,notext -Wl,--pack-dyn-relocs=relr
1616
# RUN: llvm-objcopy --remove-section .rela.mytext %t.relr.exe
1717
# RUN: llvm-bolt %t.relr.exe -o %t.relr.bolt --use-old-text=0 --lite=0
18-
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.relr.bolt | FileCheck %s
19-
# RUN: llvm-objdump -j .text -d %t.relr.bolt | \
18+
# RUN: llvm-objdump -j .text -d -z --show-all-symbols %t.relr.bolt | FileCheck %s
19+
# RUN: llvm-objdump -j .text -d -z %t.relr.bolt | \
2020
# RUN: FileCheck %s --check-prefix=ADDENDCHECK
2121
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=RELRELFCHECK %s
2222
# RUN: llvm-readelf -SW %t.relr.bolt | FileCheck --check-prefix=RELRSZCHECK %s

bolt/test/AArch64/update-weak-reference-symbol.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clang %cflags -Wl,-z,notext -shared -Wl,-q %s -o %t.so
44
// RUN: llvm-bolt %t.so -o %t.so.bolt
55
// RUN: llvm-nm -n %t.so.bolt > %t.out.txt
6-
// RUN: llvm-objdump -dj .rodata %t.so.bolt >> %t.out.txt
6+
// RUN: llvm-objdump -z -dj .rodata %t.so.bolt >> %t.out.txt
77
// RUN: FileCheck %s --input-file=%t.out.txt
88

99
# CHECK: w func_1

bolt/test/X86/print-only-section.s

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Check that --print-only flag works with sections.
2+
3+
# REQUIRES: system-linux
4+
5+
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
6+
# RUN: ld.lld %t.o -o %t.exe
7+
# RUN: llvm-bolt %t.exe -o %t.out --print-cfg --print-only=unused_code 2>&1 \
8+
# RUN: | FileCheck %s
9+
10+
# CHECK: Binary Function "foo"
11+
# CHECK-NOT: Binary Function "_start"
12+
13+
.text
14+
.globl _start
15+
.type _start, %function
16+
_start:
17+
.cfi_startproc
18+
ret
19+
.cfi_endproc
20+
.size _start, .-_start
21+
22+
.section unused_code,"ax",@progbits
23+
.globl foo
24+
.type foo, %function
25+
foo:
26+
.cfi_startproc
27+
ret
28+
.cfi_endproc
29+
.size foo, .-foo
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Test that merge-fdata correctly handles YAML header with an uninitialized
2+
## fields. a.yaml does not have hash-func set and it used to crash merge-fdata.
3+
4+
# REQUIRES: system-linux
5+
6+
# RUN: split-file %s %t
7+
# RUN: not merge-fdata %t/a.yaml %t/b.yaml 2>&1 | FileCheck %s
8+
9+
# CHECK: cannot merge profiles with different hash functions
10+
11+
#--- a.yaml
12+
---
13+
header:
14+
profile-version: 1
15+
binary-name: 'a.out'
16+
binary-build-id: '<unknown>'
17+
profile-flags: [ lbr ]
18+
profile-origin: branch profile reader
19+
profile-events: ''
20+
dfs-order: false
21+
functions:
22+
- name: 'main'
23+
fid: 1
24+
hash: 0x50BBA3441D436491
25+
exec: 1
26+
nblocks: 0
27+
...
28+
#--- b.yaml
29+
---
30+
header:
31+
profile-version: 1
32+
binary-name: 'a.out'
33+
binary-build-id: '<unknown>'
34+
profile-flags: [ lbr ]
35+
profile-origin: branch profile reader
36+
profile-events: ''
37+
dfs-order: false
38+
hash-func: xxh3
39+
functions:
40+
- name: 'main'
41+
fid: 1
42+
hash: 0x50BBA3441D436491
43+
exec: 1
44+
nblocks: 0
45+
...

bolt/tools/merge-fdata/merge-fdata.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ void mergeProfileHeaders(BinaryProfileHeader &MergedHeader,
145145
errs() << "WARNING: merging profiles with different sampling events\n";
146146
MergedHeader.EventNames += "," + Header.EventNames;
147147
}
148+
149+
if (MergedHeader.HashFunction != Header.HashFunction)
150+
report_error("merge conflict",
151+
"cannot merge profiles with different hash functions");
148152
}
149153

150154
void mergeBasicBlockProfile(BinaryBasicBlockProfile &MergedBB,
@@ -386,6 +390,7 @@ int main(int argc, char **argv) {
386390
// Merged information for all functions.
387391
StringMap<BinaryFunctionProfile> MergedBFs;
388392

393+
bool FirstHeader = true;
389394
for (std::string &InputDataFilename : Inputs) {
390395
ErrorOr<std::unique_ptr<MemoryBuffer>> MB =
391396
MemoryBuffer::getFileOrSTDIN(InputDataFilename);
@@ -409,7 +414,12 @@ int main(int argc, char **argv) {
409414
}
410415

411416
// Merge the header.
412-
mergeProfileHeaders(MergedHeader, BP.Header);
417+
if (FirstHeader) {
418+
MergedHeader = BP.Header;
419+
FirstHeader = false;
420+
} else {
421+
mergeProfileHeaders(MergedHeader, BP.Header);
422+
}
413423

414424
// Do the function merge.
415425
for (BinaryFunctionProfile &BF : BP.Functions) {

clang-tools-extra/clang-move/tool/ClangMove.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int main(int argc, const char **argv) {
199199
for (auto I = Files.begin(), E = Files.end(); I != E; ++I) {
200200
OS << " {\n";
201201
OS << " \"FilePath\": \"" << *I << "\",\n";
202-
const auto Entry = FileMgr.getFile(*I);
202+
const auto Entry = FileMgr.getOptionalFileRef(*I);
203203
auto ID = SM.translateFile(*Entry);
204204
std::string Content;
205205
llvm::raw_string_ostream ContentStream(Content);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ static std::string getNameOfNamespace(const CXXRecordDecl *Decl) {
107107
std::string Ns;
108108
llvm::raw_string_ostream OStream(Ns);
109109
NsDecl->printQualifiedName(OStream);
110-
OStream.flush();
111110
return Ns.empty() ? "(global)" : Ns;
112111
}
113112

0 commit comments

Comments
 (0)