[LLVMdev] DebugFactory

Talin viridia at gmail.com
Fri Oct 9 20:58:29 PDT 2009


The old patch works, it's just that when you pass "0, 0, 0" for size, 
align and offset the compiler can't decide which method to call since 
"0" can be either a pointer or an integer.

I can produce a new patch if you like, but I'm having trouble thinking 
of good names for the new methods. Alternatively, I suppose we could 
re-arrange the order of the parameters slightly to make the overloaded 
methods unambiguous.

I'd like to hear what you think before proceeding any further. I do want 
to get this in, though, as it has been very useful to my work.

Talin wrote:
> OK so the problem is that the compiler sees '0' and can't decide whether its
> an integer or a null pointer of type Constant *. I guess the new functions
> will have to have slightly different names.
>
> On Wed, Oct 7, 2009 at 9:50 AM, Devang Patel <devang.patel at gmail.com> wrote:
>
>   
>> On Thu, Oct 1, 2009 at 8:34 PM, Talin <viridia at gmail.com> wrote:
>>     
>>> Here is a patch that does just that.
>>>       
>> This does not work. I'm getting
>>
>> llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp: In member function
>> ‘llvm::DIType
>> clang::CodeGen::CGDebugInfo::CreateQualifiedType(clang::QualType,
>> llvm::DICompileUnit)’:
>> /Users/yash/clean/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:225:
>> error: call of overloaded ‘CreateDerivedType(unsigned int&,
>> llvm::DICompileUnit&, const char [1], llvm::DICompileUnit, int, int,
>> int, int, int, llvm::DIType&)’ is ambiguous
>> llvm/include/llvm/Analysis/DebugInfo.h:530: note: candidates are:
>> llvm::DIDerivedType llvm::DIFactory::CreateDerivedType(unsigned int,
>> llvm::DIDescriptor, llvm::StringRef, llvm::DICompileUnit, unsigned
>> int, uint64_t, uint64_t, uint64_t, unsigned int, llvm::DIType)
>> llvm/include/llvm/Analysis/DebugInfo.h:540: note:
>> llvm::DIDerivedType llvm::DIFactory::CreateDerivedType(unsigned int,
>> llvm::DIDescriptor, const std::string&, llvm::DICompileUnit, unsigned
>> int, llvm::Constant*, llvm::Constant*, llvm::Constant*, unsigned int,
>> llvm::DIType)
>>
>> -
>> Devang
>>
>>     
>
>
>
>   




More information about the llvm-dev mailing list