Skip to content

Commit c1118fd

Browse files
committed
Merge tag 'llvmorg-20.1.5' into rustc/20.1-2025-02-13
LLVM Release 20.1.5
2 parents 8448283 + 7b09d7b commit c1118fd

File tree

136 files changed

+3230
-607
lines changed

Some content is hidden

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

136 files changed

+3230
-607
lines changed

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def find_compilation_database(path: str) -> str:
8787

8888

8989
def get_tidy_invocation(
90-
f: str,
90+
f: Optional[str],
9191
clang_tidy_binary: str,
9292
checks: str,
9393
tmpdir: Optional[str],
@@ -147,7 +147,8 @@ def get_tidy_invocation(
147147
start.append(f"--warnings-as-errors={warnings_as_errors}")
148148
if allow_no_checks:
149149
start.append("--allow-no-checks")
150-
start.append(f)
150+
if f:
151+
start.append(f)
151152
return start
152153

153154

@@ -490,7 +491,7 @@ async def main() -> None:
490491

491492
try:
492493
invocation = get_tidy_invocation(
493-
"",
494+
None,
494495
clang_tidy_binary,
495496
args.checks,
496497
None,

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ Improvements to clang-tidy
190190
- Fixed bug in :program:`clang-tidy` by which `HeaderFilterRegex` did not take
191191
effect when passed via the `.clang-tidy` file.
192192

193+
- Fixed bug in :program:`run_clang_tidy.py` where the program would not
194+
correctly display the checks enabled by the top-level `.clang-tidy` file.
195+
193196
New checks
194197
^^^^^^^^^^
195198

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,8 @@ RISC-V Support
12671267
- The option ``-mcmodel=large`` for the large code model is supported.
12681268
- Bump RVV intrinsic to version 1.0, the spec: https://github.com/riscv-non-isa/rvv-intrinsic-doc/releases/tag/v1.0.0-rc4
12691269

1270+
- `Zicsr` / `Zifencei` are allowed to be duplicated in the presence of `g` in `-march`.
1271+
12701272
CUDA/HIP Language Changes
12711273
^^^^^^^^^^^^^^^^^^^^^^^^^
12721274
- Fixed a bug about overriding a constexpr pure-virtual member function with a non-constexpr virtual member function which causes compilation failure when including standard C++ header `format`.

clang/include/clang/Driver/Distro.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Distro {
3939
DebianBullseye,
4040
DebianBookworm,
4141
DebianTrixie,
42+
DebianForky,
43+
DebianDuke,
4244
Exherbo,
4345
RHEL5,
4446
RHEL6,
@@ -128,7 +130,7 @@ class Distro {
128130
bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
129131

130132
bool IsDebian() const {
131-
return DistroVal >= DebianLenny && DistroVal <= DebianTrixie;
133+
return DistroVal >= DebianLenny && DistroVal <= DebianDuke;
132134
}
133135

134136
bool IsUbuntu() const {

clang/include/clang/Interpreter/Interpreter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ class Interpreter {
116116
/// Compiler instance performing the incremental compilation.
117117
std::unique_ptr<CompilerInstance> CI;
118118

119+
/// An optional compiler instance for CUDA offloading
120+
std::unique_ptr<CompilerInstance> DeviceCI;
121+
119122
protected:
120123
// Derived classes can use an extended interface of the Interpreter.
121124
Interpreter(std::unique_ptr<CompilerInstance> Instance, llvm::Error &Err,

clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,19 @@ ANALYZER_OPTION(
385385
"flex\" won't be analyzed.",
386386
true)
387387

388+
ANALYZER_OPTION(
389+
bool, InlineFunctionsWithAmbiguousLoops, "inline-functions-with-ambiguous-loops",
390+
"If disabled (the default), the analyzer puts functions on a \"do not "
391+
"inline this\" list if it finds an execution path within that function "
392+
"that may potentially perform 'analyzer-max-loop' (= 4 by default) "
393+
"iterations in a loop. (Note that functions that _definitely_ reach the "
394+
"loop limit on some execution path are currently marked as \"do not "
395+
"inline\" even if this option is enabled.) Enabling this option "
396+
"eliminates this (somewhat arbitrary) restriction from the analysis "
397+
"scope, which increases the analysis runtime (on average by ~10%, but "
398+
"a few translation units may see much larger slowdowns).",
399+
false)
400+
388401
//===----------------------------------------------------------------------===//
389402
// Unsigned analyzer options.
390403
//===----------------------------------------------------------------------===//

clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ class FunctionSummariesTy {
8181
I->second.MayInline = 0;
8282
}
8383

84-
void markReachedMaxBlockCount(const Decl *D) {
85-
markShouldNotInline(D);
86-
}
87-
8884
std::optional<bool> mayInline(const Decl *D) {
8985
MapTy::const_iterator I = Map.find(D);
9086
if (I != Map.end() && I->second.InlineChecked)

clang/lib/AST/ExprConstant.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12710,11 +12710,13 @@ static bool determineEndOffset(EvalInfo &Info, SourceLocation ExprLoc,
1271012710
bool DetermineForCompleteObject = refersToCompleteObject(LVal);
1271112711

1271212712
auto CheckedHandleSizeof = [&](QualType Ty, CharUnits &Result) {
12713-
if (Ty.isNull() || Ty->isIncompleteType() || Ty->isFunctionType())
12713+
if (Ty.isNull())
1271412714
return false;
1271512715

12716-
if (Ty->isReferenceType())
12717-
Ty = Ty.getNonReferenceType();
12716+
Ty = Ty.getNonReferenceType();
12717+
12718+
if (Ty->isIncompleteType() || Ty->isFunctionType())
12719+
return false;
1271812720

1271912721
return HandleSizeof(Info, ExprLoc, Ty, Result);
1272012722
};

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,7 +3552,21 @@ void MicrosoftCXXNameMangler::mangleType(const DependentSizedExtVectorType *T,
35523552

35533553
void MicrosoftCXXNameMangler::mangleType(const ConstantMatrixType *T,
35543554
Qualifiers quals, SourceRange Range) {
3555-
Error(Range.getBegin(), "matrix type") << Range;
3555+
QualType EltTy = T->getElementType();
3556+
3557+
llvm::SmallString<64> TemplateMangling;
3558+
llvm::raw_svector_ostream Stream(TemplateMangling);
3559+
MicrosoftCXXNameMangler Extra(Context, Stream);
3560+
3561+
Stream << "?$";
3562+
3563+
Extra.mangleSourceName("__matrix");
3564+
Extra.mangleType(EltTy, Range, QMM_Escape);
3565+
3566+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumRows()));
3567+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumColumns()));
3568+
3569+
mangleArtificialTagType(TagTypeKind::Struct, TemplateMangling, {"__clang"});
35563570
}
35573571

35583572
void MicrosoftCXXNameMangler::mangleType(const DependentSizedMatrixType *T,

clang/lib/AST/NestedNameSpecifier.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,16 @@ void NestedNameSpecifier::print(raw_ostream &OS, const PrintingPolicy &Policy,
283283
case TypeSpec: {
284284
const auto *Record =
285285
dyn_cast_or_null<ClassTemplateSpecializationDecl>(getAsRecordDecl());
286-
if (ResolveTemplateArguments && Record) {
286+
const TemplateParameterList *TPL = nullptr;
287+
if (Record) {
288+
TPL = Record->getSpecializedTemplate()->getTemplateParameters();
289+
if (ResolveTemplateArguments) {
287290
// Print the type trait with resolved template parameters.
288291
Record->printName(OS, Policy);
289-
printTemplateArgumentList(
290-
OS, Record->getTemplateArgs().asArray(), Policy,
291-
Record->getSpecializedTemplate()->getTemplateParameters());
292+
printTemplateArgumentList(OS, Record->getTemplateArgs().asArray(),
293+
Policy, TPL);
292294
break;
295+
}
293296
}
294297
const Type *T = getAsType();
295298

@@ -313,16 +316,16 @@ void NestedNameSpecifier::print(raw_ostream &OS, const PrintingPolicy &Policy,
313316
TemplateName::Qualified::None);
314317

315318
// Print the template argument list.
316-
printTemplateArgumentList(OS, SpecType->template_arguments(),
317-
InnerPolicy);
319+
printTemplateArgumentList(OS, SpecType->template_arguments(), InnerPolicy,
320+
TPL);
318321
} else if (const auto *DepSpecType =
319322
dyn_cast<DependentTemplateSpecializationType>(T)) {
320323
// Print the template name without its corresponding
321324
// nested-name-specifier.
322325
OS << DepSpecType->getIdentifier()->getName();
323326
// Print the template argument list.
324327
printTemplateArgumentList(OS, DepSpecType->template_arguments(),
325-
InnerPolicy);
328+
InnerPolicy, TPL);
326329
} else {
327330
// Print the type normally
328331
QualType(T, 0).print(OS, InnerPolicy);

0 commit comments

Comments
 (0)