Skip to content

Commit 62f9c3f

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merge llvm/main into amd-debug
2 parents a8e7561 + dbc41dd commit 62f9c3f

File tree

146 files changed

+4308
-2699
lines changed

Some content is hidden

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

146 files changed

+4308
-2699
lines changed

.github/workflows/premerge.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ jobs:
3434
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3535
with:
3636
fetch-depth: 2
37-
- name: Setup ccache
38-
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
39-
with:
40-
variant: "sccache"
41-
max-size: "2000M"
4237
- name: Build and Test
4338
# Mark the job as a success even if the step fails so that people do
4439
# not get notified while the new premerge pipeline is in an
@@ -62,6 +57,13 @@ jobs:
6257
export CC=/opt/llvm/bin/clang
6358
export CXX=/opt/llvm/bin/clang++
6459
60+
# This environment variable is passes into the container through the
61+
# runner pod definition. This differs between our two clusters which
62+
# why we do not hardcode it.
63+
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
64+
export SCCACHE_GCS_RW_MODE=READ_WRITE
65+
sccache --start-server
66+
6567
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
6668
- name: Upload Artifacts
6769
if: '!cancelled()'
@@ -86,11 +88,6 @@ jobs:
8688
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8789
with:
8890
fetch-depth: 2
89-
- name: Setup ccache
90-
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
91-
with:
92-
variant: "sccache"
93-
max-size: "2000M"
9491
- name: Compute Projects
9592
id: vars
9693
run: |
@@ -113,7 +110,7 @@ jobs:
113110
shell: cmd
114111
run: |
115112
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
116-
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
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 }}\""
117114
- name: Upload Artifacts
118115
if: '!cancelled()'
119116
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ Bug Fixes in This Version
814814
- Fixed a failed assertion with an operator call expression which comes from a
815815
macro expansion when performing analysis for nullability attributes. (#GH138371)
816816
- Fixed a concept equivalent checking crash due to untransformed constraint expressions. (#GH146614)
817+
- Fixed a crash in `clang-scan-deps` when a module with the same name is found
818+
in different locations (#GH134404, #GH146976).
817819
- Fix a crash when marco name is empty in ``#pragma push_macro("")`` or
818820
``#pragma pop_macro("")``. (GH149762).
819821

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ LANGOPT(CheckConstexprFunctionBodies, 1, 1, Benign,
491491

492492
LANGOPT(BoundsSafety, 1, 0, NotCompatible, "Bounds safety extension for C")
493493

494+
LANGOPT(EnableLifetimeSafety, 1, 0, NotCompatible, "Experimental lifetime safety analysis for C++")
495+
494496
LANGOPT(PreserveVec3Type, 1, 0, NotCompatible, "Preserve 3-component vector type")
495497

496498
#undef LANGOPT

clang/include/clang/Driver/Options.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,14 @@ defm bounds_safety : BoolFOption<
19041904
BothFlags<[], [CC1Option],
19051905
" experimental bounds safety extension for C">>;
19061906

1907+
defm lifetime_safety : BoolFOption<
1908+
"experimental-lifetime-safety",
1909+
LangOpts<"EnableLifetimeSafety">, DefaultFalse,
1910+
PosFlag<SetTrue, [], [CC1Option], "Enable">,
1911+
NegFlag<SetFalse, [], [CC1Option], "Disable">,
1912+
BothFlags<[], [CC1Option],
1913+
" experimental lifetime safety for C++">>;
1914+
19071915
defm addrsig : BoolFOption<"addrsig",
19081916
CodeGenOpts<"Addrsig">, DefaultFalse,
19091917
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Emit">,

clang/lib/Basic/Targets.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
757757
case llvm::Triple::FreeBSD:
758758
return std::make_unique<FreeBSDTargetInfo<LoongArch64TargetInfo>>(Triple,
759759
Opts);
760+
case llvm::Triple::OpenBSD:
761+
return std::make_unique<OpenBSDTargetInfo<LoongArch64TargetInfo>>(Triple,
762+
Opts);
760763
default:
761764
return std::make_unique<LoongArch64TargetInfo>(Triple, Opts);
762765
}

clang/lib/Basic/Targets/OSTargets.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : public OSTargetInfo<Target> {
496496
case llvm::Triple::sparcv9:
497497
this->MCountName = "_mcount";
498498
break;
499+
case llvm::Triple::loongarch64:
499500
case llvm::Triple::riscv64:
500501
break;
501502
}

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
161161
if (Nopie || Profiling)
162162
CmdArgs.push_back("-nopie");
163163

164-
if (Triple.isRISCV64()) {
164+
if (Triple.isLoongArch64() || Triple.isRISCV64()) {
165165
CmdArgs.push_back("-X");
166166
if (Args.hasArg(options::OPT_mno_relax))
167167
CmdArgs.push_back("--no-relax");

clang/lib/Sema/AnalysisBasedWarnings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,8 +2901,7 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
29012901
.setAlwaysAdd(Stmt::UnaryOperatorClass);
29022902
}
29032903

2904-
bool EnableLifetimeSafetyAnalysis = !Diags.isIgnored(
2905-
diag::warn_experimental_lifetime_safety_dummy_warning, D->getBeginLoc());
2904+
bool EnableLifetimeSafetyAnalysis = S.getLangOpts().EnableLifetimeSafety;
29062905
// Install the logical handler.
29072906
std::optional<LogicalErrorHandler> LEH;
29082907
if (LogicalErrorHandler::hasActiveDiagnostics(Diags, D->getBeginLoc())) {

clang/test/Driver/openbsd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@
127127
// UNWIND-TABLES: "-funwind-tables=2"
128128
// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"
129129

130-
// Check that the -X and --no-relax flags are passed to the linker on riscv64
130+
// Check that the -X and --no-relax flags are passed to the linker
131+
// RUN: %clang --target=loongarch64-unknown-openbsd -mno-relax -### %s 2>&1 \
132+
// RUN: | FileCheck --check-prefix=LA64-FLAGS %s
131133
// RUN: %clang --target=riscv64-unknown-openbsd -mno-relax -### %s 2>&1 \
132134
// RUN: | FileCheck -check-prefix=RISCV64-FLAGS %s
135+
// LA64-FLAGS: "-X" "--no-relax"
133136
// RISCV64-FLAGS: "-X" "--no-relax"
134137

135138
// Check passing LTO flags to the linker

clang/test/Sema/warn-lifetime-safety-dataflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -mllvm -debug-only=LifetimeFacts -Wexperimental-lifetime-safety %s 2>&1 | FileCheck %s
1+
// RUN: %clang_cc1 -fexperimental-lifetime-safety -mllvm -debug-only=LifetimeFacts -Wexperimental-lifetime-safety %s 2>&1 | FileCheck %s
22
// REQUIRES: asserts
33

44
struct MyObj {

0 commit comments

Comments
 (0)