Skip to content

Commit 7470905

Browse files
committed
MCInst::setFlags
Created using spr 1.3.5-bogner
2 parents 0cbaab6 + 0b533f2 commit 7470905

File tree

491 files changed

+24048
-20874
lines changed

Some content is hidden

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

491 files changed

+24048
-20874
lines changed

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ RUN powershell -Command \
8585
RUN git config --system core.longpaths true & \
8686
git config --global core.autocrlf false
8787
88-
ARG RUNNER_VERSION=2.325.0
88+
ARG RUNNER_VERSION=2.326.0
8989
ENV RUNNER_VERSION=$RUNNER_VERSION
9090
9191
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ WORKDIR /home/gha
8686

8787
FROM ci-container as ci-container-agent
8888

89-
ENV GITHUB_RUNNER_VERSION=2.325.0
89+
ENV GITHUB_RUNNER_VERSION=2.326.0
9090

9191
RUN mkdir actions-runner && \
9292
cd actions-runner && \

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,40 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
build_type: [Debug, Release, MinSizeRel]
18+
# Build basic linux configuration with Debug/Release/MinSizeRel and all
19+
# other configurations in Debug only.
1920
include:
2021
- os: ubuntu-24.04
22+
build_type: Debug
23+
ccache-variant: sccache
24+
c_compiler: clang-21
25+
cpp_compiler: clang++-21
26+
target: x86_64-unknown-linux-llvm
27+
include_scudo: ON
28+
- os: ubuntu-24.04
29+
build_type: Release
30+
ccache-variant: sccache
31+
c_compiler: clang-21
32+
cpp_compiler: clang++-21
33+
target: x86_64-unknown-linux-llvm
34+
include_scudo: ON
35+
- os: ubuntu-24.04
36+
build_type: MinSizeRel
2137
ccache-variant: sccache
2238
c_compiler: clang-21
2339
cpp_compiler: clang++-21
2440
target: x86_64-unknown-linux-llvm
2541
include_scudo: ON
2642
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
2743
- os: ubuntu-24.04-arm
44+
build_type: Debug
2845
ccache-variant: ccache
2946
c_compiler: clang-21
3047
cpp_compiler: clang++-21
3148
target: aarch64-unknown-linux-llvm
3249
include_scudo: ON
3350
- os: ubuntu-24.04
51+
build_type: Debug
3452
ccache-variant: ccache
3553
c_compiler: clang-21
3654
cpp_compiler: clang++-21
@@ -97,7 +115,7 @@ jobs:
97115
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
98116
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
99117
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
100-
-DLLVM_RUNTIMES_TARGET=${{ matrix.target }} \
118+
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
101119
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
102120
-DLLVM_LIBC_FULL_BUILD=ON \
103121
-G Ninja \

.github/workflows/libc-overlay-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
1717
fail-fast: false
1818
matrix:
19-
build_type: [Debug, Release, MinSizeRel]
19+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022, windows-2025, macos-14]
2020
include:
2121
# TODO: add linux gcc when it is fixed
2222
- os: ubuntu-24.04
@@ -96,7 +96,7 @@ jobs:
9696
cmake -B ${{ steps.strings.outputs.build-output-dir }}
9797
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9898
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
99-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99+
-DCMAKE_BUILD_TYPE=Debug
100100
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101101
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
102102
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
@@ -110,7 +110,6 @@ jobs:
110110
cmake
111111
--build ${{ steps.strings.outputs.build-output-dir }}
112112
--parallel
113-
--config MinSizeRel
114113
--target libc
115114
116115
- name: Test

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ class DataAggregator : public DataReader {
236236

237237
/// Launch a perf subprocess with given args and save output for later
238238
/// parsing.
239-
void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI,
240-
const char *ArgsString, bool Wait);
239+
void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, StringRef Args);
241240

