From 769640e30d1e8ec2a6667daff1c2d0a28811138b Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 13 Jul 2010 00:24:30 +0000 Subject: [PATCH] const qualify debug info for "this" for const methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108220 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 80d5f1af5e..a3c4003ff5 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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); -- 2.40.0