Skip to content

Commit 372321d

Browse files
authored
Merge branch 'main' into main
2 parents a5ef32c + 6dc356d commit 372321d

File tree

284 files changed

+874377
-1344
lines changed

Some content is hidden

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

284 files changed

+874377
-1344
lines changed

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ struct TargetFinder {
496496
return;
497497
case NestedNameSpecifier::Identifier:
498498
if (Resolver) {
499-
add(QualType(Resolver->resolveNestedNameSpecifierToType(NNS), 0),
500-
Flags);
499+
add(Resolver->resolveNestedNameSpecifierToType(NNS), Flags);
501500
}
502501
return;
503502
case NestedNameSpecifier::TypeSpec:

clang-tools-extra/clangd/XRefs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,9 +2034,10 @@ static void unwrapFindType(
20342034

20352035
// For smart pointer types, add the underlying type
20362036
if (H)
2037-
if (const auto* PointeeType = H->getPointeeType(T.getNonReferenceType().getTypePtr())) {
2038-
unwrapFindType(QualType(PointeeType, 0), H, Out);
2039-
return Out.push_back(T);
2037+
if (auto PointeeType = H->getPointeeType(T.getNonReferenceType());
2038+
!PointeeType.isNull()) {
2039+
unwrapFindType(PointeeType, H, Out);
2040+
return Out.push_back(T);
20402041
}
20412042

20422043
return Out.push_back(T);

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ Bug Fixes to C++ Support
965965
- Fixed a crash caused by the incorrect construction of template arguments for CTAD alias guides when type
966966
constraints are applied. (#GH122134)
967967
- Fixed canonicalization of pack indexing types - Clang did not always recognized identical pack indexing. (#GH123033)
968+
- Fixed a nested lambda substitution issue for constraint evaluation. (#GH123441)
968969

969970

970971
Bug Fixes to AST Handling

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#pragma push_macro("SM_90")
2929
#pragma push_macro("SM_90a")
3030
#pragma push_macro("SM_100")
31-
#define SM_100 "sm_100"
31+
#pragma push_macro("SM_100a")
32+
#define SM_100a "sm_100a"
33+
#define SM_100 "sm_100|" SM_100a
3234
#define SM_90a "sm_90a"
3335
#define SM_90 "sm_90|" SM_90a "|" SM_100
3436
#define SM_89 "sm_89|" SM_90
@@ -1091,6 +1093,7 @@ TARGET_BUILTIN(__nvvm_getctarank_shared_cluster, "iv*3", "", AND(SM_90,PTX78))
10911093
#pragma pop_macro("SM_90")
10921094
#pragma pop_macro("SM_90a")
10931095
#pragma pop_macro("SM_100")
1096+
#pragma pop_macro("SM_100a")
10941097
#pragma pop_macro("PTX42")
10951098
#pragma pop_macro("PTX60")
10961099
#pragma pop_macro("PTX61")

clang/include/clang/Basic/Cuda.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ enum class CudaVersion {
4444
CUDA_124,
4545
CUDA_125,
4646
CUDA_126,
47+
CUDA_127,
48+
CUDA_128,
49+
CUDA_129,
4750
FULLY_SUPPORTED = CUDA_123,
4851
PARTIALLY_SUPPORTED =
49-
CUDA_126, // Partially supported. Proceed with a warning.
52+
CUDA_129, // Partially supported. Proceed with a warning.
5053
NEW = 10000, // Too new. Issue a warning, but allow using it.
5154
};
5255
const char *CudaVersionToString(CudaVersion V);
@@ -80,6 +83,7 @@ enum class OffloadArch {
8083
SM_90,
8184
SM_90a,
8285
SM_100,
86+
SM_100a,
8387
GFX600,
8488
GFX601,
8589
GFX602,

clang/include/clang/Basic/arm_neon.td

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,6 @@ def OP_VCVT_F32_BF16_LO
259259
def OP_VCVT_F32_BF16_HI
260260
: Op<(call "vcvt_f32_bf16", (call "vget_high", $p0))>;
261261

262-
def OP_VCVT_BF16_F32_LO_A64
263-
: Op<(call "__a64_vcvtq_low_bf16", $p0)>;
264-
def OP_VCVT_BF16_F32_A64
265-
: Op<(call "vget_low", (call "__a64_vcvtq_low_bf16", $p0))>;
266-
267262
def OP_VCVT_BF16_F32_A32
268263
: Op<(call "__a32_vcvt_bf16", $p0)>;
269264

@@ -2061,10 +2056,9 @@ let ArchGuard = "!defined(__aarch64__) && !defined(__arm64ec__)", TargetGuard =
20612056
}
20622057

20632058
let ArchGuard = "defined(__aarch64__) || defined(__arm64ec__)", TargetGuard = "bf16,neon" in {
2064-
def VCVT_LOW_BF16_F32_A64_INTERNAL : WInst<"__a64_vcvtq_low_bf16", "BQ", "Hf">;
2065-
def VCVT_LOW_BF16_F32_A64 : SOpInst<"vcvt_low_bf16", "BQ", "Qf", OP_VCVT_BF16_F32_LO_A64>;
2059+
def VCVT_LOW_BF16_F32_A64 : SInst<"vcvt_low_bf16", "BQ", "Qf">;
20662060
def VCVT_HIGH_BF16_F32_A64 : SInst<"vcvt_high_bf16", "BBQ", "Qf">;
2067-
def VCVT_BF16_F32 : SOpInst<"vcvt_bf16", "BQ", "f", OP_VCVT_BF16_F32_A64>;
2061+
def VCVT_BF16_F32 : SInst<"vcvt_bf16", "BQ", "f">;
20682062

20692063
def COPY_LANE_BF16 : IOpInst<"vcopy_lane", "..I.I", "b", OP_COPY_LN>;
20702064
def COPYQ_LANE_BF16 : IOpInst<"vcopy_lane", "..IqI", "Qb", OP_COPY_LN>;

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,6 +3505,11 @@ def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
35053505
def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
35063506
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>,
35073507
Visibility<[ClangOption, FlangOption]>;
3508+
defm init_global_zero : BoolOptionWithoutMarshalling<"f", "init-global-zero",
3509+
PosFlag<SetTrue, [], [FlangOption, FC1Option],
3510+
"Zero initialize globals without default initialization (default)">,
3511+
NegFlag<SetFalse, [], [FlangOption, FC1Option],
3512+
"Do not zero initialize globals without default initialization">>;
35083513
def fno_pointer_tbaa : Flag<["-"], "fno-pointer-tbaa">, Group<f_Group>;
35093514
def fno_temp_file : Flag<["-"], "fno-temp-file">, Group<f_Group>,
35103515
Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>, HelpText<

clang/include/clang/Sema/HeuristicResolver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class HeuristicResolver {
6666
// Try to heuristically resolve a dependent nested name specifier
6767
// to the type it likely denotes. Note that *dependent* name specifiers always
6868
// denote types, not namespaces.
69-
const Type *
69+
QualType
7070
resolveNestedNameSpecifierToType(const NestedNameSpecifier *NNS) const;
7171

7272
// Given the type T of a dependent expression that appears of the LHS of a
7373
// "->", heuristically find a corresponding pointee type in whose scope we
7474
// could look up the name appearing on the RHS.
75-
const Type *getPointeeType(const Type *T) const;
75+
const QualType getPointeeType(QualType T) const;
7676

7777
private:
7878
ASTContext &Ctx;

clang/include/clang/Sema/Sema.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13841,6 +13841,13 @@ class Sema final : public SemaBase {
1384113841
LocalInstantiationScope &Scope,
1384213842
const MultiLevelTemplateArgumentList &TemplateArgs);
1384313843

13844+
/// Introduce the instantiated captures of the lambda into the local
13845+
/// instantiation scope.
13846+
bool addInstantiatedCapturesToScope(
13847+
FunctionDecl *Function, const FunctionDecl *PatternDecl,
13848+
LocalInstantiationScope &Scope,
13849+
const MultiLevelTemplateArgumentList &TemplateArgs);
13850+
1384413851
int ParsingClassDepth = 0;
1384513852

1384613853
class SavePendingParsedClassStateRAII {
@@ -14521,16 +14528,9 @@ class Sema final : public SemaBase {
1452114528
// The current stack of constraint satisfactions, so we can exit-early.
1452214529
llvm::SmallVector<SatisfactionStackEntryTy, 10> SatisfactionStack;
1452314530

14524-
/// Introduce the instantiated captures of the lambda into the local
14525-
/// instantiation scope.
14526-
bool addInstantiatedCapturesToScope(
14527-
FunctionDecl *Function, const FunctionDecl *PatternDecl,
14528-
LocalInstantiationScope &Scope,
14529-
const MultiLevelTemplateArgumentList &TemplateArgs);
14530-
14531-
/// Used by SetupConstraintCheckingTemplateArgumentsAndScope to recursively(in
14532-
/// the case of lambdas) set up the LocalInstantiationScope of the current
14533-
/// function.
14531+
/// Used by SetupConstraintCheckingTemplateArgumentsAndScope to set up the
14532+
/// LocalInstantiationScope of the current non-lambda function. For lambdas,
14533+
/// use LambdaScopeForCallOperatorInstantiationRAII.
1453414534
bool
1453514535
SetupConstraintScope(FunctionDecl *FD,
1453614536
std::optional<ArrayRef<TemplateArgument>> TemplateArgs,

clang/lib/Analysis/UnsafeBufferUsage.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,13 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) {
453453
return false;
454454
}
455455

456-
if (const auto *IdxLit = dyn_cast<IntegerLiteral>(Node.getIdx())) {
457-
const APInt ArrIdx = IdxLit->getValue();
456+
Expr::EvalResult EVResult;
457+
const Expr *IndexExpr = Node.getIdx();
458+
if (!IndexExpr->isValueDependent() &&
459+
IndexExpr->EvaluateAsInt(EVResult, Finder->getASTContext())) {
460+
llvm::APSInt ArrIdx = EVResult.Val.getInt();
461+
// FIXME: ArrIdx.isNegative() we could immediately emit an error as that's a
462+
// bug
458463
if (ArrIdx.isNonNegative() && ArrIdx.getLimitedValue() < limit)
459464
return true;
460465
}

0 commit comments

Comments
 (0)