242241
/// Delete all temporary files created to hold the output generated by spawned
243242
/// subprocesses during the aggregation job

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 48 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -197,34 +197,27 @@ void DataAggregator::start() {
197197

198198
if (opts::BasicAggregation) {
199199
launchPerfProcess("events without LBR", MainEventsPPI,
200-
"script -F pid,event,ip",
201-
/*Wait = */ false);
200+
"script -F pid,event,ip");
202201
} else if (!opts::ITraceAggregation.empty()) {
203202
// Disable parsing memory profile from trace data, unless requested by user.
204203
if (!opts::ParseMemProfile.getNumOccurrences())
205204
opts::ParseMemProfile = false;
206-
207-
std::string ItracePerfScriptArgs = llvm::formatv(
208-
"script -F pid,brstack --itrace={0}", opts::ITraceAggregation);
209205
launchPerfProcess("branch events with itrace", MainEventsPPI,
210-
ItracePerfScriptArgs.c_str(),
211-
/*Wait = */ false);
206+
"script -F pid,brstack --itrace=" +
207+
opts::ITraceAggregation);
212208
} else {
213-
launchPerfProcess("branch events", MainEventsPPI, "script -F pid,brstack",
214-
/*Wait = */ false);
209+
launchPerfProcess("branch events", MainEventsPPI, "script -F pid,brstack");
215210
}
216211

217212
if (opts::ParseMemProfile)
218-
launchPerfProcess("mem events", MemEventsPPI, "script -F pid,event,addr,ip",
219-
/*Wait = */ false);
213+
launchPerfProcess("mem events", MemEventsPPI,
214+
"script -F pid,event,addr,ip");
220215

221216
launchPerfProcess("process events", MMapEventsPPI,
222-
"script --show-mmap-events --no-itrace",
223-
/*Wait = */ false);
217+
"script --show-mmap-events --no-itrace");
224218

225219
launchPerfProcess("task events", TaskEventsPPI,
226-
"script --show-task-events --no-itrace",
227-
/*Wait = */ false);
220+
"script --show-task-events --no-itrace");
228221
}
229222

230223
void DataAggregator::abort() {
@@ -246,13 +239,13 @@ void DataAggregator::abort() {
246239
}
247240

248241
void DataAggregator::launchPerfProcess(StringRef Name, PerfProcessInfo &PPI,
249-
const char *ArgsString, bool Wait) {
242+
StringRef Args) {
250243
SmallVector<StringRef, 4> Argv;
251244

252245
outs() << "PERF2BOLT: spawning perf job to read " << Name << '\n';
253246
Argv.push_back(PerfPath.data());
254247

255-
StringRef(ArgsString).split(Argv, ' ');
248+
Args.split(Argv, ' ');
256249
Argv.push_back("-f");
257250
Argv.push_back("-i");
258251
Argv.push_back(Filename.c_str());
@@ -286,64 +279,45 @@ void DataAggregator::launchPerfProcess(StringRef Name, PerfProcessInfo &PPI,
286279
<< "\n";
287280
});
288281

289-
if (Wait)
290-
PPI.PI.ReturnCode = sys::ExecuteAndWait(PerfPath.data(), Argv,
291-
/*envp*/ std::nullopt, Redirects);
292-
else
293-
PPI.PI = sys::ExecuteNoWait(PerfPath.data(), Argv, /*envp*/ std::nullopt,
294-
Redirects);
282+
PPI.PI = sys::ExecuteNoWait(PerfPath.data(), Argv, /*envp*/ std::nullopt,
283+
Redirects);
295284
}
296285

