Skip to content

Commit a356390

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents 2f1d47b + 1c4341d commit a356390

File tree

95 files changed

+1635
-414
lines changed

Some content is hidden

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

95 files changed

+1635
-414
lines changed

.github/workflows/premerge.yaml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.repository_owner == 'llvm'
1717
runs-on: llvm-premerge-linux-runners
1818
concurrency:
19-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
19+
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }}
2020
cancel-in-progress: true
2121
steps:
2222
- name: Checkout LLVM
@@ -70,3 +70,65 @@ jobs:
7070
export CXX=/opt/llvm/bin/clang++
7171
7272
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
73+
74+
premerge-checks-windows:
75+
if: github.repository_owner == 'llvm'
76+
runs-on: llvm-premerge-windows-runners
77+
concurrency:
78+
group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }}
79+
cancel-in-progress: true
80+
defaults:
81+
run:
82+
shell: bash
83+
steps:
84+
- name: Checkout LLVM
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 2
88+
- name: Setup ccache
89+
uses: hendrikmuhs/[email protected]
90+
with:
91+
variant: "sccache"
92+
max-size: "2000M"
93+
- name: Compute Projects
94+
id: vars
95+
run: |
96+
modified_files=$(git diff --name-only HEAD~1...HEAD)
97+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort | uniq)
98+
99+
echo $modified_files
100+
echo $modified_dirs
101+
102+
. ./.ci/compute-projects.sh
103+
104+
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
105+
modified_projects="$(keep-modified-projects ${all_projects})"
106+
107+
windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects}))
108+
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ' ')
109+
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ';')
110+
111+
if [[ "${windows_projects}" == "" ]]; then
112+
echo "No projects to build"
113+
fi
114+
115+
echo "Building projects: ${windows_projects}"
116+
echo "Running project checks targets: ${windows_check_targets}"
117+
118+
echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT
119+
echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT
120+
- name: Build and Test
121+
# Mark the job as a success even if the step fails so that people do
122+
# not get notified while the new premerge pipeline is in an
123+
# experimental state.
124+
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
125+
# are ready for people to start recieving notifications.
126+
continue-on-error: true
127+
if: ${{ steps.vars.outputs.windows-projects != '' }}
128+
shell: cmd
129+
run: |
130+
set MAX_PARALLEL_COMPILE_JOBS=64
131+
set MAX_PARALLEL_LINK_JOBS=64
132+
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
133+
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
134+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
matrix:
8484
runs-on:
8585
- ubuntu-22.04
86+
- ubuntu-22.04-arm
8687
- macos-13
8788
- macos-14
8889

.github/workflows/release-binaries.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
type: choice
1919
options:
2020
- ubuntu-22.04
21+
- ubuntu-22.04-arm
2122
- macos-13
2223
- macos-14
2324

@@ -55,6 +56,7 @@ jobs:
5556
ref: ${{ steps.vars.outputs.ref }}
5657
upload: ${{ steps.vars.outputs.upload }}
5758
target-cmake-flags: ${{ steps.vars.outputs.target-cmake-flags }}
59+
ccache: ${{ steps.vars.outputs.ccache }}
5860
build-flang: ${{ steps.vars.outputs.build-flang }}
5961
enable-pgo: ${{ steps.vars.outputs.enable-pgo }}
6062
release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }}
@@ -119,8 +121,16 @@ jobs:
119121
echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
120122
echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
121123
122-
# Detect necessary CMake flags
123124
target="$RUNNER_OS-$RUNNER_ARCH"
125+
# The hendrikmuhs/ccache-action action does not support installing sccache
126+
# on arm64 Linux.
127+
if [ "$target" = "Linux-ARM64" ]; then
128+
echo ccache=ccache >> $GITHUB_OUTPUT
129+
else
130+
echo ccache=sccache >> $GITHUB_OUTPUT
131+
fi
132+
133+
# Detect necessary CMake flags
124134
echo "enable-pgo=false" >> $GITHUB_OUTPUT
125135
target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF"
126136
# The macOS builds try to cross compile some libraries so we need to
@@ -146,7 +156,7 @@ jobs:
146156
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
147157
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
148158
case "${{ inputs.runs-on }}" in
149-
ubuntu-22.04)
159+
ubuntu-22.04*)
150160
build_runs_on="depot-${{ inputs.runs-on }}-16"
151161
test_runs_on=$build_runs_on
152162
;;
@@ -221,12 +231,14 @@ jobs:
221231
with:
222232
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
223233
max-size: 2G
224-
key: sccache-${{ runner.os }}-${{ runner.arch }}-release
225-
variant: sccache
234+
key: ${{ needs.prepare.outputs.ccache }}-${{ runner.os }}-${{ runner.arch }}-release
235+
variant: ${{ needs.prepare.outputs.ccache }}
226236

