Skip to content

Commit 73e740b

Browse files
committed
merge main into amd-staging
2 parents b23aa4e + 4a158f6 commit 73e740b

File tree

137 files changed

+2715
-1088
lines changed

Some content is hidden

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

137 files changed

+2715
-1088
lines changed

.ci/generate_test_report_lib.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ def plural(num_tests):
122122
]
123123
)
124124

125+
if failures or return_code != 0:
126+
report.extend(
127+
[
128+
"",
129+
"If these failures are unrelated to your changes (for example "
130+
"tests are broken or flaky at HEAD), please open an issue at "
131+
"https://github.com/llvm/llvm-project/issues and add the "
132+
"`infrastructure` label.",
133+
]
134+
)
135+
125136
report = "\n".join(report)
126137
if len(report.encode("utf-8")) > size_limit:
127138
return generate_report(

.ci/generate_test_report_lib_test.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def test_no_failures_build_failed(self):
109109
110110
All tests passed but another part of the build **failed**.
111111
112-
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details."""
112+
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
113+
114+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
113115
),
114116
"error",
115117
),
@@ -169,7 +171,9 @@ def test_report_single_file_single_testsuite(self):
169171
```
170172
Other output goes here
171173
```
172-
</details>"""
174+
</details>
175+
176+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
173177
),
174178
"error",
175179
),
@@ -203,7 +207,9 @@ def test_report_single_file_single_testsuite(self):
203207
```
204208
DEF/test_2 output goes here
205209
```
206-
</details>"""
210+
</details>
211+
212+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
207213
),
208214
"error",
209215
)
@@ -311,7 +317,9 @@ def test_report_dont_list_failures(self):
311317
312318
* 1 test failed
313319
314-
Failed tests and their output was too large to report. Download the build's log file to see the details."""
320+
Failed tests and their output was too large to report. Download the build's log file to see the details.
321+
322+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
315323
),
316324
"error",
317325
),
@@ -352,13 +360,16 @@ def test_report_dont_list_failures_link_to_log(self):
352360
353361
* 1 test failed
354362
355-
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details."""
363+
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
364+
365+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
356366
),
357367
"error",
358368
),
359369
)
360370

361371
def test_report_size_limit(self):
372+
test_output = "f" * 1000
362373
self.assertEqual(
363374
generate_test_report_lib.generate_report(
364375
"Foo",
@@ -371,14 +382,16 @@ def test_report_size_limit(self):
371382
<testsuites time="0.02">
372383
<testsuite name="Bar" tests="1" failures="1" skipped="0" time="0.02">
373384
<testcase classname="Bar/test_1" name="test_1" time="0.02">
374-
<failure><![CDATA[Some long output goes here...]]></failure>
385+
<failure><![CDATA[{output}]]></failure>
375386
</testcase>
376387
</testsuite>
377-
</testsuites>"""
388+
</testsuites>""".format(
389+
output=test_output
390+
)
378391
)
379392
)
380393
],
381-
size_limit=128,
394+
size_limit=512,
382395
),
383396
(
384397
dedent(
@@ -387,7 +400,9 @@ def test_report_size_limit(self):
387400
388401
* 1 test failed
389402
390-
Failed tests and their output was too large to report. Download the build's log file to see the details."""
403+
Failed tests and their output was too large to report. Download the build's log file to see the details.
404+
405+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
391406
),
392407
"error",
393408
),

bolt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ if(BOLT_BUILT_STANDALONE)
4646
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
4747
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
4848

49+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
50+
add_definitions(${LLVM_DEFINITIONS_LIST})
51+
list(APPEND CMAKE_REQUIRED_DEFINITIONS ${LLVM_DEFINITIONS_LIST})
52+
4953
include(AddLLVM)
5054
include(TableGen)
5155
include_directories(${LLVM_INCLUDE_DIRS})

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
201201

202202
std::string Error;
203203
const Target *TheTarget =
204-
TargetRegistry::lookupTarget(std::string(ArchName), TheTriple, Error);
204+
TargetRegistry::lookupTarget(ArchName, TheTriple, Error);
205205
if (!TheTarget)
206206
return createStringError(make_error_code(std::errc::not_supported),
207207
Twine("BOLT-ERROR: ", Error));

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,7 @@ bool shouldPrint(const BinaryFunction &Function) {
166166
}
167167

168168
std::optional<StringRef> Origin = Function.getOriginSectionName();
169-
if (Origin && llvm::any_of(opts::PrintOnly, [&](const std::string &Name) {
170-
return Name == *Origin;
171-
}))
172-
return true;
173-
174-
return false;
169+
return Origin && llvm::is_contained(opts::PrintOnly, *Origin);
175170
}
176171

177172
} // namespace opts

clang/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ if(CLANG_BUILT_STANDALONE)
6868
option(CLANG_ENABLE_BOOTSTRAP "Generate the clang bootstrap target" OFF)
6969
option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
7070

