<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr"><span style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt">Where is the source code that is called when the clang binary executable calls the command/job which compiles C code to IR?</span><br></div><div dir="ltr"><div id="m_-2924332261686654311divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr"><div>
<br>
I am using Clang as a library (basically a simplified version of the main function in /tools/clang/tools/driver/driver.cpp). </div><div dir="auto"><br></div><div dir="auto">My program creates an instance of clang::driver::Driver. I pass arguments to TheDriver.BuildCompilation(args)). And then call ExecuteCompilation.
 Everything works.<br>
<br>
When I call TheDriver.PrintActions(*C) the output is<br>
<br>
0: input, "testcode.cpp", c++<br>
1: preprocessor, {0}, c++-cpp-output<br>
2: compiler, {1}, ir<br>
3: backend, {2}, assembler<br>
4: assembler, {3}, object<br>
5: linker, {4}, image<br>
<br>
And when I loop over the jobs inside the Compilation object I see that the clang binary executable is called 4 times (using execve) and finally ld.lld is called.<br>
<br>
I'm interested in the call to clang for "2: compiler, {1}, ir". </div><div dir="auto"><br></div><div dir="auto"><span style="font-size:12pt">Is /tools/clang/tools/driver/</span><span style="font-size:12pt">driver.cpp called again? It seems that the main function in driver.cpp eventually calls itself again. If not what is called, and where is
 the source code?</span><br></div></div></div>

</div></div>