]> granicus.if.org Git - clang/commitdiff
const qualify debug info for "this" for const methods.
authorDevang Patel <dpatel@apple.com>
Tue, 13 Jul 2010 00:24:30 +0000 (00:24 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 13 Jul 2010 00:24:30 +0000 (00:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108220 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 80d5f1af5e4807f4e8791b7752947c6b7e92b41b..a3c4003ff5be1fa3d065b8219dedaa40538a98db 100644 (file)
@@ -536,6 +536,13 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
     Context.getPointerType(Context.getTagDeclType(Method->getParent()));
   llvm::DIType ThisPtrType = 
     DebugFactory.CreateArtificialType(getOrCreateType(ThisPtr, Unit));
+
+  if (Method->getTypeQualifiers() && Qualifiers::Const)
+    ThisPtrType = 
+      DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_const_type, 
+                                     Unit, "", Unit,
+                                     0, 0, 0, 0, 0, ThisPtrType);
+
   TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;  
   Elts.push_back(ThisPtrType);