[LLVMdev] Hooking the global symbol resolver

Óscar Fuentes ofv at wanadoo.es
Thu Mar 27 15:05:41 PDT 2008


"Jonathan S. Shapiro" <shap at eros-os.com> writes:

> On Thu, 2008-03-27 at 21:22 +0100, Óscar Fuentes wrote:
>> I'm all for hooks and delegation, but the problem here is that your
>> proposal is not general enough and is hard to generalize it. It does not
>> work for my project, for instance, although I face almost the same
>> requirements than you wrt dynamic generation. The symbol name is enough
>> for you, but not for me, and there is no way to teach LLVM about what
>> info I need.
>
> Is this because you have a more complicated scenario, or is it because
> your name mangling scheme is not sufficiently well designed?

Both :-) I guess that I could invent a name mangling schema, but it
certainly would be very complex and generate names of several kilobytes
for *each* function invocation. The issue is that the actual function
that is generated depends on the invocation point. For instance:

(foo)
(bar)
;; The code generated for this call to `foo'
;; may differ from the first call:
(foo)

[snip]
> but I am very confident that if an invertible
> mangling scheme is possible for you in principle, the time spent to
> develop one early will be repaid many times over later.

I agree that your idea about the hook can be useful for most typical
front-ends, as my project can be considered "weird".

-- 
Oscar




More information about the llvm-dev mailing list