summaryrefslogtreecommitdiffstats
path: root/docs/UsersManual.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/UsersManual.html')
-rw-r--r--docs/UsersManual.html104
1 files changed, 84 insertions, 20 deletions
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index 82c4fa2..73ca6c6 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -32,7 +32,7 @@ td {
</li>
<li><a href="#general_features">Language and Target-Independent Features</a>
<ul>
- <li><a href="#diagnostics">Controlling Errors and Warnings</a></li>
+ <li><a href="#diagnostics">Controlling Errors and Warnings</a>
<ul>
<li><a href="#diagnostics_display">Controlling How Clang Displays Diagnostics</a></li>
<li><a href="#diagnostics_mappings">Diagnostic Mappings</a></li>
@@ -41,9 +41,10 @@ td {
<li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li>
<li><a href="#analyzer_diagnositics">Controlling Static Analyzer Diagnostics</a></li>
</ul>
+ </li>
<li><a href="#precompiledheaders">Precompiled Headers</a></li>
<li><a href="#codegen">Controlling Code Generation</a></li>
- </ul>
+ </ul>
</li>
<li><a href="#c">C Language Features</a>
<ul>
@@ -67,8 +68,8 @@ td {
<ul>
<li><a href="#target_os_darwin">Darwin (Mac OS/X)</a></li>
<li>Linux, etc.</li>
+ <li><a href="#target_os_win32">Windows</a></li>
</ul>
-
</li>
</ul>
</li>
@@ -205,7 +206,7 @@ diagnostics that it generates.</p>
diagnostic.</dt>
<dd>This option, which defaults to on, controls whether or not Clang prints the
column number of a diagnostic. For example, when this is enabled, Clang will
-print something like:</p>
+print something like:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -223,7 +224,7 @@ column number.</p>
source file/line/column information in diagnostic.</dt>
<dd>This option, which defaults to on, controls whether or not Clang prints the
filename, line number and column number of a diagnostic. For example,
-when this is enabled, Clang will print something like:</p>
+when this is enabled, Clang will print something like:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -240,7 +241,7 @@ when this is enabled, Clang will print something like:</p>
line and ranges from source code in diagnostic.</dt>
<dd>This option, which defaults to on, controls whether or not Clang prints the
source line, source ranges, and caret when emitting a diagnostic. For example,
-when this is enabled, Clang will print something like:</p>
+when this is enabled, Clang will print something like:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -277,7 +278,7 @@ Enable <tt>[-Woption]</tt> information in diagnostic line.</dt>
<dd>This option, which defaults to on,
controls whether or not Clang prints the associated <A
href="#cl_diag_warning_groups">warning group</a> option name when outputting
-a warning diagnostic. For example, in this output:</p>
+a warning diagnostic. For example, in this output:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -299,7 +300,7 @@ Enable printing category information in diagnostic line.</dt>
controls whether or not Clang prints the category associated with a diagnostic
when emitting it. Each diagnostic may or many not have an associated category,
if it has one, it is listed in the diagnostic categorization field of the
-diagnostic line (in the []'s).</p>
+diagnostic line (in the []'s).
<p>For example, a format string warning will produce these three renditions
based on the setting of this option:</p>
@@ -322,7 +323,7 @@ hundreds or thousands of them.</p>
Enable "FixIt" information in the diagnostics output.</dt>
<dd>This option, which defaults to on, controls whether or not Clang prints the
information on how to fix a specific diagnostic underneath it when it knows.
-For example, in this output:</p>
+For example, in this output:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -345,7 +346,7 @@ Print machine parsable information about source ranges.</dt>
information about source ranges in a machine parsable format after the
file/line/column number information. The information is a simple sequence of
brace enclosed ranges, where each range lists the start and end line/column
-locations. For example, in this output:</p>
+locations. For example, in this output:
<pre>
exprs.c:47:15:{47:8-47:14}{47:17-47:24}: error: invalid operands to binary expression ('int *' and '_Complex float')
@@ -366,7 +367,14 @@ Print Fix-Its in a machine parseable form.</dt>
fix-it:"t.cpp":{7:25-7:29}:"Gamma"
</pre>
-<p>The range printed is a half-open range, so in this example the characters at column 25 up to but not including column 29 on line 7 in t.cpp should be replaced with the string "Gamma". Either the range or the replacement string may be empty (representing strict insertions and strict erasures, respectively). Both the file name and the insertion string escape backslash (as "\\"), tabs (as "\t"), newlines (as "\n"), double quotes(as "\"") and non-printable characters (as octal "\xxx").</p>
+<p>The range printed is a half-open range, so in this example the characters at
+column 25 up to but not including column 29 on line 7 in t.cpp should be
+replaced with the string &quot;Gamma&quot;. Either the range or the replacement
+string may be empty (representing strict insertions and strict erasures,
+respectively). Both the file name and the insertion string escape backslash (as
+&quot;\\&quot;), tabs (as &quot;\t&quot;), newlines (as &quot;\n&quot;), double
+quotes(as &quot;\&quot;&quot;) and non-printable characters (as octal
+&quot;\xxx&quot;).</p>
</dd>
</dl>
@@ -388,7 +396,7 @@ Print Fix-Its in a machine parseable form.</dt>
<dt id="opt_Wextra-tokens"><b>-Wextra-tokens</b>: Warn about excess tokens at
the end of a preprocessor directive.</dt>
<dd>This option, which defaults to on, enables warnings about extra tokens at
-the end of preprocessor directives. For example:</p>
+the end of preprocessor directives. For example:
<pre>
test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
@@ -408,7 +416,7 @@ by commenting them out.</p>
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>
+following code:
<pre>
template&lt;typename T> struct set{};
@@ -432,7 +440,7 @@ an extension.</p>
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>
+constructor. For example:
<pre>
struct NonCopyable {
@@ -484,7 +492,6 @@ and gives you fine-grain control over which information is printed. Clang has
the ability to print this information, and these are the options that control
it:</p>
-<p>
<ol>
<li>A file/line/column indicator that shows exactly where the diagnostic occurs
in your code [<a href="#opt_fshow-column">-fshow-column</a>, <a
@@ -508,7 +515,7 @@ it:</p>
<li>A machine-parsable representation of the ranges involved (off by
default) [<a
href="opt_fdiagnostics-print-source-range-info">-fdiagnostics-print-source-range-info</a>].</li>
-</ol></p>
+</ol>
<p>For more information please see <a href="#cl_diag_formatting">Formatting of
Diagnostics</a>.</p>
@@ -518,14 +525,13 @@ Diagnostics</a>.</p>
<p>All diagnostics are mapped into one of these 5 classes:</p>
-<p>
<ul>
<li>Ignored</li>
<li>Note</li>
<li>Warning</li>
<li>Error</li>
<li>Fatal</li>
-</ul></p>
+</ul>
<h4 id="diagnostics_categories">Diagnostic Categories</h4>
@@ -735,6 +741,7 @@ likely to affect PCH files that reference a large number of headers.</p>
<p>Clang provides a number of ways to control code generation. The options are listed below.</p>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<dl>
<dt id="opt_fcatch-undefined-behavior"><b>-fcatch-undefined-behavior</b>: Turn
on runtime code generation to check for undefined behavior.</dt>
@@ -742,7 +749,7 @@ on runtime code generation to check for undefined behavior.</dt>
adds runtime checks for undefined runtime behavior. If a check fails,
<tt>__builtin_trap()</tt> is used to indicate failure.
The checks are:
-<p>
+<ul>
<li>Subscripting where the static type of one operand is a variable
which is decayed from an array type and the other operand is
greater than the size of the array or less than zero.</li>
@@ -752,7 +759,7 @@ The checks are:
<li>When llvm implements more __builtin_object_size support, reads and
writes for objects that __builtin_object_size indicates we aren't
accessing valid memory. Bit-fields and vectors are not yet checked.
-</p>
+</ul>
</dd>
<dt id="opt_fno-assume-sane-operator-new"><b>-fno-assume-sane-operator-new</b>:
@@ -761,6 +768,19 @@ Don't assume that the C++'s new operator is sane.</dt>
operator will always return a pointer that does not
alias any other pointer when the function returns.</dd>
+<dt id="opt_ftrap-function"><b>-ftrap-function=[name]</b>: Instruct code
+generator to emit a function call to the specified function name for
+<tt>__builtin_trap()</tt>.</dt>
+
+<dd>LLVM code generator translates <tt>__builtin_trap()</tt> to a trap
+instruction if it is supported by the target ISA. Otherwise, the builtin is
+translated into a call to <tt>abort</tt>. If this option is set, then the code
+generator will always lower the builtin to a call to the specified function
+regardless of whether the target ISA has a trap instruction. This option is
+useful for environments (e.g. deeply embedded) where a trap cannot be properly
+handled, or when some custom behavior is desired.</dd>
+</dl>
+
<!-- ======================================================================= -->
<h2 id="c">C Language Features</h2>
<!-- ======================================================================= -->
@@ -917,6 +937,7 @@ support is incomplete; enabling Microsoft extensions will silently drop
certain constructs (including __declspec and Microsoft-style asm statements).
</p>
+<ul>
<li>clang allows setting _MSC_VER with -fmsc-version=. It defaults to 1300 which
is the same as Visual C/C++ 2003. Any number is supported and can greatly affect
what Windows SDK and c++stdlib headers clang can compile. This option will be
@@ -930,6 +951,7 @@ record members can be declared using user defined typedefs.</li>
controlling record layout. GCC also contains support for this feature,
however where MSVC and GCC are incompatible clang follows the MSVC
definition.</li>
+</ul>
<!-- ======================================================================= -->
<h2 id="target_features">Target-Specific Features and Limitations</h2>
@@ -948,6 +970,10 @@ definition.</li>
(Mac OS/X), Linux, FreeBSD, and Dragonfly BSD: it has been tested to correctly
compile many large C, C++, Objective-C, and Objective-C++ codebases.</p>
+<p>On x86_64-mingw32, passing i128(by value) is incompatible to Microsoft x64
+calling conversion. You might need to tweak WinX86_64ABIInfo::classify()
+in lib/CodeGen/TargetInfo.cpp.</p>
+
<!-- ======================== -->
<h4 id="target_arch_arm">ARM</h4>
<!-- ======================== -->
@@ -985,6 +1011,44 @@ Generating assembly requires a suitable LLVM backend.
<p>No __thread support, 64-bit ObjC support requires SL tools.</p>
+<!-- ======================================= -->
+<h4 id="target_os_win32">Windows</h4>
+<!-- ======================================= -->
+
+<p>Experimental supports are on Cygming.</p>
+
+<h5>Cygwin</h5>
+
+<p>Clang works on Cygwin-1.7.</p>
+
+<h5>MinGW32</h5>
+
+<p>Clang works on some mingw32 distributions.
+Clang assumes directories as below;</p>
+
+<ul>
+<li><tt>C:/mingw/include</tt></li>
+<li><tt>C:/mingw/lib</tt></li>
+<li><tt>C:/mingw/lib/gcc/mingw32/4.[3-5].0/include/c++</tt></li>
+</ul>
+
+<p>On MSYS, a few tests might fail. It is due to <a href="http://llvm.org/bugs/show_bug.cgi?id=8520">Bug 8520</a> and is fixed in <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110314/118106.html">LLVM's r127724</a>.</p>
+
+<h5>MinGW-w64</h5>
+
+<p>For x32(i686-w64-mingw32), it is not supported yet.</p>
+
+<p>For x64(x86_64-w64-mingw32), <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110321/118499.html">an essential patch(LLVM's r128206)</a> would be needed. It is incompatible to <a href="http://tdm-gcc.tdragon.net/development">TDM-GCC</a> due to the definition of symbol &quot;<code>___chkstk</code>&quot;. Clang assumes as below;<p>
+
+<ul>
+<li><tt>C:/mingw/x86_64-w64-mingw32/include</tt></li>
+<li><tt>C:/mingw/x86_64-w64-mingw32/include/c++/4.5.[23]</tt></li>
+<li>GCC driver &quot;gcc.exe&quot; to build x86_64-w64-mingw32 binary.</li>
+</ul>
+
+<p><a href="http://llvm.org/bugs/show_bug.cgi?id=8833">Some tests might fail</a>
+on x64.</p>
+
</div>
</body>
</html>
OpenPOWER on IntegriCloud