[cfe-commits] r54659 - in /cfe/trunk/lib/CodeGen: CGExprConstant.cpp CGObjC.cpp CGObjCGNU.cpp CGObjCMac.cpp CGObjCRuntime.h

Chris Lattner clattner at apple.com
Sat Aug 23 17:02:15 PDT 2008

On Aug 11, 2008, at 10:37 PM, Daniel Dunbar wrote:

> The purpose was to simplify the API since both consumers were making  
> std::strings
> after the call anyhow. This needs to be updated anyway as the  
> strings should probably
> be interned in the same way that CodeGenModule is interning c-strings.
> I'll change the interface to take the ObjCStringLiteral directly and  
> do the more efficient
> thing.


> Note that on the string copying level of efficiency CodeGenModule  
> currently does more
> copying than it should. We should merge getStringForStringLiteral with
> GetAddrOfConstantString (once the terminating '\0' semantics are  
> worked out) and then
> it is easy to make efficient.

That would be nice, string thrashing causes heap thrashing, which is  
pretty expensive.  StringMap is also an efficient way to store/unique  
strings.  Maybe it could help.


More information about the cfe-commits mailing list