[LLVMdev] Jello
Misha Brukman
brukman at uiuc.edu
Mon Apr 5 20:32:01 PDT 2004
On Mon, Apr 05, 2004 at 09:20:16PM -0400, Vinay S. Belgaumkar wrote:
> Meanwhile, I had another question - is there a way in llvm to look at
> the SSA form of a program and then modify the SSA, and then recompile
> this modified SSA ? If so, is there any documentation regarding this ?
What (I think) you want to do is this:
1. Decompile the bytecode program to human-readable text form (which we call
LLVM assembly)
2. Modify the assembly code
3. Reassemble the text assembly code back into bytecode format
If that's the case, here's how to do it:
1. llvm-dis bytecode.bc
This produces bytecode.ll which is LLVM assembly text.
2. Use your favorite text editor to modify bytecode.ll -- note that in
llvm/utils/{vim,emacs} we provide syntax-highlighting modes for those
two editors.
3. llvm-as bytecode.ll -f
This will assemble the text back into bytecode, -f means "force overwrite"
of bytecode.bc since it already exists.
To get more info on each tool, run:
% llvm-as -help
% llvm-dis -help
> I saw some stuff on the program JELLO, does it do the same thing ?
Jello was the codename for the LLVM JIT compiler, which is now part of
the tool `lli'. That's not what you're looking for.
Hope this helps,
--
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
More information about the llvm-dev
mailing list