[LLVMdev] obtaining the address of an instruction...?

Mark Oskin markoskin at gmail.com
Sun Nov 4 10:25:50 PST 2007


Thanks.  But I found a work around (some nasty switch hack).

On Nov 3, 2007, at 10:22 PM, Gordon Henriksen wrote:

> On Nov 4, 2007, at 01:00, Mark Oskin wrote:
>
>> I'm currently working on a compiler pass, where it would be vastly
>> simplified if I could obtain the address of an instruction.  Any
>> suggestions on how to do this?  Effectively, I'm trying to translate
>> code that looks like this:
>>
>> instruction
>> branch
>>
>> into:
>>
>> instruction
>> call somewhere(&branch)
>> branch
>
> Hi Mark,
>
> The LLVM IR does not directly support this. If you elaborate upon what
> you're trying to accomplish, perhaps the list can suggest an approach
> that'll work for you.
>
> The MachineFunction representation does allow labels to be inserted to
> refer to arbitrary instructions.
>
> — Gordon
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list