[LLVMdev] SUBJ: Passing arguments to the LTO

Melanie Kambadur melanie at cs.columbia.edu
Wed Feb 22 12:47:14 PST 2012


Hi everyone,

We are implementing a profiling instrumentation tool as a part of
clang's LTO.  The tool inserts code at compile time that makes calls to a
runtime library (written as a C file) during program execution.  The
runtime library can collect different kinds of profile information
depending on user input.

Previously, the user had to manually link the correct profiling library to
the application's object code. We would like to automatically link the in
the profiling library (stored on disk in LLVM bitcode), through the ld
command, by modifying LTOCodeGenerator.cpp.

We are having troubling sending command-line arguments to the LTO code,
because LTO is called by the system ld. However, we've noticed the
declaration static cl::opt<bool> DisableInline in LTOCodeGenerator.cpp.

How is the DisableInline argument passed to LTO, and how would we be able
to pass similar arguments, declared as cl::opt, to the LTO code?

Thanks for your help,
Melanie and Kui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120222/6402320b/attachment.html>


More information about the llvm-dev mailing list