Skip to content

Commit 41f54fe

Browse files
committed
rename cast from HLSLSplatCast to HLSLAggregateSplatCast
1 parent 1d317f2 commit 41f54fe

File tree

16 files changed

+29
-26
lines changed

16 files changed

+29
-26
lines changed

clang/include/clang/AST/OperationKinds.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ CAST_OPERATION(HLSLArrayRValue)
371371
CAST_OPERATION(HLSLElementwiseCast)
372372

373373
// Splat cast for Aggregates (HLSL only).
374-
CAST_OPERATION(HLSLSplatCast)
374+
CAST_OPERATION(HLSLAggregateSplatCast)
375375

376376
//===- Binary Operations -------------------------------------------------===//
377377
// Operators listed in order of precedence.

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ bool CastExpr::CastConsistency() const {
19571957
case CK_HLSLArrayRValue:
19581958
case CK_HLSLVectorTruncation:
19591959
case CK_HLSLElementwiseCast:
1960-
case CK_HLSLSplatCast:
1960+
case CK_HLSLAggregateSplatCast:
19611961
CheckNoBasePath:
19621962
assert(path_empty() && "Cast kind should not have a base path!");
19631963
break;

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15029,7 +15029,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
1502915029
case CK_FixedPointCast:
1503015030
case CK_IntegralToFixedPoint:
1503115031
case CK_MatrixCast:
15032-
case CK_HLSLSplatCast:
15032+
case CK_HLSLAggregateSplatCast:
1503315033
llvm_unreachable("invalid cast kind for integral value");
1503415034

1503515035
case CK_BitCast:
@@ -15908,7 +15908,7 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
1590815908
case CK_MatrixCast:
1590915909
case CK_HLSLVectorTruncation:
1591015910
case CK_HLSLElementwiseCast:
15911-
case CK_HLSLSplatCast:
15911+
case CK_HLSLAggregateSplatCast:
1591215912
llvm_unreachable("invalid cast kind for complex value");
1591315913

1591415914
case CK_LValueToRValue:

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5339,7 +5339,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {
53395339
case CK_HLSLVectorTruncation:
53405340
case CK_HLSLArrayRValue:
53415341
case CK_HLSLElementwiseCast:
5342-
case CK_HLSLSplatCast:
5342+
case CK_HLSLAggregateSplatCast:
53435343
return EmitUnsupportedLValue(E, "unexpected cast lvalue");
53445344

53455345
case CK_Dependent:

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ static bool isTrivialFiller(Expr *E) {
491491
return false;
492492
}
493493

494-
static void EmitHLSLSplatCast(CodeGenFunction &CGF, Address DestVal,
495-
QualType DestTy, llvm::Value *SrcVal,
496-
QualType SrcTy, SourceLocation Loc) {
494+
static void EmitHLSLAggregateSplatCast(CodeGenFunction &CGF, Address DestVal,
495+
QualType DestTy, llvm::Value *SrcVal,
496+
QualType SrcTy, SourceLocation Loc) {
497497
// Flatten our destination
498498
SmallVector<QualType> DestTypes; // Flattened type
499499
SmallVector<std::pair<Address, llvm::Value *>, 16> StoreGEPList;
@@ -988,7 +988,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
988988
case CK_HLSLArrayRValue:
989989
Visit(E->getSubExpr());
990990
break;
991-
case CK_HLSLSplatCast: {
991+
case CK_HLSLAggregateSplatCast: {
992992
Expr *Src = E->getSubExpr();
993993
QualType SrcTy = Src->getType();
994994
RValue RV = CGF.EmitAnyExpr(Src);
@@ -998,7 +998,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
998998

999999
assert(RV.isScalar() && "RHS of HLSL splat cast must be a scalar.");
10001000
llvm::Value *SrcVal = RV.getScalarVal();
1001-
EmitHLSLSplatCast(CGF, DestVal, DestTy, SrcVal, SrcTy, Loc);
1001+
EmitHLSLAggregateSplatCast(CGF, DestVal, DestTy, SrcVal, SrcTy, Loc);
10021002
break;
10031003
}
10041004
case CK_HLSLElementwiseCast: {
@@ -1591,7 +1591,7 @@ static bool castPreservesZero(const CastExpr *CE) {
15911591
case CK_AtomicToNonAtomic:
15921592
case CK_HLSLVectorTruncation:
15931593
case CK_HLSLElementwiseCast:
1594-
case CK_HLSLSplatCast:
1594+
case CK_HLSLAggregateSplatCast:
15951595
return true;
15961596

15971597
case CK_BaseToDerivedMemberPointer:

clang/lib/CodeGen/CGExprComplex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ ComplexPairTy ComplexExprEmitter::EmitCast(CastKind CK, Expr *Op,
611611
case CK_HLSLVectorTruncation:
612612
case CK_HLSLArrayRValue:
613613
case CK_HLSLElementwiseCast:
614-
case CK_HLSLSplatCast:
614+
case CK_HLSLAggregateSplatCast:
615615
llvm_unreachable("invalid cast kind for complex value");
616616

617617
case CK_FloatingRealToComplex:

clang/lib/CodeGen/CGExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ class ConstExprEmitter
13361336
case CK_HLSLVectorTruncation:
13371337
case CK_HLSLArrayRValue:
13381338
case CK_HLSLElementwiseCast:
1339-
case CK_HLSLSplatCast:
1339+
case CK_HLSLAggregateSplatCast:
13401340
return nullptr;
13411341
}
13421342
llvm_unreachable("Invalid CastKind");

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
27952795
llvm::Value *Zero = llvm::Constant::getNullValue(CGF.SizeTy);
27962796
return Builder.CreateExtractElement(Vec, Zero, "cast.vtrunc");
27972797
}
2798-
case CK_HLSLSplatCast: {
2798+
case CK_HLSLAggregateSplatCast: {
27992799
// This cast should only handle splatting from vectors of length 1.
28002800
// But in Sema a cast should have been inserted to convert the vec1 to a
28012801
// scalar
@@ -2804,7 +2804,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
28042804
QualType SrcTy = E->getType();
28052805
SourceLocation Loc = CE->getExprLoc();
28062806
Value *V = Visit(const_cast<Expr *>(E));
2807-
assert(SrcTy->isBuiltinType() && "Invalid HLSL splat cast.");
2807+
assert(SrcTy->isBuiltinType() && "Invalid HLSL Aggregate splat cast.");
28082808

28092809
Value *Cast =
28102810
EmitScalarConversion(V, SrcTy, DestVecTy->getElementType(), Loc);
@@ -2816,7 +2816,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
28162816
SourceLocation Loc = CE->getExprLoc();
28172817
QualType SrcTy = E->getType();
28182818

2819-
assert(RV.isAggregate() && "Not a valid HLSL Flat Cast.");
2819+
assert(RV.isAggregate() && "Not a valid HLSL Elementwise Cast.");
28202820
// RHS is an aggregate
28212821
Address SrcVal = RV.getAggregateAddress();
28222822
return EmitHLSLElementwiseCast(CGF, SrcVal, SrcTy, DestTy, Loc);

clang/lib/Edit/RewriteObjCFoundationAPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg,
10861086

10871087
case CK_HLSLVectorTruncation:
10881088
case CK_HLSLElementwiseCast:
1089-
case CK_HLSLSplatCast:
1089+
case CK_HLSLAggregateSplatCast:
10901090
llvm_unreachable("HLSL-specific cast in Objective-C?");
10911091
break;
10921092

clang/lib/Sema/Sema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
709709
case CK_ToVoid:
710710
case CK_NonAtomicToAtomic:
711711
case CK_HLSLArrayRValue:
712-
case CK_HLSLSplatCast:
712+
case CK_HLSLAggregateSplatCast:
713713
break;
714714
}
715715
}

0 commit comments

Comments
 (0)