[LLVMdev] Question about analysis at compile time

Devang Patel devang.patel at gmail.com
Fri Dec 4 11:14:35 PST 2009

Hi Jeffrey,

On Thu, Dec 3, 2009 at 11:59 AM, Jeffrey Bickford
<jbickfrd at cs.rutgers.edu> wrote:
> Hello,
> I am currently working on a project that requires me to do some
> analysis on code as it compiles.  I would like to print out all type
> definitions for a kernel while it is compiling.  I can successfully
> compile a kernel using llvm-gcc. I have been looking into writing a
> pass to do this but do not know how to run a pass at compile time.  Is
> there any tool already available to do this?
> Someone mentioned to me in the irc channel that I can add a pass to the
> llvm-gcc source code.  Would anyone know specifically what files I
> would need to edit and look through?  Thank you for any help.

If you're writing  a llvm pass then see llvm-backend.cpp and follow
createStandardModulePasses() call.


More information about the llvm-dev mailing list