[LLVMdev] Re: How could I get memory address for each assemble code?
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Tue Sep 21 08:18:54 PDT 2004
This can be done with a quick hack. Just modify the assembly printer to
emit a symbol that encodes the basic block uniquely. I have had to do
something similar, and I take the function name (with full type
information) and the label of the BB and hash them with crc32. This
gives a unique int which you can use in a label (which you output) to
uniquely identify the entry point of a basic block. There are problems
if the hash is not unique or if there is not a 1-1 mapping of BB to
machine BB or if a function is defined in multiple modules with the
exact same type.
Anyway, it's a start.
Andrew
On Mon, 2004-09-20 at 17:02, Zhang Qiuyu wrote:
>
> Thanks John and Chris.
>
> I could get the address information by the way you guys mentioned. But
> it is not what I want, because it will lose information about the
> entry of basic block. Actually what I want to get is the address of
> each entry of basic block. Now I am trying to declare the label of
> basic block as global type, hopefully I can get it from symbol table.
> Can I get it by this way?
>
> Thanks
>
> >For example,
>
> >llc -o file.s file.bc
> >gcc -o file.o file.s
> >objdump -d file.o
>
> >This would produce the list of native code instructions generated by
> >llc, including the addresses of the native code instructions.
>
> >Is this the sort of answer you're looking for?
>
> >Hi all,
>
> >I am trying to disassemble *.bc to assemble code by using llvm-dis
> command, but what I got is like the following. So how >could I get the
> assemble code like objdump? I mean the memory address for each
> instruction.
>
> >Thanks
>
> >Qiuyu
>
>
>
>
> ______________________________________________________________________
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list