@@ -492,28 +492,25 @@ static bool isTrivialFiller(Expr *E) {
492492}
493493
494494static 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) {
497497 // Flatten our destination
498498 SmallVector<QualType> DestTypes; // Flattened type
499499 SmallVector<llvm::Value *, 4 > IdxList;
500500 SmallVector<std::pair<Address, llvm::Value *>, 16 > StoreGEPList;
501501 // ^^ 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);
504503
505504 if (const VectorType *VT = SrcTy->getAs <VectorType>()) {
506505 assert (VT->getNumElements () == 1 && " Invalid HLSL splat cast." );
507506
508507 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" );
511509 }
512510 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);
517514 CGF.PerformStore (StoreGEPList[i], Cast);
518515 }
519516}
@@ -999,7 +996,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
999996 QualType DestTy = E->getType ();
1000997 Address DestVal = Dest.getAddress ();
1001998 SourceLocation Loc = E->getExprLoc ();
1002-
999+
10031000 if (RV.isScalar ()) {
10041001 llvm::Value *SrcVal = RV.getScalarVal ();
10051002 EmitHLSLSplatCast (CGF, DestVal, DestTy, SrcVal, SrcTy, Loc);
0 commit comments