[LLVMdev] How to extract the starting address of each basic block with llvm?

Jevin Sweval jevinsweval at gmail.com
Fri Mar 28 15:57:33 PDT 2014


On Fri, Mar 28, 2014 at 4:04 PM, Petsas Athanasios <petsas at ics.forth.gr> wrote:
> Thank you very much Jevin for the suggestion!
>
> But how I can use blockaddress function? Do I have to write a pass in order
> to use it?
> As I told you I am new in llvm. Could you provide me a guide or an example?
>
> Thank you very much,
> Thanasis

Well, a basic block doesn't have a concrete address until it is linked
by the linker. I think that you will have to write a pass that stores
the blockaddress of every BB to global variables like I mentioned in
my last mail. The perhaps you could use objdump + a script to dump the
addresses?

Cheers,
Jevin



More information about the llvm-dev mailing list