[LLVMdev] Passing DW_TAG_typedef as the type to DIBuilder's createFunction

Duncan Sands baldrick at free.fr
Tue Apr 16 22:39:00 PDT 2013


Hi Eric,
>> But then we still don't emit anything about the function (& neither does GCC).
>> So make it a member function (so we are forced to emit the declaration
>> even without complicating the example by having to add a definition
>> (which by necessity cannot use the typedef))... and then we see that
>> the subprogram description doesn't refer to a function type at all. It
>> refers to a return type and it has its own parameters directly. (
>> typedef int foo(int); struct bar { foo f; }; int main() { bar b;
>> b.f(3); }; )
>>
>
> I couldn't come up with any code to make it the type of a function
> rather than a function pointer or a member variable that happens to be
> a function pointer. :)

I guess you only tried obscure languages like C and C++ :)  I don't see why it
shouldn't be theoretically possible, for some language.  But as David explained
to me, the current design is pragmatic: do something that works for the
front-ends we have; extend when necessary.  I've got to admit that as far as
dragonegg is concerned, it looks like there will always be an appropriate
function type floating around that can be used, so I plan to just fix this up
in dragonegg and worry about funky languages when and if they show up one day.

Ciao, Duncan.



More information about the llvm-dev mailing list