Skip to content

Commit 1d317f2

Browse files
committed
clang format
1 parent 93c0450 commit 1d317f2

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
996996
Address DestVal = Dest.getAddress();
997997
SourceLocation Loc = E->getExprLoc();
998998

999-
assert (RV.isScalar() && "RHS of HLSL splat cast must be a scalar.");
999+
assert(RV.isScalar() && "RHS of HLSL splat cast must be a scalar.");
10001000
llvm::Value *SrcVal = RV.getScalarVal();
10011001
EmitHLSLSplatCast(CGF, DestVal, DestTy, SrcVal, SrcTy, Loc);
10021002
break;

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
27972797
}
27982798
case CK_HLSLSplatCast: {
27992799
// This cast should only handle splatting from vectors of length 1.
2800-
// But in Sema a cast should have been inserted to convert the vec1 to a scalar
2800+
// But in Sema a cast should have been inserted to convert the vec1 to a
2801+
// scalar
28012802
assert(DestTy->isVectorType() && "Destination type must be a vector.");
28022803
auto *DestVecTy = DestTy->getAs<VectorType>();
28032804
QualType SrcTy = E->getType();

clang/lib/Sema/SemaCast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,9 +2797,9 @@ void CastOperation::CheckCXXCStyleCast(bool FunctionalStyle,
27972797
const VectorType *VT = SrcTy->getAs<VectorType>();
27982798
// change splat from vec1 case to splat from scalar
27992799
if (VT && VT->getNumElements() == 1)
2800-
SrcExpr = Self.ImpCastExprToType(SrcExpr.get(), VT->getElementType(),
2801-
CK_HLSLVectorTruncation,
2802-
SrcExpr.get()->getValueKind(), nullptr, CCK);
2800+
SrcExpr = Self.ImpCastExprToType(
2801+
SrcExpr.get(), VT->getElementType(), CK_HLSLVectorTruncation,
2802+
SrcExpr.get()->getValueKind(), nullptr, CCK);
28032803
Kind = CK_HLSLSplatCast;
28042804
return;
28052805
}

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2812,7 +2812,8 @@ bool SemaHLSL::CanPerformSplatCast(Expr *Src, QualType DestTy) {
28122812
QualType SrcTy = Src->getType();
28132813
// Not a valid HLSL Splat cast if Dest is a scalar or if this is going to
28142814
// be a vector splat from a scalar.
2815-
if ((SrcTy->isScalarType() && DestTy->isVectorType()) || DestTy->isScalarType())
2815+
if ((SrcTy->isScalarType() && DestTy->isVectorType()) ||
2816+
DestTy->isScalarType())
28162817
return false;
28172818

28182819
const VectorType *SrcVecTy = SrcTy->getAs<VectorType>();

0 commit comments

Comments
 (0)