[llvm-dev] [cfe-dev] Question about passing -v -save-temps cmd args to clang++

Mahesha S via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 1 00:48:33 PST 2019


Hello Anton Korobeynikov,

Thanks for the clarification. I can see three invocations of the compiler
proper (-cc1) in the above-expanded command line. The first one takes .cc
to .ii (preprocessing as usual), the second one takes .ii to .bc, and the
third one takes .bc to .s. I assume that OPT APIs are invoked in the second
phase and the LLC APIs are invoked in the third phase. Am I right?

Next, I would like to play around with LLC directly by passing some input
.bc file. More specifically I would like to debug LLC using GDB by passing
an input .bc file. I did some googling and explored LLVM docs about it.
But, I could find nothing helpful. I have an understanding of different
phases that an LLVM IR goes through before actually getting converted to
target instruction. But, I would like to debug LLC to get a practical hold
of it. Could you please help me in this regard? Any links to appropriate
documentation also are also fine.

Thanks,
Mahesha

On Fri, Mar 1, 2019 at 1:55 PM Anton Korobeynikov <anton at korobeynikov.info>
wrote:

> Hello
>
> > Question: When I pass `-v save-temps` options to clang++, I was
> expecting to see the command line for both `opt` and `llc` in the expanded
> command line output, but, I don't see it. What am I missing?
> Nothing. Neither opt nor llc are executed by clang. Both of them are
> developer-side tools and not intended for "end-user consumption".
> clang calls LLVM API directly both for optimization and
> codegeneration.
>
> --
> With best regards, Anton Korobeynikov
> Department of Statistical Modelling, Saint Petersburg State University
>


-- 
Thanks,
Mahesha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190301/ba68823b/attachment.html>


More information about the llvm-dev mailing list