227237
- name: Configure
228238
id: build
229239
shell: bash
240+
env:
241+
CCACHE_BIN: ${{ needs.prepare.outputs.ccache }}
230242
run: |
231243
# There were some issues on the ARM64 MacOS runners with trying to build x86 object,
232244
# so we need to set some extra cmake flags to disable this.
@@ -235,8 +247,8 @@ jobs:
235247
-C clang/cmake/caches/Release.cmake \
236248
-DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \
237249
-DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
238-
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
239-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
250+
-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_BIN \
251+
-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_BIN
240252
- name: Build
241253
shell: bash
242254
run: |

clang/docs/ReleaseNotes.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,17 @@ Non-comprehensive list of changes in this release
487487
``__builtin_elementwise_sub_sat``, ``__builtin_reduce_min`` (For integral element type),
488488
``__builtin_reduce_max`` (For integral element type).
489489

490+
- The builtin macros ``__INT8_C``, ``__INT16_C``, ``__INT32_C``, ``__INT64_C``,
491+
``__INTMAX_C``, ``__UINT8_C``, ``__UINT16_C``, ``__UINT32_C``, ``__UINT64_C``
492+
and ``__UINTMAX_C`` have been introduced to ease the implementaton of section
493+
7.18.4 of ISO/IEC 9899:1999. These macros are also defined by GCC and should
494+
be used instead of others that expand and paste the suffixes provided by
495+
``__INT8_C_SUFFIX__``, ``__INT16_C_SUFFIX__``, ``__INT32_C_SUFFIX__``,
496+
``__INT64_C_SUFFIX__``, ``__INTMAX_C_SUFFIX__``, ``__UINT8_C_SUFFIX__``,
497+
``__UINT16_C_SUFFIX__``, ``__UINT32_C_SUFFIX__``, ``__UINT64_C_SUFFIX__`` and
498+
``__UINTMAX_C_SUFFIX__``. Pasting suffixes after the expansion of their
499+
respective macros is unsafe, as users can define the suffixes as macros.
500+
490501
- Clang now rejects ``_BitInt`` matrix element types if the bit width is less than ``CHAR_WIDTH`` or
491502
not a power of two, matching preexisting behaviour for vector types.
492503

