Skip to content

Commit 04b84cb

Browse files
authored
Merge branch 'main' into mbstowcs-implementation
2 parents 8a9fe43 + 04a44fe commit 04b84cb

File tree

830 files changed

+31563
-19190
lines changed

Some content is hidden

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

830 files changed

+31563
-19190
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@
120120
/mlir/**/Index* @mogball
121121

122122
# MLIR Python Bindings
123-
/mlir/test/python/ @ftynse @makslevental @stellaraccident
124-
/mlir/python/ @ftynse @makslevental @stellaraccident
123+
/mlir/test/python/ @ftynse @makslevental @stellaraccident @rolfmorel
124+
/mlir/python/ @ftynse @makslevental @stellaraccident @rolfmorel
125+
/mlir/lib/Bindings/Python @makslevental @rolfmorel
125126

126127
# MLIR Mem2Reg/SROA
127128
/mlir/**/Transforms/Mem2Reg.* @moxinilian

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ RUN apt-get update && \
5858
python3-psutil \
5959
sudo \
6060
# These are needed by the premerge pipeline. Pip is used to install
61-
# dependent python packages and ccache is used for build caching. File and
62-
# tzdata are used for tests.
61+
# dependent python packages. File and tzdata are used for tests.
6362
python3-pip \
64-
ccache \
6563
file \
6664
tzdata && \
6765
apt-get clean && \

.github/workflows/libcxx-build-containers.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ on:
1818
- 'libcxx/utils/ci/**'
1919
- '.github/workflows/libcxx-build-containers.yml'
2020
pull_request:
21-
branches:
22-
- main
2321
paths:
2422
- 'libcxx/utils/ci/**'
2523
- '.github/workflows/libcxx-build-containers.yml'

.github/workflows/premerge.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
# why we do not hardcode it.
6363
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
6464
export SCCACHE_GCS_RW_MODE=READ_WRITE
65+
66+
# Set the idle timeout to zero to ensure sccache runs for the
67+
# entire duration of the job. Otherwise it might stop if we run
68+
# several test suites in a row and discard statistics that we want
69+
# to save in the end.
70+
export SCCACHE_IDLE_TIMEOUT=0
6571
sccache --start-server
6672
6773
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
@@ -110,7 +116,9 @@ jobs:
110116
shell: cmd
111117
run: |
112118
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
113-
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
119+
# See the comments above in the Linux job for why we define each of
120+
# these environment variables.
121+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
114122
- name: Upload Artifacts
115123
if: '!cancelled()'
116124
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

