Skip to content

Commit 0ff992e

Browse files
committed
[clang][Interp][NFC] Get ComplexType directly
Instead of doing a isa<> + getAs<>
1 parent 6195e22 commit 0ff992e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,9 @@ bool ByteCodeExprGen<Emitter>::VisitImplicitValueInitExpr(const ImplicitValueIni
922922
return true;
923923
}
924924

925-
if (QT->isAnyComplexType()) {
925+
if (const auto *ComplexTy = E->getType()->getAs<ComplexType>()) {
926926
assert(Initializing);
927-
QualType ElemQT = QT->getAs<ComplexType>()->getElementType();
927+
QualType ElemQT = ComplexTy->getElementType();
928928
PrimType ElemT = classifyPrim(ElemQT);
929929
for (unsigned I = 0; I < 2; ++I) {
930930
if (!this->visitZeroInitializer(ElemT, ElemQT, E))
@@ -1098,13 +1098,13 @@ bool ByteCodeExprGen<Emitter>::VisitInitListExpr(const InitListExpr *E) {
10981098
return true;
10991099
}
11001100

1101-
if (T->isAnyComplexType()) {
1101+
if (const auto *ComplexTy = E->getType()->getAs<ComplexType>()) {
11021102
unsigned NumInits = E->getNumInits();
11031103

11041104
if (NumInits == 1)
11051105
return this->delegate(E->inits()[0]);
11061106

1107-
QualType ElemQT = E->getType()->getAs<ComplexType>()->getElementType();
1107+
QualType ElemQT = ComplexTy->getElementType();
11081108
PrimType ElemT = classifyPrim(ElemQT);
11091109
if (NumInits == 0) {
11101110
// Zero-initialize both elements.

0 commit comments

Comments
 (0)