[clang] f4cec70 - Add an assert to CGDebugInfo::getTypeOrNull

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 13:25:27 PST 2021


Author: Fangrui Song
Date: 2021-01-11T13:25:20-08:00
New Revision: f4cec703ec8452f9d8b04fae171ba459adf38123

URL: https://github.com/llvm/llvm-project/commit/f4cec703ec8452f9d8b04fae171ba459adf38123
DIFF: https://github.com/llvm/llvm-project/commit/f4cec703ec8452f9d8b04fae171ba459adf38123.diff

LOG: Add an assert to CGDebugInfo::getTypeOrNull

Added: 
    

Modified: 
    clang/lib/CodeGen/CGDebugInfo.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 7dc6457d08d0..2beb80b2ab6c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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.


        


More information about the cfe-commits mailing list