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. - Daniel ----- Original Message ---- From: Chris Lattner <[EMAIL PROTECTED]> To: Daniel Dunbar <[EMAIL PROTECTED]> Cc: [email protected] Sent: Monday, August 11, 2008 10:09:31 PM Subject: Re: [cfe-commits] r54659 - in /cfe/trunk/lib/CodeGen: CGExprConstant.cpp CGObjC.cpp CGObjCGNU.cpp CGObjCMac.cpp CGObjCRuntime.h On Aug 11, 2008, at 5:12 PM, Daniel Dunbar wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=54659&view=rev > Log: > Add ObjC constant string support for NeXT. > > Changed CGObjCRuntime::GenerateConstantString interface to take > std::string instead of char* and size. Hey Daniel, What is the advantage of this approach? The std::string does a copy of the data now which isn't strictly needed. -Chris _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
