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

Chris Lattner clattner at apple.com
Sun Nov 22 06:43:46 PST 2009


On Nov 16, 2009, at 10:55 PM, Daniel Dunbar wrote:

> Ok, but why is it hard for clients to pass in an empty string as the
> default? That doesn't seem any harder than passing in 0.

Clients can also pass in StringRef()  if they really want a null one?

-Chris

> 
> - Daniel
> 
> On Fri, Nov 13, 2009 at 10:22 AM, Devang Patel <dpatel at apple.com> wrote:
>> 
>> On Nov 13, 2009, at 8:27 AM, Daniel Dunbar wrote:
>> 
>>> On Thu, Nov 12, 2009 at 9:14 AM, Devang Patel <dpatel at apple.com> wrote:
>>>> 
>>>> On Nov 12, 2009, at 9:04 AM, Daniel Dunbar wrote:
>>>> 
>>>> First, what's the motivation?
>>>> 
>>>> To avoid if(Str) check in StringRef constructor, I switched DebugInfo
>>>> APIs
>>>> to not use StringRef.
>>> 
>>> That part I guessed, however, I'm not sure why this is the right
>>> approach. Why does the DebugInfo interface need to deal with null
>>> strings so much?
>> 
>> To handle optional info.
>> 
>>> It seems like that responsibility could be pushed to
>>> clients, does clang even ever do this? Can you give me a concrete
>>> example of a specific problem?
>> 
>>    CreateGlobalVariable(DIDescriptor Context, const char * Name,
>>                         const char * DisplayName,
>>                         const char * LinkageName,
>>                         DICompileUnit CompileUnit,
>>                         unsigned LineNo, DIType Type, bool isLocalToUnit,
>>                         bool isDefinition, llvm::GlobalVariable *GV);
>> 
>> 
>> Here LinkageName is optional.
>> -
>> Devang
>> 
> 
> _______________________________________________
> 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