[LLVMdev] Programmatic compilation of C++ file into bitcode

David A. Greene greened at obbligato.org
Thu Feb 25 17:47:47 PST 2010

On Thursday 25 February 2010 17:30:24 Trevor Harmon wrote:
> On Feb 25, 2010, at 2:28 PM, Trevor Harmon wrote:
> > I'm not sure how the other program can find the output, unless
> > of course the analyzer simply dumps the file to a hard-coded
> > location (/tmp?).
> Replying to myself again...
> After sifting through many of the existing transforms, I discovered
> that new command-line parameters can be added to opt simply by
> declaring them in the transform code, such as in this example from
> Internalize.cpp:
>    static cl::opt<std::string>
>      APIFile("internalize-public-api-file", cl::value_desc("filename"),
>        cl::desc("A file containing list of symbol names to preserve"));
> So, the calling program can simply pass the name of a file to opt as a
> parameter, and it will then know exactly where the analyzer will send
> its output.

Of course the option will only affect Passes that actually examine it.
I missed the earlier part of this thread.  What kind of output do you
need?  I'm guessing some sort of dataflow information.  


More information about the llvm-dev mailing list