Skip to content

Commit 7331af6

Browse files
committed
address pr comments
1 parent 41f54fe commit 7331af6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ static void EmitHLSLAggregateSplatCast(CodeGenFunction &CGF, Address DestVal,
500500
// ^^ Flattened accesses to DestVal we want to store into
501501
CGF.FlattenAccessAndType(DestVal, DestTy, StoreGEPList, DestTypes);
502502

503-
assert(SrcTy->isScalarType() && "Invalid HLSL splat cast.");
504-
for (unsigned I = 0, Size = StoreGEPList.size(); I < Size; I++) {
503+
assert(SrcTy->isScalarType() && "Invalid HLSL Aggregate splat cast.");
504+
for (unsigned I = 0, Size = StoreGEPList.size(); I < Size; ++I) {
505505
llvm::Value *Cast =
506506
CGF.EmitScalarConversion(SrcVal, SrcTy, DestTypes[I], Loc);
507507

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,14 +2804,14 @@ bool SemaHLSL::ContainsBitField(QualType BaseTy) {
28042804
return false;
28052805
}
28062806

2807-
// Can perform an HLSL splat cast if the Dest is an aggregate and the
2807+
// Can perform an HLSL Aggregate splat cast if the Dest is an aggregate and the
28082808
// Src is a scalar or a vector of length 1
28092809
// Or if Dest is a vector and Src is a vector of length 1
2810-
bool SemaHLSL::CanPerformSplatCast(Expr *Src, QualType DestTy) {
2810+
bool SemaHLSL::CanPerformAggregateSplatCast(Expr *Src, QualType DestTy) {
28112811

28122812
QualType SrcTy = Src->getType();
2813-
// Not a valid HLSL Splat cast if Dest is a scalar or if this is going to
2814-
// be a vector splat from a scalar.
2813+
// Not a valid HLSL Aggregate Splat cast if Dest is a scalar or if this is
2814+
// going to be a vector splat from a scalar.
28152815
if ((SrcTy->isScalarType() && DestTy->isVectorType()) ||
28162816
DestTy->isScalarType())
28172817
return false;
@@ -2831,7 +2831,7 @@ bool SemaHLSL::CanPerformSplatCast(Expr *Src, QualType DestTy) {
28312831
llvm::SmallVector<QualType> DestTypes;
28322832
BuildFlattenedTypeList(DestTy, DestTypes);
28332833

2834-
for (unsigned I = 0, Size = DestTypes.size(); I < Size; I++) {
2834+
for (unsigned I = 0, Size = DestTypes.size(); I < Size; ++I) {
28352835
if (DestTypes[I]->isUnionType())
28362836
return false;
28372837
if (!CanPerformScalarCast(SrcTy, DestTypes[I]))

clang/test/CodeGenHLSL/BasicFeatures/SplatCast.hlsl renamed to clang/test/CodeGenHLSL/BasicFeatures/AggregateSplatCast.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct S {
5252
float Y;
5353
};
5454

55-
// struct splats?
55+
// struct splats
5656
// CHECK-LABEL: define void {{.*}}call3
5757
// CHECK: [[A:%.*]] = alloca <1 x i32>, align 4
5858
// CHECK: [[s:%.*]] = alloca %struct.S, align 4

0 commit comments

Comments
 (0)