Trevor Harmon
2010-Feb-25 23:30 UTC
[LLVMdev] Programmatic compilation of C++ file into bitcode
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. Trevor
David A. Greene
2010-Feb-26 01:47 UTC
[LLVMdev] Programmatic compilation of C++ file into bitcode
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. -Dave
Trevor Harmon
2010-Feb-27 01:00 UTC
[LLVMdev] Programmatic compilation of C++ file into bitcode
On Feb 25, 2010, at 5:47 PM, David A. Greene wrote:> I missed the earlier part of this thread. What kind of output do you > need? I'm guessing some sort of dataflow information.I'm not entirely sure at this point, but it will most likely be some representation of the control flow graph that's been processed and filtered in some way. The output won't contain data flow information, at least not yet. Trevor
Maybe Matching Threads
- [LLVMdev] Programmatic compilation of C++ file into bitcode
- [LLVMdev] Programmatic compilation of C++ file into bitcode
- [LLVMdev] Programmatic compilation of C++ file into bitcode
- [LLVMdev] Programmatic compilation of C++ file into bitcode
- [LLVMdev] Programmatic compilation of C++ file into bitcode