const qualify debug info for "this" for const methods.

llvm-svn: 108220
This commit is contained in:
Devang Patel 2010-07-13 00:24:30 +00:00
parent 54e620d2c7
commit 0a34e31d81
1 changed files with 7 additions and 0 deletions

View 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);