71+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
72+
add_definitions(${LLVM_DEFINITIONS_LIST})
73+
list(APPEND CMAKE_REQUIRED_DEFINITIONS ${LLVM_DEFINITIONS_LIST})
74+
7175
include(AddLLVM)
7276
include(TableGen)
7377
include(HandleLLVMOptions)

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ Bug Fixes to C++ Support
759759
in a ``constexpr`` function. (#GH131432)
760760
- Fixed an incorrect TreeTransform for calls to ``consteval`` functions if a conversion template is present. (#GH137885)
761761
- Clang now emits a warning when class template argument deduction for alias templates is used in C++17. (#GH133806)
762-
- Fix missed initializer instantiation bug for variable templates. (#GH138122)
762+
- Fixed a missed initializer instantiation bug for variable templates. (#GH134526), (#GH138122)
763763
- Fix a crash when checking the template template parameters of a dependent lambda appearing in an alias declaration.
764764
(#GH136432), (#GH137014), (#GH138018)
765765
- Fixed an assertion when trying to constant-fold various builtins when the argument
@@ -778,6 +778,7 @@ Bug Fixes to C++ Support
778778
reference in its own initializer in C++23 mode (#GH131330).
779779
- Clang could incorrectly instantiate functions in discarded contexts (#GH140449)
780780
- Fix instantiation of default-initialized variable template specialization. (#GH140632) (#GH140622)
781+
- Clang modules now allow a module and its user to differ on TrivialAutoVarInit*
781782

782783
Bug Fixes to AST Handling
783784
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/LangOptions.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,11 @@ BENIGN_LANGOPT(HalfNoSemanticInterposition, 1, 0,
413413
"Like -fno-semantic-interposition but don't use local aliases")
414414
ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
415415
"stack protector mode")
416-
ENUM_LANGOPT(TrivialAutoVarInit, TrivialAutoVarInitKind, 2, TrivialAutoVarInitKind::Uninitialized,
416+
BENIGN_ENUM_LANGOPT(TrivialAutoVarInit, TrivialAutoVarInitKind, 2, TrivialAutoVarInitKind::Uninitialized,
417417
"trivial automatic variable initialization")
418-
VALUE_LANGOPT(TrivialAutoVarInitStopAfter, 32, 0,
418+
BENIGN_VALUE_LANGOPT(TrivialAutoVarInitStopAfter, 32, 0,
419419
"stop trivial automatic variable initialization after the specified number of instances. Must be greater than 0.")
420-
VALUE_LANGOPT(TrivialAutoVarInitMaxSize, 32, 0,
420+
BENIGN_VALUE_LANGOPT(TrivialAutoVarInitMaxSize, 32, 0,
421421
"stop trivial automatic variable initialization if var size exceeds the specified size (in bytes). Must be greater than 0.")
422422
ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
423423
"signed integer overflow handling")

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,21 @@ bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
669669

670670
if (const auto *VD = Ptr.getDeclDesc()->asVarDecl();
671671
VD && (VD->isConstexpr() || VD->hasGlobalStorage())) {
672+
673+
if (!S.getLangOpts().CPlusPlus23 && VD == S.EvaluatingDecl) {
674+
if (!S.getLangOpts().CPlusPlus14 &&
675+
!VD->getType().isConstant(S.getASTContext())) {
676+
// Diagnose as non-const read.
677+
diagnoseNonConstVariable(S, OpPC, VD);
678+
} else {
679+
const SourceInfo &Loc = S.Current->getSource(OpPC);
680+
// Diagnose as "read of object outside its lifetime".
681+
S.FFDiag(Loc, diag::note_constexpr_access_uninit)
682+
<< AK << /*IsIndeterminate=*/false;
683+
}
684+
return false;
685+
}
686+
672687
if (VD->getAnyInitializer()) {
673688
const SourceInfo &Loc = S.Current->getSource(OpPC);
674689
S.FFDiag(Loc, diag::note_constexpr_var_init_non_constant, 1) << VD;

clang/lib/Analysis/ThreadSafety.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,38 +236,34 @@ class FactSet {
236236
}
237237

238238
iterator findLockIter(FactManager &FM, const CapabilityExpr &CapE) {
239-
return std::find_if(begin(), end(), [&](FactID ID) {
240-
return FM[ID].matches(CapE);
241-
});
239+
return llvm::find_if(*this,
240+
[&](FactID ID) { return FM[ID].matches(CapE); });
242241
}
243242

244243
const FactEntry *findLock(FactManager &FM, const CapabilityExpr &CapE) const {
245-
auto I = std::find_if(begin(), end(), [&](FactID ID) {
246-
return FM[ID].matches(CapE);
247-
});
244+
auto I =
245+
llvm::find_if(*this, [&](FactID ID) { return FM[ID].matches(CapE); });
248246
return I != end() ? &FM[*I] : nullptr;
249247
}
250248

251249
const FactEntry *findLockUniv(FactManager &FM,
252250
const CapabilityExpr &CapE) const {
253-
auto I = std::find_if(begin(), end(), [&](FactID ID) -> bool {
254-
return FM[ID].matchesUniv(CapE);
255-
});
251+
auto I = llvm::find_if(
252+
*this, [&](FactID ID) -> bool { return FM[ID].matchesUniv(CapE); });
256253
return I != end() ? &FM[*I] : nullptr;
257254
}
258255

259256
const FactEntry *findPartialMatch(FactManager &FM,
260257
const CapabilityExpr &CapE) const {
261-
auto I = std::find_if(begin(), end(), [&](FactID ID) -> bool {
258+
auto I = llvm::find_if(*this, [&](FactID ID) -> bool {
262259
return FM[ID].partiallyMatches(CapE);
263260
});
264261
return I != end() ? &FM[*I] : nullptr;
265262
}
266263

267264
bool containsMutexDecl(FactManager &FM, const ValueDecl* Vd) const {
268-
auto I = std::find_if(begin(), end(), [&](FactID ID) -> bool {
269-
return FM[ID].valueDecl() == Vd;
270-
});
265+
auto I = llvm::find_if(
266+
*this, [&](FactID ID) -> bool { return FM[ID].valueDecl() == Vd; });
271267
return I != end();
272268
}
273269
};

0 commit comments

Comments
 (0)