<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>This is good to have. I think we should explain the word "frontend" as well; a <i>user</i> of clang who doesn't know how it interacts with LLVM wouldn't understand that term.</div><div><br></div><div>(Actually, given that all of LLVM is statically linked into the clang binary, clang -cc1 is <i>not</i> just an LLVM frontend from the user perspective...)</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On Jan 6, 2013, at 5:38 , Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: gribozavr<br>Date: Sun Jan 6 07:38:34 2013<br>New Revision: 171656<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=171656&view=rev">http://llvm.org/viewvc/llvm-project?rev=171656&view=rev</a><br>Log:<br>Clang docs: add some information about the difference between 'clang' and 'clang -cc1'<br><br>This is coming up again and again on the mailing list and IRC.<br><br>Added:<br> cfe/trunk/docs/FAQ.rst<br>Modified:<br> cfe/trunk/docs/index.rst<br><br>Added: cfe/trunk/docs/FAQ.rst<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/FAQ.rst?rev=171656&view=auto">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/FAQ.rst?rev=171656&view=auto</a><br>==============================================================================<br>--- cfe/trunk/docs/FAQ.rst (added)<br>+++ cfe/trunk/docs/FAQ.rst Sun Jan 6 07:38:34 2013<br>@@ -0,0 +1,52 @@<br>+================================<br>+Frequently Asked Questions (FAQ)<br>+================================<br>+<br>+.. contents::<br>+ :local:<br>+<br>+Driver<br>+======<br>+<br>+I run ``clang -cc1 ...`` and get weird errors about missing headers<br>+-------------------------------------------------------------------<br>+<br>+Given this source file:<br>+<br>+.. code-block:: c<br>+<br>+ #include <stdio.h><br>+<br>+ int main() {<br>+ printf("Hello world\n");<br>+ }<br>+<br>+<br>+If you run:<br>+<br>+.. code-block:: console<br>+<br>+ $ clang -cc1 hello.c<br>+ hello.c:1:10: fatal error: 'stdio.h' file not found<br>+ #include <stdio.h><br>+ ^<br>+ 1 error generated.<br>+<br>+``clang -cc1`` is the frontend, ``clang`` is the :doc:`driver<br>+<DriverInternals>`. The driver invokes the frontend with options appropriate<br>+for your system. To see these options, run:<br>+<br>+.. code-block:: console<br>+<br>+ $ clang -### -c hello.c<br>+<br>+Some clang command line options are driver-only options, some are frontend-only<br>+options. Frontend-only options are intended to be used only by developers.<br>+Users should not run ``clang -cc1`` directly.<br>+<br>+If you want to use a frontend-only option ("a ``-cc1`` option"), for example<br>+``-ast-dump``, then you need to take the ``clang -cc1`` line generated by the<br>+driver and add the option you need. Alternatively, you can run<br>+``clang -Xclang <option> ...`` to force the driver pass ``<option>`` to<br>+``clang -cc1``.<br>+<br><br>Modified: cfe/trunk/docs/index.rst<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/index.rst?rev=171656&r1=171655&r2=171656&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/index.rst?rev=171656&r1=171655&r2=171656&view=diff</a><br>==============================================================================<br>--- cfe/trunk/docs/index.rst (original)<br>+++ cfe/trunk/docs/index.rst Sun Jan 6 07:38:34 2013<br>@@ -21,6 +21,7 @@<br> AddressSanitizer<br> ThreadSanitizer<br> MemorySanitizer<br>+ FAQ<br><br> Using Clang as a Library<br> ========================<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></body></html>