@@ -1023,6 +1034,7 @@ Bug Fixes to C++ Support
10231034
- Fixed assertions or false compiler diagnostics in the case of C++ modules for
10241035
lambda functions or inline friend functions defined inside templates (#GH122493).
10251036
- Clang now rejects declaring an alias template with the same name as its template parameter. (#GH123423)
1037+
- Correctly determine the implicit constexprness of lambdas in dependent contexts. (#GH97958) (#GH114234)
10261038

10271039
Bug Fixes to AST Handling
10281040
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/AST/DeclTemplate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ SourceRange VarTemplateSpecializationDecl::getSourceRange() const {
14631463
assert(!Pattern.isNull() &&
14641464
"Variable template specialization without pattern?");
14651465
if (const auto *VTPSD =
1466-
Pattern.dyn_cast<VarTemplatePartialSpecializationDecl *>())
1466+
dyn_cast<VarTemplatePartialSpecializationDecl *>(Pattern))
14671467
return VTPSD->getSourceRange();
14681468
VarTemplateDecl *VTD = cast<VarTemplateDecl *>(Pattern);
14691469
if (hasInit()) {

clang/lib/AST/ParentMapContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class ParentMapContext::ParentMap {
103103

104104
static DynTypedNode
105105
getSingleDynTypedNodeFromParentMap(ParentMapPointers::mapped_type U) {
106-
if (const auto *D = U.dyn_cast<const Decl *>())
106+
if (const auto *D = dyn_cast<const Decl *>(U))
107107
return DynTypedNode::create(*D);
108-
if (const auto *S = U.dyn_cast<const Stmt *>())
108+
if (const auto *S = dyn_cast<const Stmt *>(U))
109109
return DynTypedNode::create(*S);
110110
return *cast<DynTypedNode *>(U);
111111
}

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ class AnnotatingParser {
11151115
}
11161116
if (!CurrentToken || CurrentToken->isNot(tok::l_paren))
11171117
return false;
1118-
skipToNextNonComment();
1118+
next();
11191119
// FIXME: Hack using inheritance to child context
11201120
Contexts.back().IsTableGenBangOpe = true;
11211121
bool Result = parseParens();
@@ -1124,12 +1124,10 @@ class AnnotatingParser {
11241124
}
11251125
// SimpleValue 9: Cond operator
11261126
if (Tok->is(TT_TableGenCondOperator)) {
1127-
Tok = CurrentToken;
1128-
skipToNextNonComment();
1129-
if (!Tok || Tok->isNot(tok::l_paren))
1127+
if (!CurrentToken || CurrentToken->isNot(tok::l_paren))
11301128
return false;
1131-
bool Result = parseParens();
1132-
return Result;
1129+
next();
1130+
return parseParens();
11331131
}
11341132
// We have to check identifier at the last because the kind of bang/cond
11351133
// operators are also identifier.

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ static void DefineExactWidthIntType(const LangOptions &LangOpts,
253253

254254
StringRef ConstSuffix(TI.getTypeConstantSuffix(Ty));
255255
Builder.defineMacro(Prefix + Twine(TypeWidth) + "_C_SUFFIX__", ConstSuffix);
256+
Builder.defineMacro(Prefix + Twine(TypeWidth) + "_C(c)",
257+
ConstSuffix.size() ? Twine("c##") + ConstSuffix : "c");
256258
}
257259

258260
static void DefineExactWidthIntTypeSize(TargetInfo::IntType Ty,
@@ -1164,12 +1166,16 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
11641166

11651167
DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
11661168
DefineFmt(LangOpts, "__INTMAX", TI.getIntMaxType(), TI, Builder);
1167-
Builder.defineMacro("__INTMAX_C_SUFFIX__",
1168-
TI.getTypeConstantSuffix(TI.getIntMaxType()));
1169+
StringRef ConstSuffix(TI.getTypeConstantSuffix(TI.getIntMaxType()));
1170+
Builder.defineMacro("__INTMAX_C_SUFFIX__", ConstSuffix);
1171+
Builder.defineMacro("__INTMAX_C(c)",
1172+
ConstSuffix.size() ? Twine("c##") + ConstSuffix : "c");
11691173
DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder);
11701174
DefineFmt(LangOpts, "__UINTMAX", TI.getUIntMaxType(), TI, Builder);
1171-
Builder.defineMacro("__UINTMAX_C_SUFFIX__",
1172-
TI.getTypeConstantSuffix(TI.getUIntMaxType()));
1175+
ConstSuffix = TI.getTypeConstantSuffix(TI.getUIntMaxType());
1176+
Builder.defineMacro("__UINTMAX_C_SUFFIX__", ConstSuffix);
1177+
Builder.defineMacro("__UINTMAX_C(c)",
1178+
ConstSuffix.size() ? Twine("c##") + ConstSuffix : "c");
11731179
DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(LangAS::Default), Builder);
11741180
DefineFmt(LangOpts, "__PTRDIFF", TI.getPtrDiffType(LangAS::Default), TI,
11751181
Builder);

clang/lib/Sema/JumpDiagnostics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,12 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
561561
// implementable but a lot of work which we haven't felt up to doing.
562562
ExprWithCleanups *EWC = cast<ExprWithCleanups>(S);
563563
for (unsigned i = 0, e = EWC->getNumObjects(); i != e; ++i) {
564-
if (auto *BDecl = EWC->getObject(i).dyn_cast<BlockDecl *>())
564+
if (auto *BDecl = dyn_cast<BlockDecl *>(EWC->getObject(i)))
565565
for (const auto &CI : BDecl->captures()) {
566566
VarDecl *variable = CI.getVariable();
567567
BuildScopeInformation(variable, BDecl, origParentScope);
568568
}
569-
else if (auto *CLE = EWC->getObject(i).dyn_cast<CompoundLiteralExpr *>())
569+
else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(EWC->getObject(i)))
570570
BuildScopeInformation(CLE, origParentScope);
571571
else
572572
llvm_unreachable("unexpected cleanup object type");

clang/lib/Sema/SemaAPINotes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static void ProcessAPINotes(Sema &S, FunctionOrMethod AnyFunc,
478478
const api_notes::FunctionInfo &Info,
479479
VersionedInfoMetadata Metadata) {
480480
// Find the declaration itself.
481-
FunctionDecl *FD = AnyFunc.dyn_cast<FunctionDecl *>();
481+
FunctionDecl *FD = dyn_cast<FunctionDecl *>(AnyFunc);
482482
Decl *D = FD;
483483
ObjCMethodDecl *MD = nullptr;
484484
if (!D) {

0 commit comments

Comments
 (0)