Take a look at FormatAttr.

On Feb 10, 2010, at 11:41 PM, Chris Lattner wrote:

> 
> On Feb 10, 2010, at 9:54 PM, Ted Kremenek wrote:
> 
>> Not all of these attributes use strings based on StringExprs, but for those 
>> that do that's a good idea.
> 
> Are you sure?  I see code like this:
> 
>> -  d->addAttr(::new (S.Context) AliasAttr(Str->getString()));
>> +  d->addAttr(::new (S.Context) AliasAttr(S.Context, Str->getString()));
> 
> Can't it just use Str instead of Str->getString()?
> 
> -Chris
> 
>> 
>> On Feb 10, 2010, at 9:38 PM, Chris Lattner wrote:
>> 
>>> 
>>> On Feb 10, 2010, at 9:28 PM, Ted Kremenek wrote:
>>> 
>>>> Author: kremenek
>>>> Date: Wed Feb 10 23:28:37 2010
>>>> New Revision: 95853
>>>> 
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=95853&view=rev
>>>> Log:
>>>> Remove use of 'std::string' from Attr objects, using instead a byte
>>>> array allocated using the allocator in ASTContext.  This addresses
>>>> these strings getting leaked when using a BumpPtrAllocator (in
>>>> ASTContext).
>>>> 
>>>> Fixes: <rdar://problem/7636765>
>>> 
>>> Would it work to just make these have StringExpr*'s?  The memory is already 
>>> allocated by the parsing/sema code, do we really need to copy it?
> 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to