CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal)

David Chisnall-2
Hello the list,

Is there a reason why this function exists?

CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal);

Aside from the confusing and misleading name (it emits an Objective-C string, in case you couldn't guess that from the name), it seems to be a layering violation since it's in CodeGenModule but implements behaviour specific to the Mac Objective-C runtimes (and isn't actually called anywhere outside CGObjCMac.cpp).

David
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal)

John McCall
On Mar 23, 2011, at 3:47 AM, David Chisnall wrote:
> Is there a reason why this function exists?
>
> CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal);
>
> Aside from the confusing and misleading name (it emits an Objective-C string, in case you couldn't guess that from the name), it seems to be a layering violation since it's in CodeGenModule but implements behaviour specific to the Mac Objective-C runtimes (and isn't actually called anywhere outside CGObjCMac.cpp).

Definitely seems like something to move to CGObjCMac.cpp.

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal)

jahanian
In reply to this post by David Chisnall-2

On Mar 23, 2011, at 3:47 AM, David Chisnall wrote:

> Hello the list,
>
> Is there a reason why this function exists?
>
> CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal);

Yes, it belongs to CGObjCMac.cpp. But in practice, it calls on routines local to CodeGenModule.cpp, which makes it more than
a move across refactoring.

- Fariborz

>
> Aside from the confusing and misleading name (it emits an Objective-C string, in case you couldn't guess that from the name), it seems to be a layering violation since it's in CodeGenModule but implements behaviour specific to the Mac Objective-C runtimes (and isn't actually called anywhere outside CGObjCMac.cpp).
>
> David
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

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