OSDN Git Service

Add an assert to CGDebugInfo::getTypeOrNull
authorFangrui Song <i@maskray.me>
Mon, 11 Jan 2021 21:25:20 +0000 (13:25 -0800)
committerFangrui Song <i@maskray.me>
Mon, 11 Jan 2021 21:25:20 +0000 (13:25 -0800)
clang/lib/CodeGen/CGDebugInfo.cpp

index 7dc6457..2beb80b 100644 (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.