aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 3c1bdf9..c4679bd 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -1511,10 +1511,8 @@ public:
llvm::Type *ValTy = CGM.getTypes().ConvertType(destType);
bool HasFlexibleArray = false;
- if (const auto *RT = destType->getAs<RecordType>())
- HasFlexibleArray = RT->getOriginalDecl()
- ->getDefinitionOrSelf()
- ->hasFlexibleArrayMember();
+ if (const auto *RD = destType->getAsRecordDecl())
+ HasFlexibleArray = RD->hasFlexibleArrayMember();
return Const.build(ValTy, HasFlexibleArray);
}
@@ -2757,10 +2755,9 @@ llvm::Constant *CodeGenModule::EmitNullConstant(QualType T) {
return llvm::ConstantArray::get(ATy, Array);
}
- if (const RecordType *RT = T->getAs<RecordType>())
- return ::EmitNullConstant(*this,
- RT->getOriginalDecl()->getDefinitionOrSelf(),
- /*complete object*/ true);
+ if (const auto *RD = T->getAsRecordDecl())
+ return ::EmitNullConstant(*this, RD,
+ /*asCompleteObject=*/true);
assert(T->isMemberDataPointerType() &&
"Should only see pointers to data members here!");