[LLVMdev] Running LLVM Analysis on real-world projects.

Misha Brukman brukman at cs.uiuc.edu
Fri Mar 31 07:46:36 PST 2006

On Fri, Mar 31, 2006 at 11:38:35AM +0530, Pratik Mehta wrote:
> Thanks for your valuable input. By the way, I am exporting CC=llvm-gcc
> and RANLIB=llvm-ranlib for projects that use it. It was a mistake not
> to write it in the post as apache indeed uses gcc. If you see the
> error message, you would see llvm-gcc being used. 

Very well, sorry about the digression.

> I would try to investigate further on the lines you have mentioned.
> However, the question that stands is how to best handle failure to
> compile few files, as I am only interested in generating the bytecode
> and merging it in one file to run the analysis and not executing the
> bytecode.

If LLVM cannot compile those files, you really have two choices:

1) Figure out what the error is and fix it (*), or
2) Ignore the failure and stick with what you can compile

Naturally, if a file contains one of the major methods in the program,
(2) may not work so you have to abandon the package and either try
another similar package or another version of the same package.

Also, note that while LLVM is wonderful and good, it may not be perfect
(yet).  That means that if you cannot run the program, you may not be
sure if it were compiled correctly (if it runs and passes unittests, at
least you've got some code coverage).  Incorrect compilation will affect
your analysis as you're not analyzing the original program.

(*) Note that if it's an LLVM bug, file it and it may get automagically
fixed before you know it (though you're welcome to submit patches as
well).  If it's a bug in the application source code, you can fix it
yourself (and send a patch upstream).

Misha Brukman :: http://misha.brukman.net

More information about the llvm-dev mailing list