summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/InternalsManual.html8
-rw-r--r--docs/Makefile4
-rw-r--r--docs/PCHInternals.html30
-rw-r--r--docs/UsersManual.html135
-rw-r--r--docs/tools/Makefile7
5 files changed, 119 insertions, 65 deletions
diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html
index 5ef5dd842a6d..7aa26e00a4f1 100644
--- a/docs/InternalsManual.html
+++ b/docs/InternalsManual.html
@@ -118,8 +118,8 @@ classes somewhere else, or introduce some other solution.</p>
<p>The Clang Diagnostics subsystem is an important part of how the compiler
communicates with the human. Diagnostics are the warnings and errors produced
when the code is incorrect or dubious. In Clang, each diagnostic produced has
-(at the minimum) a unique ID, a <a href="#SourceLocation">SourceLocation</a> to
-"put the caret", an English translation associated with it, and a severity (e.g.
+(at the minimum) a unique ID, an English translation associated with it, a <a
+href="#SourceLocation">SourceLocation</a> to "put the caret", and a severity (e.g.
<tt>WARNING</tt> or <tt>ERROR</tt>). They can also optionally include a number
of arguments to the dianostic (which fill in "%0"'s in the string) as well as a
number of source ranges that related to the diagnostic.</p>
@@ -127,7 +127,7 @@ number of source ranges that related to the diagnostic.</p>
<p>In this section, we'll be giving examples produced by the Clang command line
driver, but diagnostics can be <a href="#DiagnosticClient">rendered in many
different ways</a> depending on how the DiagnosticClient interface is
-implemented. A representative example of a diagonstic is:</p>
+implemented. A representative example of a diagnostic is:</p>
<pre>
t.c:38:15: error: invalid operands to binary expression ('int *' and '_Complex float')
@@ -709,7 +709,7 @@ be the location of the "c" identifier.</li>
<li><b>void* "AnnotationValue"</b> - This contains an opaque object that the
parser gets from Sema through an Actions module, it is passed around and Sema
-intepretes it, based on the type of annotation token.</li>
+interprets it, based on the type of annotation token.</li>
<li><b>TokenKind "Kind"</b> - This indicates the kind of Annotation token this
is. See below for the different valid kinds.</li>
diff --git a/docs/Makefile b/docs/Makefile
index e9bbb28f68c4..053b263d27dc 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -7,7 +7,7 @@
#
##===----------------------------------------------------------------------===##
-LEVEL := ../../..
+CLANG_LEVEL := ..
DIRS := tools
ifdef BUILD_FOR_WEBSITE
@@ -22,7 +22,7 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
-e 's/@abs_top_builddir@/../g' > $@
endif
-include $(LEVEL)/Makefile.common
+include $(CLANG_LEVEL)/Makefile
HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
$(wildcard $(PROJ_SRC_DIR)/*.css)
diff --git a/docs/PCHInternals.html b/docs/PCHInternals.html
index e21ec5e90df3..109d5ed02558 100644
--- a/docs/PCHInternals.html
+++ b/docs/PCHInternals.html
@@ -144,6 +144,15 @@ deserialized from the precompiled header. These statistics can be
useful to determine whether the precompiled header implementation can
be improved by making more of the implementation lazy.</p>
+<p>Precompiled headers can be chained. When you create a PCH while
+including an existing PCH, Clang can create the new PCH by referencing
+the original file and only writing the new data to the new file. For
+example, you could create a PCH out of all the headers that are very
+commonly used throughout your project, and then create a PCH for every
+single source file in the project that includes the code that is
+specific to that file, so that recompiling the file itself is very fast,
+without duplicating the data from the common headers for every file.</p>
+
<h2 id="contents">Precompiled Header Contents</h2>
<img src="PCHLayout.png" align="right" alt="Precompiled header layout">
@@ -209,6 +218,27 @@ contents are verified along with the rest of the metadata.</dd>
</dl>
+<p>A chained PCH file (that is, one that references another PCH) has
+a slightly different metadata block, which contains the following
+information:</p>
+
+<dl>
+ <dt>Referenced file</dt>
+ <dd>The name of the referenced PCH file. It is looked up like a file
+specified using -include-pch.</dd>
+
+ <dt>PCH version</dt>
+ <dd>This is the same as in normal PCH files.</dd>
+
+ <dt>Original file name</dt>
+ <dd>The full path of the header that was used to generate this
+precompiled header.</dd>
+
+</dl>
+
+<p>The language options, target architecture and predefines buffer data
+is taken from the end of the chain, since they have to match anyway.</p>
+
<h3 id="sourcemgr">Source Manager Block</h3>
<p>The source manager block contains the serialized representation of
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index 5c5f6f916cf6..51e699fc32cb 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -36,7 +36,7 @@ td {
<ul>
<li><a href="#diagnostics_display">Controlling How Clang Displays Diagnostics</a></li>
<li><a href="#diagnostics_mappings">Diagnostic Mappings</a></li>
- <li><a href="#diagnostics_categories">Diagnostic Categories</a><li>
+ <li><a href="#diagnostics_categories">Diagnostic Categories</a></li>
<li><a href="#diagnostics_commandline">Controlling Diagnostics via Command Line Flags</a></li>
<li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li>
</ul>
@@ -53,16 +53,6 @@ td {
<li><a href="#c_ms">Microsoft extensions</a></li>
</ul>
</li>
-<li><a href="#objc">Objective-C Language Features</a>
- <ul>
- <li><a href="#objc_incompatibilities">Intentional Incompatibilities with
- GCC</a></li>
- </ul>
-</li>
-<li><a href="#cxx">C++ Language Features</a>
-</li>
-<li><a href="#objcxx">Objective C++ Language Features</a>
-</li>
<li><a href="#target_features">Target-Specific Features and Limitations</a>
<ul>
<li><a href="#target_arch">CPU Architectures Features and Limitations</a>
@@ -261,12 +251,29 @@ when this is enabled, Clang will print something like:</p>
<p>When this is disabled, Clang will just print:</p>
<pre>
- test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+ <b><font color="black">test.c:28:8: <font color="magenta">warning</font>: extra tokens at end of #endif directive [-Wextra-tokens]</font></b>
+ #endif bad
+ <font color="green">^</font>
+ <font color="green">//</font>
</pre>
</dd>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<dt id="opt_fcolor_diagnostics"><b>-f[no-]color-diagnostics</b>: </dt>
+<dd>This option, which defaults to on when a color-capable terminal is
+ detected, controls whether or not Clang prints diagnostics in color.
+ When this option is enabled, Clang will use colors to highlight
+ specific parts of the diagnostic, e.g.,
+
+<pre>
+<test.c:2:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+#endif bad
+ ^
+ //
+</pre>
+</dd>'
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<dt id="opt_fdiagnostics-show-option"><b>-f[no-]diagnostics-show-option</b>:
Enable <tt>[-Woption]</tt> information in diagnostic line.</dt>
<dd>This option, which defaults to on,
@@ -386,6 +393,66 @@ by commenting them out.</p>
and <a href="">-Wbaz</a>.</p>
</dd>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<dt id="opt_Wambiguous-member-template"><b>-Wambiguous-member-template</b>:
+Warn about unqualified uses of a member template whose name resolves
+to another template at the location of the use.</dt>
+<dd>This option, which defaults to on, enables a warning in the
+following code:</p>
+
+<pre>
+template&lt;typename T> struct set{};
+template&lt;typename T> struct trait { typedef const T& type; };
+struct Value {
+ template&lt;typename T> void set(typename trait&lt;T>::type value) {}
+};
+void foo() {
+ Value v;
+ v.set&lt;double>(3.2);
+}
+</pre>
+
+<p>C++ [basic.lookup.classref] requires this to be an error, but,
+because it's hard to work around, Clang downgrades it to a warning as
+an extension.</p>
+</dd>
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<dt id="opt_Wbind-to-temporary-copy"><b>-Wbind-to-temporary-copy</b>: Warn about
+an unusable copy constructor when binding a reference to a temporary.</dt>
+<dd>This option, which defaults to on, enables warnings about binding a
+reference to a temporary when the temporary doesn't have a usable copy
+constructor. For example:</p>
+
+<pre>
+ struct NonCopyable {
+ NonCopyable();
+ private:
+ NonCopyable(const NonCopyable&);
+ };
+ void foo(const NonCopyable&);
+ void bar() {
+ foo(NonCopyable()); // Disallowed in C++98; allowed in C++0x.
+ }
+</pre>
+<pre>
+ struct NonCopyable2 {
+ NonCopyable2();
+ NonCopyable2(NonCopyable2&);
+ };
+ void foo(const NonCopyable2&);
+ void bar() {
+ foo(NonCopyable2()); // Disallowed in C++98; allowed in C++0x.
+ }
+</pre>
+
+<p>Note that if <tt>NonCopyable2::NonCopyable2()</tt> has a default
+argument whose instantiation produces a compile error, that error will
+still be a hard error in C++98 mode even if this warning is turned
+off.</p>
+
+</dd>
+
</dl>
<!-- ======================================================================= -->
@@ -717,11 +784,6 @@ extensions are not implemented yet:</p>
a relatively small feature, so it is likely to be implemented relatively
soon.</li>
-<li>clang does not support attributes on function pointers
-(<a href="http://llvm.org/bugs/show_bug.cgi?id=2461">bug 2461</a>). This is
-a relatively important feature, so it is likely to be implemented relatively
-soon.</li>
-
<li>clang does not support #pragma weak
(<a href="http://llvm.org/bugs/show_bug.cgi?id=3679">bug 3679</a>). Due to
the uses described in the bug, this is likely to be implemented at some
@@ -825,45 +887,6 @@ however where MSVC and GCC are incompatible clang follows the MSVC
definition.</li>
<!-- ======================================================================= -->
-<h2 id="objc">Objective-C Language Features</h2>
-<!-- ======================================================================= -->
-
-
-<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
-<h3 id="objc_incompatibilities">Intentional Incompatibilities with GCC</h3>
-<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
-
-<p>No cast of super, no lvalue casts.</p>
-
-
-
-<!-- ======================================================================= -->
-<h2 id="cxx">C++ Language Features</h2>
-<!-- ======================================================================= -->
-
-<p>At this point, Clang C++ is not production-quality and is not recommended for use beyond experimentation. However, Clang C++ support
-is under active development and is progressing rapidly. Please see the <a
-href="http://clang.llvm.org/cxx_status.html">C++ Status</a> page for details or
-ask on the mailing list about how you can help.</p>
-
-<p>Note that released Clang compilers will refuse to even try to use clang to compile C++ code unless you pass the <tt>-ccc-clang-cxx</tt> option to the driver. To turn on Clang's C++ support, please pass that flag. Clang compilers built from the Subversion trunk enable C++ support by default, and do not require the <tt>-ccc-clang-cxx</tt> flag.</p>
-
-<p>Clang strives to strictly conform to the C++ standard. That means
-it will reject invalid C++ code that another compiler may accept. If
-Clang reports errors in your code, please check
-the <a href="http://clang.llvm.org/cxx_compatibility.html">C++
-Compatibility</a> page to see whether they are C++-conformance bugs
-and how you can fix them.</p>
-
-<!-- ======================================================================= -->
-<h2 id="objcxx">Objective C++ Language Features</h2>
-<!-- ======================================================================= -->
-
-<p>At this point, Clang C++ support is not generally useful (and therefore,
-neither is Objective-C++). Please see the <a href="#cxx">C++ section</a> for
-more information.</p>
-
-<!-- ======================================================================= -->
<h2 id="target_features">Target-Specific Features and Limitations</h2>
<!-- ======================================================================= -->
diff --git a/docs/tools/Makefile b/docs/tools/Makefile
index 91bc447c083f..5521d6b764c9 100644
--- a/docs/tools/Makefile
+++ b/docs/tools/Makefile
@@ -37,10 +37,11 @@ clean:
else
# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
-LEVEL := ../../../..
-include $(LEVEL)/Makefile.common
+CLANG_LEVEL := ../..
+include $(CLANG_LEVEL)/Makefile
-CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
+CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
+ $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
SRC_DOC_DIR=$(PROJ_SRC_DIR)/
DST_HTML_DIR=$(PROJ_OBJ_DIR)/