[LLVMdev] Performing my own pass with a single command line?

Zheng Wang jason.wangz at gmail.com
Mon Apr 19 06:29:13 PDT 2010


As far as I know, the LLVM pass manager only perform at the llvm
bytecode level.

This means for each program, I have to convert it to a LLVM bytecode by:

llvm-gcc -c -emit-llvm test.c

then, I can issue the llvm pass manager to invoke my own pass and
produce an output as LLVM bytecode, such as:

opt -my-pass < test.o > test.new.o

After this point, I need to convert it to assembly code using llc,
then to use 'as' to compile the assembly code to an object file, and
finally I can
use gcc to generate an executable program.

*****My question is*****, is there any way to automatically evoke the
pass manager, such as:

llvm-gcc -c test.c

and in such a way my own pass will be evoked?


More information about the llvm-dev mailing list