Skip to content

Commit 6dc781f

Browse files
committed
make clang format happy
1 parent e038166 commit 6dc781f

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -492,28 +492,25 @@ static bool isTrivialFiller(Expr *E) {
492492
}
493493

494494
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) {
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);

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,9 +2799,10 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
27992799
SrcTy = VecTy->getElementType();
28002800
}
28012801
assert(SrcTy->isScalarType() && "Invalid HLSL splat cast.");
2802-
Value *Cast = EmitScalarConversion(V, SrcTy,
2803-
DestVecTy->getElementType(), Loc);
2804-
return Builder.CreateVectorSplat(DestVecTy->getNumElements(), Cast, "splat");
2802+
Value *Cast =
2803+
EmitScalarConversion(V, SrcTy, DestVecTy->getElementType(), Loc);
2804+
return Builder.CreateVectorSplat(DestVecTy->getNumElements(), Cast,
2805+
"splat");
28052806
}
28062807
case CK_HLSLAggregateCast: {
28072808
RValue RV = CGF.EmitAnyExpr(E);

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2495,7 +2495,7 @@ bool SemaHLSL::CanPerformSplat(Expr *Src, QualType DestTy) {
24952495
llvm::SmallVector<QualType> DestTypes;
24962496
BuildFlattenedTypeList(DestTy, DestTypes);
24972497

2498-
for(unsigned i = 0; i < DestTypes.size(); i ++) {
2498+
for (unsigned i = 0; i < DestTypes.size(); i++) {
24992499
if (!CanPerformScalarCast(SrcTy, DestTypes[i]))
25002500
return false;
25012501
}

0 commit comments

Comments
 (0)