[LLVMdev] How could I get memory address for each basic block?

Chris Lattner sabre at nondot.org
Thu Aug 19 17:27:01 PDT 2004


On Thu, 19 Aug 2004, Vikram S. Adve wrote:
> The dynamic optimization project (an internal research project in our
> group) uses some way to map LLVM basic blocks to native code addresses.
> If this is what you want, perhaps you can ask Brian Gaeke
> (gaeke at uiuc.edu) to give you some information about how that is done.

I'm still quite curious why you want to do this.  If you want to get the
machine code address of particular places in the code, you could always
insert an intrinsic function that the code generator handles specially.

Why do you think you need the address of a basic block?  What are you
trying to do?

-Chris



> On Aug 19, 2004, at 5:11 PM, Misha Brukman wrote:
>
> > On Thu, Aug 19, 2004 at 01:13:42PM -0700, Zhang Qiuyu wrote:
> >> On the pervious mail, I am trying to add label for each basic basic
> >> because I think I could get address by using nm if nm can show the
> >> address of each label, but it seems not . so do you guys have some
> >> idea how to get address for each basic block? Thanks.
> >
> > LLVM does not have a notion of C-style 'labels' that you can address
> > and
> > use as parameters.  LLVM labels are simply NAMES of basic blocks, and
> > they are printed out as `labels'.
> >
> > You can 'set' a name for a BasicBlock, but that's not what you are
> > looking for, please see my other email for more details.
> >
> > --
> > Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

-- 
http://llvm.org/
http://nondot.org/sabre/




More information about the llvm-dev mailing list