[LLVMdev] Fetching the functions in C files
jtcriswel at gmail.com
Tue Oct 21 16:02:46 PDT 2014
On 10/21/14, 5:27 PM, Amir H. Ashouri wrote:
> Hello Everyone,
> Just subscribed to the mailing list.
> I was wondering how I am going to fetch each functions of a specific
> source code file (c/c++) using the LLVM framework. For instance, I
> would like to apply certain passes using llvm-opt on certain functions
> not the whole file.
> I would appreciate any hints or idea leading me about the starting point.
You might be able to use the llvm-extract tool to pull out the functions
you want into a separate bitcode file and then use opt to optimize
them. You'd then need to create a second bitcode file that contains the
remaining functions (using llvm-extract again). Finally, you'd take the
optimized bitcode file and the bitcode file containing the other
functions and link them together using clang and libLTO or the llvm-link
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Department of Computer Science, University of Rochester
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev