@@ -492,28 +492,25 @@ static bool isTrivialFiller(Expr *E) {
492
492
}
493
493
494
494
static void EmitHLSLSplatCast (CodeGenFunction &CGF, Address DestVal,
495
- QualType DestTy, llvm::Value *SrcVal,
496
- QualType SrcTy, SourceLocation Loc) {
495
+ QualType DestTy, llvm::Value *SrcVal,
496
+ QualType SrcTy, SourceLocation Loc) {
497
497
// Flatten our destination
498
498
SmallVector<QualType> DestTypes; // Flattened type
499
499
SmallVector<llvm::Value *, 4 > IdxList;
500
500
SmallVector<std::pair<Address, llvm::Value *>, 16 > StoreGEPList;
501
501
// ^^ Flattened accesses to DestVal we want to store into
502
- CGF.FlattenAccessAndType (DestVal, DestTy, IdxList, StoreGEPList,
503
- DestTypes);
502
+ CGF.FlattenAccessAndType (DestVal, DestTy, IdxList, StoreGEPList, DestTypes);
504
503
505
504
if (const VectorType *VT = SrcTy->getAs <VectorType>()) {
506
505
assert (VT->getNumElements () == 1 && " Invalid HLSL splat cast." );
507
506
508
507
SrcTy = VT->getElementType ();
509
- SrcVal = CGF.Builder .CreateExtractElement (SrcVal, (uint64_t )0 ,
510
- " vec.load" );
508
+ SrcVal = CGF.Builder .CreateExtractElement (SrcVal, (uint64_t )0 , " vec.load" );
511
509
}
512
510
assert (SrcTy->isScalarType () && " Invalid HLSL splat cast." );
513
- for (unsigned i = 0 ; i < StoreGEPList.size (); i ++) {
514
- llvm::Value *Cast = CGF.EmitScalarConversion (SrcVal, SrcTy,
515
- DestTypes[i],
516
- Loc);
511
+ for (unsigned i = 0 ; i < StoreGEPList.size (); i++) {
512
+ llvm::Value *Cast =
513
+ CGF.EmitScalarConversion (SrcVal, SrcTy, DestTypes[i], Loc);
517
514
CGF.PerformStore (StoreGEPList[i], Cast);
518
515
}
519
516
}
@@ -999,7 +996,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
999
996
QualType DestTy = E->getType ();
1000
997
Address DestVal = Dest.getAddress ();
1001
998
SourceLocation Loc = E->getExprLoc ();
1002
-
999
+
1003
1000
if (RV.isScalar ()) {
1004
1001
llvm::Value *SrcVal = RV.getScalarVal ();
1005
1002
EmitHLSLSplatCast (CGF, DestVal, DestTy, SrcVal, SrcTy, Loc);
0 commit comments