297286
void DataAggregator::processFileBuildID(StringRef FileBuildID) {
287+
auto WarningCallback = [](int ReturnCode, StringRef ErrBuf) {
288+
errs() << "PERF-ERROR: return code " << ReturnCode << "\n" << ErrBuf;
289+
};
290+
298291
PerfProcessInfo BuildIDProcessInfo;
299-
launchPerfProcess("buildid list",
300-
BuildIDProcessInfo,
301-
"buildid-list",
302-
/*Wait = */true);
303-
304-
if (BuildIDProcessInfo.PI.ReturnCode != 0) {
305-
ErrorOr<std::unique_ptr<MemoryBuffer>> MB =
306-
MemoryBuffer::getFileOrSTDIN(BuildIDProcessInfo.StderrPath.data());
307-
StringRef ErrBuf = (*MB)->getBuffer();
308-
309-
errs() << "PERF-ERROR: return code " << BuildIDProcessInfo.PI.ReturnCode
310-
<< '\n';
311-
errs() << ErrBuf;
292+
launchPerfProcess("buildid list", BuildIDProcessInfo, "buildid-list");
293+
if (prepareToParse("buildid", BuildIDProcessInfo, WarningCallback))
312294
return;
313-
}
314295

315-
ErrorOr<std::unique_ptr<MemoryBuffer>> MB =
316-
MemoryBuffer::getFileOrSTDIN(BuildIDProcessInfo.StdoutPath.data());
317-
if (std::error_code EC = MB.getError()) {
318-
errs() << "Cannot open " << BuildIDProcessInfo.StdoutPath.data() << ": "
319-
<< EC.message() << "\n";
296+
std::optional<StringRef> FileName = getFileNameForBuildID(FileBuildID);
297+
if (FileName && *FileName == sys::path::filename(BC->getFilename())) {
298+
outs() << "PERF2BOLT: matched build-id and file name\n";
320299
return;
321300
}
322301

323-
FileBuf = std::move(*MB);
324-
ParsingBuf = FileBuf->getBuffer();
325-
326-
std::optional<StringRef> FileName = getFileNameForBuildID(FileBuildID);
327-
if (!FileName) {
328-
if (hasAllBuildIDs()) {
329-
errs() << "PERF2BOLT-ERROR: failed to match build-id from perf output. "
330-
"This indicates the input binary supplied for data aggregation "
331-
"is not the same recorded by perf when collecting profiling "
332-
"data, or there were no samples recorded for the binary. "
333-
"Use -ignore-build-id option to override.\n";
334-
if (!opts::IgnoreBuildID)
335-
abort();
336-
} else {
337-
errs() << "PERF2BOLT-WARNING: build-id will not be checked because perf "
338-
"data was recorded without it\n";
339-
return;
340-
}
341-
} else if (*FileName != llvm::sys::path::filename(BC->getFilename())) {
302+
if (FileName) {
342303
errs() << "PERF2BOLT-WARNING: build-id matched a different file name\n";
343304
BuildIDBinaryName = std::string(*FileName);
344-
} else {
345-
outs() << "PERF2BOLT: matched build-id and file name\n";
305+
return;
346306
}
307+
308+
if (!hasAllBuildIDs()) {
309+
errs() << "PERF2BOLT-WARNING: build-id will not be checked because perf "
310+
"data was recorded without it\n";
311+
return;
312+
}
313+
314+
errs() << "PERF2BOLT-ERROR: failed to match build-id from perf output. "
315+
"This indicates the input binary supplied for data aggregation "
316+
"is not the same recorded by perf when collecting profiling "
317+
"data, or there were no samples recorded for the binary. "
318+
"Use -ignore-build-id option to override.\n";
319+
if (!opts::IgnoreBuildID)
320+
abort();
347321
}
348322

349323
bool DataAggregator::checkPerfDataMagic(StringRef FileName) {
@@ -432,14 +406,24 @@ int DataAggregator::prepareToParse(StringRef Name, PerfProcessInfo &Process,
432406
std::string Error;
433407
outs() << "PERF2BOLT: waiting for perf " << Name
434408
<< " collection to finish...\n";
435-
sys::ProcessInfo PI = sys::Wait(Process.PI, std::nullopt, &Error);
409+
std::optional<sys::ProcessStatistics> PS;
410+
sys::ProcessInfo PI = sys::Wait(Process.PI, std::nullopt, &Error, &PS);
436411

437412
if (!Error.empty()) {
438413
errs() << "PERF-ERROR: " << PerfPath << ": " << Error << "\n";
439414
deleteTempFiles();
440415
exit(1);
441416
}
442417

418+
LLVM_DEBUG({
419+
const float UserSec = 1.f * PS->UserTime.count() / 1e6;
420+
const float TotalSec = 1.f * PS->TotalTime.count() / 1e6;
421+
const float PeakGiB = 1.f * PS->PeakMemory / (1 << 20);
422+
dbgs() << formatv("Finished in {0:f2}s user time, {1:f2}s total time, "
423+
"{2:f2} GiB peak RSS\n",
424+
UserSec, TotalSec, PeakGiB);
425+
});
426+
443427
if (PI.ReturnCode != 0) {
444428
ErrorOr<std::unique_ptr<MemoryBuffer>> ErrorMB =
445429
MemoryBuffer::getFileOrSTDIN(Process.StderrPath.data());

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void MisleadingSetterOfReferenceCheck::check(
5050
const MatchFinder::MatchResult &Result) {
5151
const auto *Found = Result.Nodes.getNodeAs<CXXMethodDecl>("bad-set-function");
5252
const auto *Member = Result.Nodes.getNodeAs<FieldDecl>("member");
53+
assert(Found != nullptr);
54+
assert(Member != nullptr);
5355

5456
diag(Found->getBeginLoc(),
5557
"function '%0' can be mistakenly used in order to change the "
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
:orphan:
22
:template: clangd_redirect.html
3-
:redirect_target: https://clangd.llvm.org/design.html
3+
:redirect_target: https://clangd.llvm.org/design/

clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
1313
// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' -quiet %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
1414

15-
// Check that `-header-filter` operates on the same file paths as paths in
16-
// diagnostics printed by ClangTidy.
15+
// `-header-filter` operates on the actual file path that the user provided in
16+
// the #include directive; however, Clang's path name simplification causes the
17+
// path to be printed in canonicalised form here.
1718
#include "dir1/dir2/../header_alias.h"
18-
// CHECK_HEADER_ALIAS: dir1/dir2/../header_alias.h:1:11: warning: single-argument constructors
19+
// CHECK_HEADER_ALIAS: dir1/header.h:1:11: warning: single-argument constructors
1920
// CHECK_HEADER-NOT: warning:

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ C Language Changes
249249
- The ``[[clang::assume()]]`` attribute is now correctly recognized in C. The
250250
``__attribute__((assume()))`` form has always been supported, so the fix is
251251
specific to the attribute syntax used.
252+
- The ``clang-cl`` driver now recognizes ``/std:clatest`` and sets the language
253+
mode to C23. (#GH147233)
252254

253255
C2y Feature Support
254256
^^^^^^^^^^^^^^^^^^^
@@ -306,6 +308,8 @@ C23 Feature Support
306308
which clarified how Clang is handling underspecified object declarations.
307309
- Clang now accepts single variadic parameter in type-name. It's a part of
308310
`WG14 N2975 <https://open-std.org/JTC1/SC22/WG14/www/docs/n2975.pdf>`_
311+
- Fixed a bug with handling the type operand form of ``typeof`` when it is used
312+
to specify a fixed underlying type for an enumeration. #GH146351
309313

310314
C11 Feature Support
311315
^^^^^^^^^^^^^^^^^^^
@@ -671,6 +675,8 @@ Improvements to Clang's diagnostics
671675
false positives in exception-heavy code, though only simple patterns
672676
are currently recognized.
673677

678+
- Clang now accepts ``@tparam`` comments on variable template partial
679+
specializations. (#GH144775)
674680

675681
Improvements to Clang's time-trace
676682
----------------------------------

0 commit comments

Comments
 (0)