Add an assert to CGDebugInfo::getTypeOrNull

This commit is contained in:
Fangrui Song 2021-01-11 13:25:20 -08:00
parent 9b222b108a
commit f4cec703ec
1 changed files with 1 additions and 0 deletions

View File

@ -3132,6 +3132,7 @@ static QualType UnwrapTypeForDebugInfo(QualType T, const ASTContext &C) {
}
llvm::DIType *CGDebugInfo::getTypeOrNull(QualType Ty) {
assert(Ty == UnwrapTypeForDebugInfo(Ty, CGM.getContext()));
auto It = TypeCache.find(Ty.getAsOpaquePtr());
if (It != TypeCache.end()) {
// Verify that the debug info still exists.