[LLVMdev] Getting address of label in jitted code[MESSAGE NOT SCANNED]

Dan Gohman gohman at apple.com
Fri Jan 23 11:45:05 PST 2009


On Jan 23, 2009, at 10:06 AM, Mark Shannon wrote:

> Dan Gohman wrote:
>>
>> LLVM doesn't support taking the real address of a label. It may
>> some day, but that won't by itself make it safe to jump into
>> compiled code from separately-compiled code. To do that, you'd
>> need to arrange some stable set of assumptions about the state
>> of the machine at the time of the jump, and a way to tell the
>> code generator where and how to stay within the assumptions.
>> And that's essentially what function calling conventions
>> already are.
>
> I can guarantee correctness, I just need  to be able to get that  
> address!
>
> Please answer the question, I answered yours ;)

I did. The answer is LLVM doesn't support it.

The other answer is that patches to add support for this would
be welcome, even if we remain unconvinced about the specific
use case you're proposing. From LLVM's perspective, it would be
valuable as a way to generate more efficient code for GCC's
labels-as-values extension.

Dan




More information about the llvm-dev mailing list