Skip to content

Commit 93f1fac

Browse files
spallefriedma-quic
andauthored
Update clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
Co-authored-by: Eli Friedman <[email protected]>
1 parent eb6debf commit 93f1fac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ bool HLSLBufferLayoutBuilder::layoutField(const FieldDecl *FD,
195195
// Unwrap array to find the element type and get combined array size.
196196
QualType Ty = FieldTy;
197197
while (Ty->isConstantArrayType()) {
198-
const ConstantArrayType *ArrayTy =
199-
cast<ConstantArrayType>(Ty->getUnqualifiedDesugaredType());
198+
auto *ArrayTy = CGM.getContext().getAsConstantArrayType(Ty);
200199
ArrayCount *= ArrayTy->getSExtSize();
201200
Ty = ArrayTy->getElementType();
202201
}

0 commit comments

Comments
 (0)