Skip to content

Commit 15f4f49

Browse files
author
joaosaffran
committed
Merge branch 'main' into metadata/descriptor-table
2 parents e8066df + 2ab9c35 commit 15f4f49

File tree

4,380 files changed

+157526
-72836
lines changed

Some content is hidden

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

4,380 files changed

+157526
-72836
lines changed

.ci/compute_projects.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
".ci": {"llvm", "clang", "lld", "lldb"},
5858
}
5959

60+
# This mapping describes runtimes that should be enabled for a specific project,
61+
# but not necessarily run for testing. The only case of this currently is lldb
62+
# which needs some runtimes enabled for tests.
63+
DEPENDENT_RUNTIMES_TO_BUILD = {"lldb": {"libcxx", "libcxxabi", "libunwind"}}
64+
65+
# This mapping describes runtimes that should be tested when the key project is
66+
# touched.
6067
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
6168

6269
EXCLUDE_LINUX = {
@@ -180,16 +187,20 @@ def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
180187
def _compute_runtimes_to_test(projects_to_test: Set[str]) -> Set[str]:
181188
runtimes_to_test = set()
182189
for project_to_test in projects_to_test:
183-
if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST:
184-
continue
185-
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_TEST[project_to_test])
190+
if project_to_test in DEPENDENT_RUNTIMES_TO_TEST:
191+
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_TEST[project_to_test])
192+
if project_to_test in DEPENDENT_RUNTIMES_TO_BUILD:
193+
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_BUILD[project_to_test])
186194
return runtimes_to_test
187195

188196

189-
def _compute_runtime_check_targets(runtimes_to_test: Set[str]) -> Set[str]:
197+
def _compute_runtime_check_targets(projects_to_test: Set[str]) -> Set[str]:
190198
check_targets = set()
191-
for runtime_to_test in runtimes_to_test:
192-
check_targets.add(PROJECT_CHECK_TARGETS[runtime_to_test])
199+
for project_to_test in projects_to_test:
200+
if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST:
201+
continue
202+
for runtime_to_test in DEPENDENT_RUNTIMES_TO_TEST[project_to_test]:
203+
check_targets.add(PROJECT_CHECK_TARGETS[runtime_to_test])
193204
return check_targets
194205

195206

@@ -216,16 +227,16 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
216227
projects_to_test = _compute_projects_to_test(modified_projects, platform)
217228
projects_to_build = _compute_projects_to_build(projects_to_test)
218229
projects_check_targets = _compute_project_check_targets(projects_to_test)
219-
runtimes_to_test = _compute_runtimes_to_test(projects_to_test)
220-
runtimes_check_targets = _compute_runtime_check_targets(runtimes_to_test)
230+
runtimes_to_build = _compute_runtimes_to_test(projects_to_test)
231+
runtimes_check_targets = _compute_runtime_check_targets(projects_to_test)
221232
# We use a semicolon to separate the projects/runtimes as they get passed
222233
# to the CMake invocation and thus we need to use the CMake list separator
223234
# (;). We use spaces to separate the check targets as they end up getting
224235
# passed to ninja.
225236
return {
226237
"projects_to_build": ";".join(sorted(projects_to_build)),
227238
"project_check_targets": " ".join(sorted(projects_check_targets)),
228-
"runtimes_to_build": ";".join(sorted(runtimes_to_test)),
239+
"runtimes_to_build": ";".join(sorted(runtimes_to_build)),
229240
"runtimes_check_targets": " ".join(sorted(runtimes_check_targets)),
230241
}
231242

.ci/compute_projects_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ def test_ci(self):
205205
"check-cxx check-cxxabi check-unwind",
206206
)
207207

208+
def test_lldb(self):
209+
env_variables = compute_projects.get_env_variables(
210+
["lldb/CMakeLists.txt"], "Linux"
211+
)
212+
self.assertEqual(env_variables["projects_to_build"], "clang;lldb;llvm")
213+
self.assertEqual(env_variables["project_check_targets"], "check-lldb")
214+
self.assertEqual(
215+
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
216+
)
217+
self.assertEqual(env_variables["runtimes_check_targets"], "")
218+
208219

209220
if __name__ == "__main__":
210221
unittest.main()

.ci/monolithic-linux.sh

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ trap at-exit EXIT
5555

5656
projects="${1}"
5757
targets="${2}"
58+
runtimes="${3}"
59+
runtime_targets="${4}"
5860

5961
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
6062

@@ -70,7 +72,7 @@ export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
7072
# It will not be built unless it is used.
7173
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7274
-D LLVM_ENABLE_PROJECTS="${projects}" \
73-
-D LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
75+
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
7476
-G Ninja \
7577
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
7678
-D CMAKE_BUILD_TYPE=Release \
@@ -91,62 +93,28 @@ echo "--- ninja"
9193
# Targets are not escaped as they are passed as separate arguments.
9294
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9395

94-
runtimes="${3}"
95-
runtime_targets="${4}"
96-
9796
# Compiling runtimes with just-built Clang and running their tests
9897
# as an additional testing for Clang.
99-
if [[ "${runtimes}" != "" ]]; then
100-
if [[ "${runtime_targets}" == "" ]]; then
101-
echo "Runtimes to build are specified, but targets are not."
102-
exit 1
103-
fi
104-
105-
echo "--- ninja install-clang"
106-
107-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
108-
109-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
110-
INSTALL_DIR="${BUILD_DIR}/install"
111-
mkdir -p ${RUNTIMES_BUILD_DIR}
112-
98+
if [[ "${runtimes_targets}" != "" ]]; then
11399
echo "--- cmake runtimes C++26"
114100

