[cfe-commits] r108220 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Chris Lattner clattner at apple.com
Tue Jul 13 12:13:03 PDT 2010


Thanks, I'll add a warning to catch this.  Can't methods also be 'restrict'?  Can the code be factored with the existing debug info code that adds cvr qualifiers?

-Chris

On Jul 13, 2010, at 9:32 AM, Devang Patel wrote:

> I did and it worked because 0x1 && 1 is fine. Thanks for catching this. Fixed. Added test case also.
> -
> Devang
> On Jul 12, 2010, at 10:53 PM, Chris Lattner wrote:
> 
>> 
>> On Jul 12, 2010, at 5:24 PM, Devang Patel wrote:
>> 
>>> Author: dpatel
>>> Date: Mon Jul 12 19:24:30 2010
>>> New Revision: 108220
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=108220&view=rev
>>> Log:
>>> const qualify debug info for "this" for const methods.
>> 
>> Did you test this Devang?  This should use & instead of &&.
>> 
>> -Chris
>> 
>>> 
>>> Modified:
>>>  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=108220&r1=108219&r2=108220&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 12 19:24:30 2010
>>> @@ -536,6 +536,13 @@
>>>   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);
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> 
> 





More information about the cfe-commits mailing list