.github/workflows/release-asset-audit.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ jobs:
2222
runs-on: ubuntu-24.04
2323
if: github.repository == 'llvm/llvm-project'
2424
steps:
25-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
25+
- name: Checkout LLVM
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
sparse-checkout: |
29+
.github/workflows/release-asset-audit.py
30+
llvm/utils/git/requirements.txt
2631
- name: "Run Audit Script"
2732
env:
2833
GITHUB_TOKEN: ${{ github.token }}

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,11 +906,10 @@ DataAggregator::getFallthroughsInTrace(BinaryFunction &BF, const Trace &Trace,
906906
if (BF.isPseudo())
907907
return Branches;
908908

909-
if (!BF.isSimple())
909+
// Can only record traces in CFG state
910+
if (!BF.hasCFG())
910911
return std::nullopt;
911912

912-
assert(BF.hasCFG() && "can only record traces in CFG state");
913-
914913
const BinaryBasicBlock *FromBB = BF.getBasicBlockContainingOffset(From);
915914
const BinaryBasicBlock *ToBB = BF.getBasicBlockContainingOffset(To);
916915

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -714,21 +714,6 @@ Error RewriteInstance::run() {
714714

715715
preprocessProfileData();
716716

717-
// Skip disassembling if we have a translation table and we are running an
718-
// aggregation job.
719-
if (opts::AggregateOnly && BAT->enabledFor(InputFile)) {
720-
// YAML profile in BAT mode requires CFG for .bolt.org.text functions
721-
if (!opts::SaveProfile.empty() ||
722-
opts::ProfileFormat == opts::ProfileFormatKind::PF_YAML) {
723-
selectFunctionsToProcess();
724-
disassembleFunctions();
725-
processMetadataPreCFG();
726-
buildFunctionsCFG();
727-
}
728-
processProfileData();
729-
return Error::success();
730-
}
731-
732717
selectFunctionsToProcess();
733718

734719
readDebugInfo();

bolt/test/X86/unclaimed-jt-entries.s

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818

1919
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
2020
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
21+
22+
## Check that non-simple function profile is emitted in perf2bolt mode
23+
# RUN: link_fdata %s %t.exe %t.pa PREAGG
24+
# RUN: llvm-strip -N L5 -N L5_ret %t.exe
25+
# RUN: perf2bolt %t.exe -p %t.pa --pa -o %t.fdata -strict=0 -print-profile \
26+
# RUN: -print-only=main | FileCheck %s --check-prefix=CHECK-P2B
27+
# CHECK-P2B: PERF2BOLT: traces mismatching disassembled function contents: 0
28+
# CHECK-P2B: Binary Function "main"
29+
# CHECK-P2B: IsSimple : 0
30+
# RUN: FileCheck %s --input-file %t.fdata --check-prefix=CHECK-FDATA
31+
# CHECK-FDATA: 1 main 0 1 main 7 0 1
32+
2133
# RUN: llvm-bolt %t.exe -v=1 -o %t.out 2>&1 | FileCheck %s
2234

2335
# CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in main
@@ -33,8 +45,10 @@
3345
.size main, .Lend-main
3446
main:
3547
jmp *L4-24(,%rdi,8)
36-
.L5:
48+
# PREAGG: T #main# #L5# #L5_ret# 1
49+
L5:
3750
movl $4, %eax
51+
L5_ret:
3852
ret
3953
.L9:
4054
movl $2, %eax
@@ -58,7 +72,7 @@ L4:
5872
.quad .L3
5973
.quad .L6
6074
.quad .L3
61-
.quad .L5
75+
.quad L5
6276
.quad .L3
6377
.quad .L3
6478
.quad .L3

clang-tools-extra/clang-doc/JSONGenerator.cpp

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,39 @@ serializeLocation(const Location &Loc,
8383
return LocationObj;
8484
}
8585

86-
static json::Value serializeComment(const CommentInfo &I) {
86+
static void insertComment(Object &Description, json::Value &Comment,
87+
StringRef Key) {
88+
auto DescriptionIt = Description.find(Key);
89+
90+
if (DescriptionIt == Description.end()) {
91+
auto CommentsArray = json::Array();
92+
CommentsArray.push_back(Comment);
93+
Description[Key] = std::move(CommentsArray);
94+
Description["Has" + Key.str()] = true;
95+
} else {
96+
DescriptionIt->getSecond().getAsArray()->push_back(Comment);
97+
}
98+
}
99+
100+
static json::Value extractTextComments(Object *ParagraphComment) {
101+
if (!ParagraphComment)
102+
return json::Object();
103+
return *ParagraphComment->get("Children");
104+
}
105+
106+
static json::Value extractVerbatimComments(json::Array VerbatimLines) {
107+
json::Value TextArray = json::Array();
108+
auto &TextArrayRef = *TextArray.getAsArray();
109+
for (auto &Line : VerbatimLines)
110+
TextArrayRef.push_back(*Line.getAsObject()
111+
->get("VerbatimBlockLineComment")
112+
->getAsObject()
113+
->get("Text"));
114+
115+
return TextArray;
116+
}
117+
118+
static Object serializeComment(const CommentInfo &I, Object &Description) {
87119
// taken from PR #142273
88120
Object Obj = Object();
89121

@@ -94,7 +126,7 @@ static json::Value serializeComment(const CommentInfo &I) {
94126
auto &CARef = *ChildArr.getAsArray();
95127
CARef.reserve(I.Children.size());
96128
for (const auto &C : I.Children)
97-
CARef.emplace_back(serializeComment(*C));
129+
CARef.emplace_back(serializeComment(*C, Description));
98130

99131
switch (I.Kind) {
100132
case CommentKind::CK_TextComment: {
@@ -103,9 +135,11 @@ static json::Value serializeComment(const CommentInfo &I) {
103135
}
104136

105137
case CommentKind::CK_BlockCommandComment: {
106-
Child.insert({"Command", I.Name});
107-
Child.insert({"Children", ChildArr});
108-
Obj.insert({commentKindToString(I.Kind), ChildVal});
138+
auto TextCommentsArray = extractTextComments(CARef.front().getAsObject());
139+
if (I.Name == "brief")
140+
insertComment(Description, TextCommentsArray, "BriefComments");
141+
else if (I.Name == "return")
142+
insertComment(Description, TextCommentsArray, "ReturnComments");
109143
return Obj;
110144
}
111145

@@ -127,17 +161,20 @@ static json::Value serializeComment(const CommentInfo &I) {
127161
Child.insert({"ParamName", I.ParamName});
128162
Child.insert({"Direction", I.Direction});
129163
Child.insert({"Explicit", I.Explicit});
130-
Child.insert({"Children", ChildArr});
131-
Obj.insert({commentKindToString(I.Kind), ChildVal});
164+
auto TextCommentsArray = extractTextComments(CARef.front().getAsObject());
165+
Child.insert({"Children", TextCommentsArray});
166+
if (I.Kind == CommentKind::CK_ParamCommandComment)
167+
insertComment(Description, ChildVal, "ParamComments");
132168
return Obj;
133169
}
134170

135171
case CommentKind::CK_VerbatimBlockComment: {
136-
Child.insert({"Text", I.Text});
137-
if (!I.CloseName.empty())
138-
Child.insert({"CloseName", I.CloseName});
139-
Child.insert({"Children", ChildArr});
140-
Obj.insert({commentKindToString(I.Kind), ChildVal});
172+
if (I.CloseName == "endcode") {
173+
// We don't support \code language specification
174+
auto TextCommentsArray = extractVerbatimComments(CARef);
175+
insertComment(Description, TextCommentsArray, "CodeComments");
176+
} else if (I.CloseName == "endverbatim")
177+
insertComment(Description, ChildVal, "VerbatimComments");
141178
return Obj;
142179
}
143180

@@ -179,8 +216,8 @@ static json::Value serializeComment(const CommentInfo &I) {
179216
case CommentKind::CK_FullComment:
180217
case CommentKind::CK_ParagraphComment: {
181218
Child.insert({"Children", ChildArr});
182-
Obj.insert({commentKindToString(I.Kind), ChildVal});
183-
return Obj;
219+
Child["ParagraphComment"] = true;
220+
return Child;
184221
}
185222

186223
case CommentKind::CK_Unknown: {
@@ -210,12 +247,20 @@ serializeCommonAttributes(const Info &I, json::Object &Obj,
210247
}
211248

212249
if (!I.Description.empty()) {
213-
json::Value DescArray = json::Array();
214-
auto &DescArrayRef = *DescArray.getAsArray();
215-
DescArrayRef.reserve(I.Description.size());
216-
for (const auto &Comment : I.Description)
217-
DescArrayRef.push_back(serializeComment(Comment));
218-
Obj["Description"] = DescArray;
250+
Object Description = Object();
251+
// Skip straight to the FullComment's children
252+
auto &Comments = I.Description.at(0).Children;
253+
for (const auto &CommentInfo : Comments) {
254+
json::Value Comment = serializeComment(*CommentInfo, Description);
255+
// if a ParagraphComment is returned, then it is a top-level comment that
256+
// needs to be inserted manually.
257+
if (auto *ParagraphComment = Comment.getAsObject();
258+
ParagraphComment->get("ParagraphComment")) {
259+
auto TextCommentsArray = extractTextComments(ParagraphComment);
260+
insertComment(Description, TextCommentsArray, "ParagraphComments");
261+
}
262+
}
263+
Obj["Description"] = std::move(Description);
219264
}
220265

221266
// Namespaces aren't SymbolInfos, so they dont have a DefLoc

clang-tools-extra/clang-doc/assets/clang-doc-mustache.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,3 +469,7 @@ a, a:visited, a:hover, a:active {
469469
text-decoration: none;
470470
color: inherit;
471471
}
472+
473+
.code-block {
474+
white-space: pre-line;
475+
}

0 commit comments

Comments
 (0)