115-
rm -rf "${RUNTIMES_BUILD_DIR}"
116-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
117-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
118-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
119-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
120-
-D LIBCXX_CXX_ABI=libcxxabi \
121-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
122-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
123-
-D LIBCXX_TEST_PARAMS="std=c++26" \
124-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
125-
-D LLVM_LIT_ARGS="${lit_args}"
101+
cmake \
102+
-D LIBCXX_TEST_PARAMS="std=c++26" \
103+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
104+
"${BUILD_DIR}"
126105

127106
echo "--- ninja runtimes C++26"
128107

129-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
108+
ninja -C "${BUILD_DIR}" ${runtime_targets}
130109

131110
echo "--- cmake runtimes clang modules"
132111

133-
# We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
134-
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
135-
# propagates without a clean build. Other that those two variables, builds
136-
# are supposed to be the same.
137-
138-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
139-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
140-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
141-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
142-
-D LIBCXX_CXX_ABI=libcxxabi \
143-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
144-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
145-
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
146-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
147-
-D LLVM_LIT_ARGS="${lit_args}"
112+
cmake \
113+
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
114+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
115+
"${BUILD_DIR}"
148116

149117
echo "--- ninja runtimes clang modules"
150118

151-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
119+
ninja -C "${BUILD_DIR}" ${runtime_targets}
152120
fi

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
100100

101101
# [lldb][NFC] clang-format MainLoopPosix.cpp
102102
66bdbfbaa08fa3d8e64a7fe136a8fb717f5cdbb7
103+
104+
# [clang-tidy][NFC] Run clang-format on "clang-tools-extra/clang-tidy"
105+
65d66625b3e2b8322ed99d82edabecbafcd0885b
106+
ce46adb8b7ce645353eccaedf31ed9765dab77bb
107+
68070f908bb7ac5f0b5fa9722caa504ecf723f6b
108+
5213c57cb1f0d78aad9a253b7f6a2b62ff4c7859

.github/workflows/email-check.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
COMMENT: >-
3333
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
3434
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35-
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
35+
See [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html#email-addresses) and
36+
[LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
3637
run: |
3738
cat << EOF > comments
3839
[{"body" : "$COMMENT"}]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
55-
cc: 'gcc-14'
56-
cxx: 'g++-14'
55+
cc: 'gcc-15'
56+
cxx: 'g++-15'
5757
steps:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
@@ -92,8 +92,8 @@ jobs:
9292
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
95-
cc: 'gcc-14'
96-
cxx: 'g++-14'
95+
cc: 'gcc-15'
96+
cxx: 'g++-15'
9797
- config: 'generic-cxx26'
9898
cc: 'clang-20'
9999
cxx: 'clang++-20'

bolt/include/bolt/Core/BinaryBasicBlock.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ class BinaryBasicBlock {
5252
uint64_t MispredictedCount; /// number of branches mispredicted
5353

5454
bool operator<(const BinaryBranchInfo &Other) const {
55-
return (Count < Other.Count) ||
56-
(Count == Other.Count &&
57-
MispredictedCount < Other.MispredictedCount);
55+
return std::tie(Count, MispredictedCount) <
56+
std::tie(Other.Count, Other.MispredictedCount);
5857
}
5958
};
6059

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ class BinaryFunction {
388388
/// The profile data for the number of times the function was executed.
389389
uint64_t ExecutionCount{COUNT_NO_PROFILE};
390390

391+
/// Profile data for the number of times this function was entered from
392+
/// external code (DSO, JIT, etc).
393+
uint64_t ExternEntryCount{0};
394+
391395
/// Profile match ratio.
392396
float ProfileMatchRatio{0.0f};
393397

@@ -1877,6 +1881,10 @@ class BinaryFunction {
18771881
return *this;
18781882
}
18791883

1884+
/// Set the profile data for the number of times the function was entered from
1885+
/// external code (DSO/JIT).
1886+
void setExternEntryCount(uint64_t Count) { ExternEntryCount = Count; }
1887+
18801888
/// Adjust execution count for the function by a given \p Count. The value
18811889
/// \p Count will be subtracted from the current function count.
18821890
///
@@ -1904,6 +1912,10 @@ class BinaryFunction {
19041912
/// Return COUNT_NO_PROFILE if there's no profile info.
19051913
uint64_t getExecutionCount() const { return ExecutionCount; }
19061914

1915+
/// Return the profile information about the number of times the function was
1916+
/// entered from external code (DSO/JIT).
1917+
uint64_t getExternEntryCount() const { return ExternEntryCount; }
1918+
19071919
/// Return the raw profile information about the number of branch
19081920
/// executions corresponding to this function.
19091921
uint64_t getRawSampleCount() const { return RawSampleCount; }

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ class MCPlusBuilder {
405405

406406
bool equals(const MCExpr &A, const MCExpr &B, CompFuncTy Comp) const;
407407

408-
virtual bool equals(const MCTargetExpr &A, const MCTargetExpr &B,
408+
virtual bool equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
409409
CompFuncTy Comp) const;
410410

411411
virtual bool isBranch(const MCInst &Inst) const {

bolt/include/bolt/Passes/PAuthGadgetScanner.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ struct MCInstInBFReference {
7777
return BF == RHS.BF && Offset == RHS.Offset;
7878
}
7979
bool operator<(const MCInstInBFReference &RHS) const {
80-
if (BF != RHS.BF)
81-
return BF < RHS.BF;
82-
return Offset < RHS.Offset;
80+
return std::tie(BF, Offset) < std::tie(RHS.BF, RHS.Offset);
8381
}
8482
operator MCInst &() const {
8583
assert(BF != nullptr);

0 commit comments

Comments
 (0)