aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
commitdbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch)
treebe1815eb79b42ff482a8562b13c2dcbf0c5dcbee /www
parent9da628931ebf2609493570f87824ca22402cc65f (diff)
downloadsrc-dbe13110f59f48b4dbb7552b3ac2935acdeece7f.tar.gz
src-dbe13110f59f48b4dbb7552b3ac2935acdeece7f.zip
Vendor import of clang trunk r154661:vendor/clang/clang-trunk-r154661
Notes
Notes: svn path=/vendor/clang/dist/; revision=234287 svn path=/vendor/clang/clang-trunk-r154661/; revision=234288; tag=vendor/clang/clang-trunk-r154661
Diffstat (limited to 'www')
-rw-r--r--www/OpenProjects.html6
-rw-r--r--www/UniversalDriver.html6
-rw-r--r--www/analyzer/annotations.html19
-rw-r--r--www/analyzer/available_checks.html122
-rw-r--r--www/analyzer/checker_dev_manual.html346
-rw-r--r--www/analyzer/dev_cxx.html10
-rw-r--r--www/analyzer/filing_bugs.html4
-rw-r--r--www/analyzer/index.html75
-rw-r--r--www/analyzer/installation.html4
-rw-r--r--www/analyzer/latest_checker.html.incl2
-rw-r--r--www/analyzer/menu.html.incl1
-rw-r--r--www/analyzer/release_notes.html88
-rw-r--r--www/analyzer/scan-build.html60
-rw-r--r--www/analyzer/xcode.html11
-rw-r--r--www/clang_video-05-25-2007.html6
-rw-r--r--www/clang_video-07-25-2007.html6
-rw-r--r--www/comparison.html7
-rw-r--r--www/compatibility.html33
-rw-r--r--www/cxx_compatibility.html6
-rw-r--r--www/cxx_status.html187
-rw-r--r--www/diagnostics.html152
-rw-r--r--www/features.html25
-rw-r--r--www/get_involved.html12
-rw-r--r--www/get_started.html65
-rw-r--r--www/hacking.html82
-rw-r--r--www/index.html2
-rw-r--r--www/performance-2008-10-31.html20
-rw-r--r--www/performance-2009-03-02.html16
-rw-r--r--www/performance.html16
-rw-r--r--www/related.html6
30 files changed, 979 insertions, 416 deletions
diff --git a/www/OpenProjects.html b/www/OpenProjects.html
index fec23dc14aaa..b2d4dae6c3e0 100644
--- a/www/OpenProjects.html
+++ b/www/OpenProjects.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Get Involved</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
diff --git a/www/UniversalDriver.html b/www/UniversalDriver.html
index 82ccc8ded776..2d41a624e14f 100644
--- a/www/UniversalDriver.html
+++ b/www/UniversalDriver.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Universal Driver</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
diff --git a/www/analyzer/annotations.html b/www/analyzer/annotations.html
index b33b4bfcdde9..9e3583de3cad 100644
--- a/www/analyzer/annotations.html
+++ b/www/analyzer/annotations.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Source Annotations</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
@@ -106,7 +106,7 @@ int foo(int *p, int *q) {
<p>Running <tt>scan-build</tt> over this source produces the following
output:</p>
-<img src="images/example_attribute_nonnull.png">
+<img src="images/example_attribute_nonnull.png" alt="example attribute nonnull">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<h2 id="macosx">Mac OS X API Annotations</h2>
@@ -139,7 +139,7 @@ object that the caller is responsible for releasing (via sending a
<p><b>Placing on Objective-C methods</b>: For Objective-C methods, this
annotation essentially tells the analyzer to treat the method as if its name
-begins with &quot;alloc&quot; or &quot;new&quot; or contais the word
+begins with &quot;alloc&quot; or &quot;new&quot; or contains the word
&quot;copy&quot;.</p>
<p><b>Placing on C functions</b>: For C functions returning Cocoa objects, the
@@ -192,7 +192,7 @@ use 'cf_returns_retained'.</p>
<p>Running <tt>scan-build</tt> on this source file produces the following output:</p>
-<img src="images/example_ns_returns_retained.png">
+<img src="images/example_ns_returns_retained.png" alt="example returns retained">
<h4 id="attr_ns_returns_not_retained">Attribute 'ns_returns_not_retained'
(Clang-specific)</h4>
@@ -242,7 +242,7 @@ Cocoa object. This distinction is important for two reasons:</p>
<li>Because Core Foundation is a C API, the analyzer cannot always tell that a
pointer return value refers to a Core Foundation object. In contrast, it is
trivial for the analyzer to recognize if a pointer refers to a Cocoa object
- (given the Objective-C type system).</p>
+ (given the Objective-C type system).
</ul>
<p><b>Placing on C functions</b>: When placing the attribute
@@ -311,16 +311,16 @@ CFDateRef returnsRetainedCFDate() {
<p>Running <tt>scan-build</tt> on this example produces the following output:</p>
-<img src="images/example_cf_returns_retained.png">
+<img src="images/example_cf_returns_retained.png" alt="example returns retained">
-</p>When the above code is compiled using Objective-C garbage collection (i.e.,
+<p>When the above code is compiled using Objective-C garbage collection (i.e.,
code is compiled with the flag <tt>-fobjc-gc</tt> or <tt>-fobjc-gc-only</tt>),
<tt>scan-build</tt> produces both the above error (with slightly different text
to indicate the code uses garbage collection) as well as the following warning,
which indicates a leak that occurs <em>only</em> when using garbage
collection:</p>
-<img src="images/example_cf_returns_retained_gc.png">
+<img src="images/example_cf_returns_retained_gc.png" alt="example returns retained gc">
<h4 id="attr_cf_returns_not_retained">Attribute 'cf_returns_not_retained'
(Clang-specific)</h4>
@@ -590,6 +590,7 @@ the use of preprocessor macros.</p>
#else
#define CLANG_ANALYZER_NORETURN
#endif
+#endif
void my_assert_rtn(const char *, const char *, int, const char *) <span class="code_highlight">CLANG_ANALYZER_NORETURN</span>;
</pre>
diff --git a/www/analyzer/available_checks.html b/www/analyzer/available_checks.html
index 7af086506506..3f40d323f036 100644
--- a/www/analyzer/available_checks.html
+++ b/www/analyzer/available_checks.html
@@ -3,9 +3,12 @@
<html>
<head>
<title>Available Checks</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
+ <style type="text/css">
+ tr:first-child { width:20%; }
+ </style>
</head>
<body>
@@ -16,10 +19,117 @@
<h1>Available Checks</h1>
-<p>This page is slated to contain a list of the current checks the analyzer
-performs along with some self-contained code examples. In the meantime, please
-check out any of the following writeups about the analyzer that contain examples
-of some of the bugs that it finds:</p>
+<h3>The list of the checks the analyzer performs by default</h3>
+<p>
+<table border="0" cellpadding="3" cellspacing="3" width="100%">
+<!-- <tr>
+<th><h4>Checker Name</h4></th>
+<th><h4>Description</h4></th>
+</tr>-->
+<tr>
+<td><b>core.AdjustedReturnValue</b></td><td>Check to see if the return value of a function call is different than the caller expects (e.g., from calls through function pointers).</td>
+</tr>
+<tr>
+<td><b>core.AttributeNonNull</b></td><td>Check for null pointers passed as arguments to a function whose arguments are marked with the 'nonnull' attribute.</td>
+</tr>
+<tr>
+<td><b>core.CallAndMessage</b></td><td>Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers).</td>
+</tr>
+<tr>
+<td><b>core.DivideZero</b></td><td>Check for division by zero.</td>
+</tr>
+<tr>
+<td><b>core.NullDereference</b></td><td>Check for dereferences of null pointers.</td>
+</tr>
+<tr>
+<td><b>core.StackAddressEscape</b></td><td>Check that addresses to stack memory do not escape the function.</td>
+</tr>
+<tr>
+<td><b>core.UndefinedBinaryOperatorResult</b></td><td>Check for undefined results of binary operators.</td>
+</tr>
+<tr>
+<td><b>core.VLASize</b></td><td>Check for declarations of VLA of undefined or zero size.</td>
+</tr>
+<tr>
+<td><b>core.builtin.BuiltinFunctions</b></td><td>Evaluate compiler builtin functions (e.g., alloca()).</td>
+</tr>
+<tr>
+<td><b>core.builtin.NoReturnFunctions</b></td><td>Evaluate "panic" functions that are known to not return to the caller.</td>
+</tr>
+<tr>
+<td><b>core.uninitialized.ArraySubscript</b></td><td>Check for uninitialized values used as array subscripts.</td>
+</tr>
+<tr>
+<td><b>core.uninitialized.Assign</b></td><td>Check for assigning uninitialized values.</td>
+</tr>
+<tr>
+<td><b>core.uninitialized.Branch</b></td><td>Check for uninitialized values used as branch conditions.</td>
+</tr>
+<tr>
+<td><b>core.uninitialized.CapturedBlockVariable</b></td><td>Check for blocks that capture uninitialized values.</td>
+</tr>
+<tr>
+<td><b>core.uninitialized.UndefReturn</b></td><td>Check for uninitialized values being returned to the caller.</td>
+</tr>
+<tr>
+<td><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td>
+</tr>
+<tr>
+<td><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td>
+</tr>
+<tr>
+<td><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td>
+</tr>
+<tr>
+<td><b>osx.AtomicCAS</b></td><td>Evaluate calls to OSAtomic functions.</td>
+</tr>
+<tr>
+<td><b>osx.SecKeychainAPI</b></td><td>Check for proper uses of Secure Keychain APIs.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.AtSync</b></td><td>Check for null pointers used as mutexes for @synchronized.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.ClassRelease</b></td><td>Check for sending 'retain', 'release', or 'autorelease' directly to a Class.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.IncompatibleMethodTypes</b></td><td>Warn about Objective-C method signatures with type incompatibilities.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.NSAutoreleasePool</b></td><td>Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.NSError</b></td><td>Check usage of NSError** parameters.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.NilArg</b></td><td>Check for prohibited nil arguments to ObjC method calls.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td>
+</tr>
+<tr>
+<td><b>osx.cocoa.VariadicMethodTypes</b></td><td>Check for passing non-Objective-C types to variadic methods that expect only Objective-C types.</td>
+</tr>
+<tr>
+<td><b>osx.coreFoundation.CFError</b></td><td>Check usage of CFErrorRef* parameters.</td>
+</tr>
+<tr>
+<td><b>osx.coreFoundation.CFNumber</b></td><td>Check for proper uses of CFNumberCreate.</td>
+</tr>
+<tr>
+<td><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td>
+</tr>
+<tr>
+<td><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td>
+</tr>
+</table>
+
+<p>In addition to these the analyzer contains numerous experimental (beta) checkers.</p>
+
+<h3>Writeups with examples of some of the bugs that the analyzer finds</h3>
<ul>
<li><a href="http://www.mobileorchard.com/bug-finding-with-clang-5-resources-to-get-you-started/">Bug Finding With Clang: 5 Resources To Get You Started</a></li>
diff --git a/www/analyzer/checker_dev_manual.html b/www/analyzer/checker_dev_manual.html
new file mode 100644
index 000000000000..fc9adf371ef0
--- /dev/null
+++ b/www/analyzer/checker_dev_manual.html
@@ -0,0 +1,346 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Checker Developer Manual</title>
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
+ <script type="text/javascript" src="scripts/menu.js"></script>
+</head>
+<body>
+
+<div id="page">
+<!--#include virtual="menu.html.incl"-->
+
+<div id="content">
+
+<h1 style="color:red">This Page Is Under Construction</h1>
+
+<h1>Checker Developer Manual</h1>
+
+<p>The static analyzer engine performs symbolic execution of the program and
+relies on a set of checkers to implement the logic for detecting and
+constructing bug reports. This page provides hints and guidelines for anyone
+who is interested in implementing their own checker. The static analyzer is a
+part of the Clang project, so consult <a href="http://clang.llvm.org/hacking.html">Hacking on Clang</a>
+and <a href="http://llvm.org/docs/ProgrammersManual.html">LLVM Programmer's Manual</a>
+for general developer guidelines and information. </p>
+
+ <ul>
+ <li><a href="#start">Getting Started</a></li>
+ <li><a href="#analyzer">Analyzer Overview</a></li>
+ <li><a href="#idea">Idea for a Checker</a></li>
+ <li><a href="#registration">Checker Registration</a></li>
+ <li><a href="#skeleton">Checker Skeleton</a></li>
+ <li><a href="#node">Exploded Node</a></li>
+ <li><a href="#bugs">Bug Reports</a></li>
+ <li><a href="#ast">AST Visitors</a></li>
+ <li><a href="#testing">Testing</a></li>
+ <li><a href="#commands">Useful Commands</a></li>
+ </ul>
+
+<h2 id=start>Getting Started</h2>
+ <ul>
+ <li>To check out the source code and build the project, follow steps 1-4 of
+ the <a href="http://clang.llvm.org/get_started.html">Clang Getting Started</a>
+ page.</li>
+
+ <li>The analyzer source code is located under the Clang source tree:
+ <br><tt>
+ $ <b>cd llvm/tools/clang</b>
+ </tt>
+ <br>See: <tt>include/clang/StaticAnalyzer</tt>, <tt>lib/StaticAnalyzer</tt>,
+ <tt>test/Analysis</tt>.</li>
+
+ <li>The analyzer regression tests can be executed from the Clang's build
+ directory:
+ <br><tt>
+ $ <b>cd ../../../; cd build/tools/clang; TESTDIRS=Analysis make test</b>
+ </tt></li>
+
+ <li>Analyze a file with the specified checker:
+ <br><tt>
+ $ <b>clang -cc1 -analyze -analyzer-checker=core.DivideZero test.c</b>
+ </tt></li>
+
+ <li>List the available checkers:
+ <br><tt>
+ $ <b>clang -cc1 -analyzer-checker-help</b>
+ </tt></li>
+
+ <li>See the analyzer help for different output formats, fine tuning, and
+ debug options:
+ <br><tt>
+ $ <b>clang -cc1 -help | grep "analyzer"</b>
+ </tt></li>
+
+ </ul>
+
+<h2 id=analyzer>Static Analyzer Overview</h2>
+ The analyzer core performs symbolic execution of the given program. All the
+ input values are represented with symbolic values; further, the engine deduces
+ the values of all the expressions in the program based on the input symbols
+ and the path. The execution is path sensitive and every possible path through
+ the program is explored. The explored execution traces are represented with
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedGraph.html">ExplidedGraph</a> object.
+ Each node of the graph is
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedNode.html">ExplodedNode</a>,
+ which consists of a <tt>ProgramPoint</tt> and a <tt>ProgramState</tt>.
+ <p>
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ProgramPoint.html">ProgramPoint</a>
+ represents the corresponding location in the program (or the CFG graph).
+ <tt>ProgramPoint</tt> is also used to record additional information on
+ when/how the state was added. For example, <tt>PostPurgeDeadSymbolsKind</tt>
+ kind means that the state is the result of purging dead symbols - the
+ analyzer's equivalent of garbage collection.
+ <p>
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ProgramState.html">ProgramState</a>
+ represents abstract state of the program. It consists of:
+ <ul>
+ <li><tt>Environment</tt> - a mapping from source code expressions to symbolic
+ values
+ <li><tt>Store</tt> - a mapping from memory locations to symbolic values
+ <li><tt>GenericDataMap</tt> - constraints on symbolic values
+ </ul>
+
+ <h3>Interaction with Checkers</h3>
+ Checkers are not merely passive receivers of the analyzer core changes - they
+ actively participate in the <tt>ProgramState</tt> construction through the
+ <tt>GenericDataMap</tt> which can be used to store the checker-defined part
+ of the state. Each time the analyzer engine explores a new statement, it
+ notifies each checker registered to listen for that statement, giving it an
+ opportunity to either report a bug or modify the state. (As a rule of thumb,
+ the checker itself should be stateless.) The checkers are called one after another
+ in the predefined order; thus, calling all the checkers adds a chain to the
+ <tt>ExplodedGraph</tt>.
+
+ <h3>Representing Values</h3>
+ During symbolic execution, <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SVal.html">SVal</a>
+ objects are used to represent the semantic evaluation of expressions. They can
+ represent things like concrete integers, symbolic values, or memory locations
+ (which are memory regions). They are a discriminated union of "values",
+ symbolic and otherwise.
+ <p>
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymExpr.html">SymExpr</a> (symbol)
+ is meant to represent abstract, but named, symbolic value.
+ Symbolic values can have constraints associated with them. Symbols represent
+ an actual (immutable) value. We might not know what its specific value is, but
+ we can associate constraints with that value as we analyze a path.
+ <p>
+
+ <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1MemRegion.html">MemRegion</a> is similar to a symbol.
+ It is used to provide a lexicon of how to describe abstract memory. Regions can
+ layer on top of other regions, providing a layered approach to representing memory.
+ For example, a struct object on the stack might be represented by a <tt>VarRegion</tt>,
+ but a <tt>FieldRegion</tt> which is a subregion of the <tt>VarRegion</tt> could
+ be used to represent the memory associated with a specific field of that object.
+ So how do we represent symbolic memory regions? That's what <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymbolicRegion.html">SymbolicRegion</a>
+ is for. It is a <tt>MemRegion</tt> that has an associated symbol. Since the
+ symbol is unique and has a unique name; that symbol names the region.
+ <p>
+ Let's see how the analyzer processes the expressions in the following example:
+ <p>
+ <pre class="code_example">
+ int foo(int x) {
+ int y = x * 2;
+ int z = x;
+ ...
+ }
+ </pre>
+ <p>
+Let's look at how <tt>x*2</tt> gets evaluated. When <tt>x</tt> is evaluated,
+we first construct an <tt>SVal</tt> that represents the lvalue of <tt>x</tt>, in
+this case it is an <tt>SVal</tt> that references the <tt>MemRegion</tt> for <tt>x</tt>.
+Afterwards, when we do the lvalue-to-rvalue conversion, we get a new <tt>SVal</tt>,
+which references the value <b>currently bound</b> to <tt>x</tt>. That value is
+symbolic; it's whatever <tt>x</tt> was bound to at the start of the function.
+Let's call that symbol <tt>$0</tt>. Similarly, we evaluate the expression for <tt>2</tt>,
+and get an <tt>SVal</tt> that references the concrete number <tt>2</tt>. When
+we evaluate <tt>x*2</tt>, we take the two <tt>SVals</tt> of the subexpressions,
+and create a new <tt>SVal</tt> that represents their multiplication (which in
+this case is a new symbolic expression, which we might call <tt>$1</tt>). When we
+evaluate the assignment to <tt>y</tt>, we again compute its lvalue (a <tt>MemRegion</tt>),
+and then bind the <tt>SVal</tt> for the RHS (which references the symbolic value <tt>$1</tt>)
+to the <tt>MemRegion</tt> in the symbolic store.
+<br>
+The second line is similar. When we evaluate <tt>x</tt> again, we do the same
+dance, and create an <tt>SVal</tt> that references the symbol <tt>$0</tt>. Note, two <tt>SVals</tt>
+might reference the same underlying values.
+
+<p>
+To summarize, MemRegions are unique names for blocks of memory. Symbols are
+unique names for abstract symbolic values. Some MemRegions represents abstract
+symbolic chunks of memory, and thus are also based on symbols. SVals are just
+references to values, and can reference either MemRegions, Symbols, or concrete
+values (e.g., the number 1).
+
+ <!--
+ TODO: Add a picture.
+ <br>
+ Symbols<br>
+ FunctionalObjects are used throughout.
+ -->
+<h2 id=idea>Idea for a Checker</h2>
+ Here are several questions which you should consider when evaluating your
+ checker idea:
+ <ul>
+ <li>Can the check be effectively implemented without path-sensitive
+ analysis? See <a href="#ast">AST Visitors</a>.</li>
+
+ <li>How high the false positive rate is going to be? Looking at the occurrences
+ of the issue you want to write a checker for in the existing code bases might
+ give you some ideas. </li>
+
+ <li>How the current limitations of the analysis will effect the false alarm
+ rate? Currently, the analyzer only reasons about one procedure at a time (no
+ inter-procedural analysis). Also, it uses a simple range tracking based
+ solver to model symbolic execution.</li>
+
+ <li>Consult the <a
+ href="http://llvm.org/bugs/buglist.cgi?query_format=advanced&amp;bug_status=NEW&amp;bug_status=REOPENED&amp;version=trunk&amp;component=Static%20Analyzer&amp;product=clang">Bugzilla database</a>
+ to get some ideas for new checkers and consider starting with improving/fixing
+ bugs in the existing checkers.</li>
+ </ul>
+
+<h2 id=registration>Checker Registration</h2>
+ All checker implementation files are located in <tt>clang/lib/StaticAnalyzer/Checkers</tt>
+ folder. Follow the steps below to register a new checker with the analyzer.
+<ol>
+ <li>Create a new checker implementation file, for example <tt>./lib/StaticAnalyzer/Checkers/NewChecker.cpp</tt>
+<pre class="code_example">
+using namespace clang;
+using namespace ento;
+
+namespace {
+class NewChecker: public Checker< check::PreStmt&lt;CallExpr> > {
+public:
+ void checkPreStmt(const CallExpr *CE, CheckerContext &amp;Ctx) const {}
+}
+}
+void ento::registerNewChecker(CheckerManager &amp;mgr) {
+ mgr.registerChecker&lt;NewChecker>();
+}
+</pre>
+
+<li>Pick the package name for your checker and add the registration code to
+<tt>./lib/StaticAnalyzer/Checkers/Checkers.td</tt>. Note, all checkers should
+first be developed as experimental. Suppose our new checker performs security
+related checks, then we should add the following lines under
+<tt>SecurityExperimental</tt> package:
+<pre class="code_example">
+let ParentPackage = SecurityExperimental in {
+...
+def NewChecker : Checker<"NewChecker">,
+ HelpText<"This text should give a short description of the checks performed.">,
+ DescFile<"NewChecker.cpp">;
+...
+} // end "security.experimental"
+</pre>
+
+<li>Make the source code file visible to CMake by adding it to
+<tt>./lib/StaticAnalyzer/Checkers/CMakeLists.txt</tt>.
+
+<li>Compile and see your checker in the list of available checkers by running:<br>
+<tt><b>$clang -cc1 -analyzer-checker-help</b></tt>
+</ol>
+
+
+<h2 id=skeleton>Checker Skeleton</h2>
+ There are two main decisions you need to make:
+ <ul>
+ <li> Which events the checker should be tracking.
+ See <a href="http://clang.llvm.org/doxygen/classento_1_1CheckerDocumentation.html">CheckerDocumentation</a>
+ for the list of available checker callbacks.</li>
+ <li> What data you want to store as part of the checker-specific program
+ state. Try to minimize the checker state as much as possible. </li>
+ </ul>
+
+<h2 id=bugs>Bug Reports</h2>
+
+<h2 id=ast>AST Visitors</h2>
+ Some checks might not require path-sensitivity to be effective. Simple AST walk
+ might be sufficient. If that is the case, consider implementing a Clang
+ compiler warning. On the other hand, a check might not be acceptable as a compiler
+ warning; for example, because of a relatively high false positive rate. In this
+ situation, AST callbacks <tt><b>checkASTDecl</b></tt> and
+ <tt><b>checkASTCodeBody</b></tt> are your best friends.
+
+<h2 id=testing>Testing</h2>
+ Every patch should be well tested with Clang regression tests. The checker tests
+ live in <tt>clang/test/Analysis</tt> folder. To run all of the analyzer tests,
+ execute the following from the <tt>clang</tt> build directory:
+ <pre class="code">
+ $ <b>TESTDIRS=Analysis make test</b>
+ </pre>
+
+<h2 id=commands>Useful Commands/Debugging Hints</h2>
+<ul>
+<li>
+While investigating a checker-related issue, instruct the analyzer to only
+execute a single checker:
+<br><tt>
+$ <b>clang -cc1 -analyze -analyzer-checker=osx.KeychainAPI test.c</b>
+</tt>
+</li>
+<li>
+To dump AST:
+<br><tt>
+$ <b>clang -cc1 -ast-dump test.c</b>
+</tt>
+</li>
+<li>
+To view/dump CFG use <tt>debug.ViewCFG</tt> or <tt>debug.DumpCFG</tt> checkers:
+<br><tt>
+$ <b>clang -cc1 -analyze -analyzer-checker=debug.ViewCFG test.c</b>
+</tt>
+</li>
+<li>
+To see all available debug checkers:
+<br><tt>
+$ <b>clang -cc1 -analyzer-checker-help | grep "debug"</b>
+</tt>
+</li>
+<li>
+To see which function is failing while processing a large file use
+<tt>-analyzer-display-progress</tt> option.
+</li>
+<li>
+While debugging execute <tt>clang -cc1 -analyze -analyzer-checker=core</tt>
+instead of <tt>clang --analyze</tt>, as the later would call the compiler
+in a separate process.
+</li>
+<li>
+To view <tt>ExplodedGraph</tt> (the state graph explored by the analyzer) while
+debugging, goto a frame that has <tt>clang::ento::ExprEngine</tt> object and
+execute:
+<br><tt>
+(gdb) <b>p ViewGraph(0)</b>
+</tt>
+</li>
+<li>
+To see the <tt>ProgramState</tt> while debugging use the following command.
+<br><tt>
+(gdb) <b>p State->dump()</b>
+</tt>
+</li>
+<li>
+To see <tt>clang::Expr</tt> while debugging use the following command. If you
+pass in a SourceManager object, it will also dump the corresponding line in the
+source code.
+<br><tt>
+(gdb) <b>p E->dump()</b>
+</tt>
+</li>
+<li>
+To dump AST of a method that the current <tt>ExplodedNode</tt> belongs to:
+<br><tt>
+(gdb) <b>p C.getPredecessor()->getCodeDecl().getBody()->dump()</b>
+(gdb) <b>p C.getPredecessor()->getCodeDecl().getBody()->dump(getContext().getSourceManager())</b>
+</tt>
+</li>
+</ul>
+
+</div>
+</div>
+</body>
+</html>
diff --git a/www/analyzer/dev_cxx.html b/www/analyzer/dev_cxx.html
index b5ef2b10919f..39dbf7b4af8f 100644
--- a/www/analyzer/dev_cxx.html
+++ b/www/analyzer/dev_cxx.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Analyzer Development: C++ Support</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
@@ -31,18 +31,20 @@ decent analysis of C++. This list is also not complete; new tasks
will be added as deemed necessary.</p>
<ul>
- <li>Control-Flow Graph Enhancements:</li>
+ <li>Control-Flow Graph Enhancements:
<ul>
<li>Model C++ destructors</li>
<li>Model C++ initializers (in constructors)</li>
</ul>
- <li>Path-Sensitive Analysis Engine (GRExprEngine):</li>
+ </li>
+ <li>Path-Sensitive Analysis Engine (GRExprEngine):
<ul>
<li>Model C++ casts</li>
<li>Model C++ constructors</li>
<li>Model C++ destructors</li>
<li>Model <tt>new</tt> and <tt>delete</tt></li>
</ul>
+ </li>
</ul>
</div>
diff --git a/www/analyzer/filing_bugs.html b/www/analyzer/filing_bugs.html
index 460ef815c39c..f32a8ab20a6c 100644
--- a/www/analyzer/filing_bugs.html
+++ b/www/analyzer/filing_bugs.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Filing Bugs and Feature Requests</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
diff --git a/www/analyzer/index.html b/www/analyzer/index.html
index 7d99ac9621e4..18bafd056288 100644
--- a/www/analyzer/index.html
+++ b/www/analyzer/index.html
@@ -3,38 +3,10 @@
<html>
<head>
<title>Clang Static Analyzer</title>
- <link type="text/css" rel="stylesheet" href="content.css" />
- <link type="text/css" rel="stylesheet" href="menu.css" />
+ <link type="text/css" rel="stylesheet" href="content.css">
+ <link type="text/css" rel="stylesheet" href="menu.css">
<script type="text/javascript" src="scripts/menu.js"></script>
-</head>
-<body>
-
-<div id="page">
-<!--#include virtual="menu.html.incl"-->
-<div id="content">
-
-
-<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
-<tr><td>
-
-<h1>Clang Static Analyzer</h1>
-
-<p>The Clang Static Analyzer is source code analysis tool that find bugs in C
-and Objective-C programs.</p>
-
-<p>Currently it can be run either as a <a href="/scan-build.html">standalone
-tool</a> or <a href="/xcode.html">within Xcode</a>. The standalone tool is
-invoked from the command-line, and is intended to be run in tandem with a build
-of a codebase.</p>
-
-<p>The analyzer is 100% open source and is part of the <a
-href="http://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
-analyzer is implemented as a C++ library that can be used by other tools and
-applications.</p>
-
-<h2>Download</h2>
-
-<!-- Generated from: http://www.spiffycorners.com/index.php -->
+ <!-- Generated from: http://www.spiffycorners.com/index.php -->
<style type="text/css">
.spiffy{display:block}
@@ -77,15 +49,40 @@ applications.</p>
.spiffyfg h2 {
margin:0px; padding:10px;
}
-</style>
-<style type="text/css">
#left { float:left; }
#left h2 { margin:1px; padding-top:0px; }
#right { float:left; margin-left:20px; margin-right:20px; padding:0px ;}
#right h2 { padding:0px; margin:0px; }
#wrappedcontent { padding:15px;}
</style>
+</head>
+<body>
+
+<div id="page">
+<!--#include virtual="menu.html.incl"-->
+<div id="content">
+
+
+<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
+<tr><td>
+
+<h1>Clang Static Analyzer</h1>
+
+<p>The Clang Static Analyzer is source code analysis tool that find bugs in C
+and Objective-C programs.</p>
+
+<p>Currently it can be run either as a <a href="/scan-build.html">standalone
+tool</a> or <a href="/xcode.html">within Xcode</a>. The standalone tool is
+invoked from the command-line, and is intended to be run in tandem with a build
+of a codebase.</p>
+
+<p>The analyzer is 100% open source and is part of the <a
+href="http://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
+analyzer is implemented as a C++ library that can be used by other tools and
+applications.</p>
+
+<h2>Download</h2>
<div style="padding:0px; font-size: 90%">
<b class="spiffy">
@@ -101,7 +98,7 @@ applications.</p>
<li>Latest build (Intel-only binary, 10.5+):<br>
<!--#include virtual="latest_checker.html.incl"-->
</li>
- <li><a href="/release_notes.html">Release notes</a></li></li>
+ <li><a href="/release_notes.html">Release notes</a></li>
<li>This build can be used both from the command line and from within Xcode</li>
<li><a href="/installation.html">Installation</a> and <a href="/scan-build.html">usage</a></li>
</ul>
@@ -140,10 +137,10 @@ applications.</p>
</td><td style="padding-left:10px">
-<a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="450x" border=0></a>
-<center><b>Viewing static analyzer results in Xcode 3.2</b></center>
-<a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" border=0></a>
-<center><b>Viewing static analyzer results in a web browser</b></center>
+<a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="450" alt="analyzer in xcode"></a>
+<div style="text-align:center"><b>Viewing static analyzer results in Xcode 3.2</b></div>
+<a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450" alt="analyzer in browser"></a>
+<div style="text-align:center"><b>Viewing static analyzer results in a web browser</b></div>
</td></tr></table>
<h2 id="StaticAnalysis">What is Static Analysis?</h2>
@@ -198,7 +195,7 @@ bugs require in the worst case exponential time.</p>
<p>The Clang Static Analyzer runs in a reasonable amount of time by both
bounding the amount of checking work it will do as well as using clever
-algorithms to reduce the amount of work it must do to find bugs.</p></li>
+algorithms to reduce the amount of work it must do to find bugs.</p>
<h3>False Positives</h3>
diff --git a/www/analyzer/installation.html b/www/analyzer/installation.html
index b0e56f82c420..ebccd071cdce 100644
--- a/www/analyzer/installation.html
+++ b/www/analyzer/installation.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Obtaining the Static Analyzer</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
diff --git a/www/analyzer/latest_checker.html.incl b/www/analyzer/latest_checker.html.incl
index 8d7b58de215d..d1b0d06d5ce4 100644
--- a/www/analyzer/latest_checker.html.incl
+++ b/www/analyzer/latest_checker.html.incl
@@ -1 +1 @@
-<b><a href="/checker/checker-258.tar.bz2">checker-258.tar.bz2</a></b> (built October 13, 2011)
+<b><a href="http://bit.ly/GUmtVB">checker-263.tar.bz2</a></b> (built March 22, 2012)
diff --git a/www/analyzer/menu.html.incl b/www/analyzer/menu.html.incl
index a06eb58b0e9c..53a427667234 100644
--- a/www/analyzer/menu.html.incl
+++ b/www/analyzer/menu.html.incl
@@ -25,6 +25,7 @@
<li>
Development
<ul>
+ <li><a href="/checker_dev_manual.html">Checker Developer Manual</a></li>
<li><a href="/dev_cxx.html">Analysis support for C++</a></li>
</ul>
</li>
diff --git a/www/analyzer/release_notes.html b/www/analyzer/release_notes.html
index 311c5aecd5c8..42de9ddae27f 100644
--- a/www/analyzer/release_notes.html
+++ b/www/analyzer/release_notes.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Release notes for checker-XXX builds</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
@@ -15,10 +15,78 @@
<h1>Release notes for <tt>checker-XXX</tt> builds</h1>
+<h4 id="checker_263">checker-263</h4>
+
+<p><b>built:</b> March 22, 2012</br>
+ <b>download:</b> <a href="http://bit.ly/GUmtVB">checker-263.tar.bz2</a></p>
+<p><b>highlights:</b></p>
+
+<ul>
+<li>Fixes several serious bugs with inter-procedural analysis, including a case where retain/releases would be &quot;double-counted&quot;.</li>
+</ul>
+
+<h4 id="checker_262">checker-262</h4>
+
+<p><b>built: </b>March 15, 2012</br>
+ <b>download:</b> <a href="http://bit.ly/xETQF0">checker-262.tar.bz2</a></p>
+<p><b>highlights:</b></p>
+
+<ul>
+ <li>Enables experimental interprocedural analysis (within a file), which greatly amplifies the analyzer's ability to find issues.</li>
+ <li>Many bug fixes to the malloc/free checker.</li>
+ <li>Support for new Objective-C NSArray/NSDictionary/NSNumber literals syntax, and Objective-C container subscripting.</li>
+</ul>
+
+<p>NOTE: This build contains new interprocedural analysis that allows the analyzer to find more complicated bugs that span function boundaries. It may have problems, performance issues, etc. We'd like to <a href="/filing_bugs.html">hear about them</a>.
+
+<h4 id="checker_261">checker-261</h4>
+
+<p><b>built: </b>February 22, 2012<br>
+<b>download:</b> <a href="http://bit.ly/yN1Awv">checker-261.tar.bz2</a></p>
+<p><b>highlights:</b></p>
+
+<ul>
+ <li>Contains a new experimental malloc/free checker.</li>
+ <li>Better support for projects using ARC.</li>
+ <li>Warns about null pointers passed as arguments to C string functions.</li>
+ <li>Warns about common anti-patterns in 'strncat' size argument, which can lead to buffer overflows.</li>
+ <li>set-xcode-analyzer now supports self-contained Xcode.app (Xcode 4.3 and later).</li>
+ <li>Contains a newer version of the analyzer than Xcode 4.3.</li>
+ <li>Misc. bug fixes and performance work.</li>
+</ul>
+
+<h4 id="checker_260">checker-260</h4>
+
+<p><b>built: </b>January 25, 2012<br>
+<b>download:</b> <a href="http://bit.ly/wpAqVP">checker-260.tar.bz2</a></p>
+<p><b>highlights:</b></p>
+
+<p>This is essentially the same as checker-259, but enables the following <i>experimental</i> checkers (please provide feedback):</p>
+
+<ul>
+ <li>Warns about unsafe uses of CFArrayCreate, CFSetCreate, and CFDictionaryCreate</li>
+ <li>Warns about unsafe uses of getpw, gets, which are sources of buffer overflows</li>
+ <li>Warns about unsafe uses of mktemp and mktemps, which can lead to insecure temporary files</li>
+ <li>Warns about unsafe uses of vfork, which is <a href="https://www.securecoding.cert.org/confluence/display/seccode/POS33-C.+Do+not+use+vfork()">insecure</a> to use</li>
+ <li>Warns about not checking the return values of setuid, setgid, seteuid, setegid, setreuid, setregid (another security issue)</li>
+</ul>
+
+<h4 id="checker_259">checker-259</h4>
+
+<p><b>built: </b>January 25, 2012<br>
+<b>download:</b> <a href="http://bit.ly/zOWf1P">checker-259.tar.bz2</a></p>
+<p><b>highlights:</b></p>
+
+<ul>
+ <li>Contains a newer version of the analyzer than the one shipped in Xcode 4.2.</li>
+ <li>Significant performance optimizations to reduce memory usage of the analyzer.</li>
+ <li>Tweaks to scan-build to have it work more easily with Xcode projects using Clang.</li>
+ <li>Numerous bug fixes to better support code using ARC.</li>
+</ul>
+
<h4 id="checker_258">checker-258</h4>
-<p><b>built:</b>October 13, 2011<br>
-<b>download:</b> <a href="/checker/checker-258.tar.bz2">checker-258.tar.bz2</a></p>
+<p><b>built: </b>October 13, 2011<br>
<p><b>highlights:</b></p>
<ul>
@@ -30,8 +98,7 @@
<h4 id="checker_257">checker-257</h4>
-<p><b>built:</b>May 25, 2011<br>
-<b>download:</b> <a href="/checker/checker-257.tar.bz2">checker-257.tar.bz2</a></p>
+<p><b>built: </b>May 25, 2011<br>
<p><b>highlights:</b></p>
<ul>
@@ -43,8 +110,7 @@
<h4 id="checker_256">checker-256</h4>
-<p><b>built:</b>April 13, 2011<br>
-<b>download:</b> <a href="/checker/checker-256.tar.bz2">checker-256.tar.bz2</a></p>
+<p><b>built: </b>April 13, 2011<br>
<p><b>highlights:</b></p>
<ul>
@@ -93,8 +159,7 @@ $ find . | grep xcspec | grep Clang
<h4 id="checker_255">checker-255</h4>
-<p><b>built:</b> February 11, 2011<br>
-<b>download:</b> <a href="/checker/checker-255.tar.bz2">checker-255.tar.bz2</a></p>
+<p><b>built: </b> February 11, 2011<br>
<p><b>highlights:</b></p>
<ul>
@@ -106,8 +171,7 @@ $ find . | grep xcspec | grep Clang
<h4 id="checker_254">checker-254</h4>
-<p><b>built:</b> January 27, 2011<br>
-<b>download:</b> <a href="/checker/checker-254.tar.bz2">checker-254.tar.bz2</a></p>
+<p><b>built: </b> January 27, 2011<br>
<p><b>highlights:</b></p>
<ul>
diff --git a/www/analyzer/scan-build.html b/www/analyzer/scan-build.html
index 6c2833e7991f..710fa0f4958f 100644
--- a/www/analyzer/scan-build.html
+++ b/www/analyzer/scan-build.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>scan-build: running the analyzer from the command line</title>
- <link type="text/css" rel="stylesheet" href="content.css" />
- <link type="text/css" rel="stylesheet" href="menu.css" />
+ <link type="text/css" rel="stylesheet" href="content.css">
+ <link type="text/css" rel="stylesheet" href="menu.css">
<script type="text/javascript" src="scripts/menu.js"></script>
<script type="text/javascript" src="scripts/dbtree.js"></script>
</head>
@@ -16,7 +16,7 @@
<h1>scan-build: running the analyzer from the command line</h1>
-<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
+<table style="margin-top:0px" width="100%" cellpadding="0px" cellspacing="0">
<tr><td>
<h3>What is it?</h3>
@@ -35,9 +35,9 @@ web browser.</p>
<p><b>scan-build</b> has little or no knowledge about how you build your code.
It works by overriding the <tt>CC</tt> and <tt>CXX</tt> environment variables to
(hopefully) change your build to use a &quot;fake&quot; compiler instead of the
-one that would normally build your project. By default, this fake compiler
-executes <tt>gcc</tt> to compile your code (assuming that <tt>gcc</tt> is your
-compiler) and then executes the static analyzer to analyze your code.</p>
+one that would normally build your project. This fake compiler executes either
+<tt>clang</tt> or <tt>gcc</tt> (depending on the platform) to compile your
+code and then executes the static analyzer to analyze your code.</p>
<p>This &quot;poor man's interposition&quot; works amazingly well in many cases
and falls down in others. Please consult the information on this page on making
@@ -45,11 +45,10 @@ the best use of <b>scan-build</b>, which includes getting it to work when the
aforementioned hack fails to work.</p>
</td>
-<td style="padding-left:10px">
-<center>
- <img src="images/scan_build_cmd.png" width="450px" border=0><br>
- <a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" border=0></a>
-<br><b>Viewing static analyzer results in a web browser</b></center>
+<td style="padding-left:10px; text-align:center">
+ <img src="images/scan_build_cmd.png" width="450px" alt="scan-build"><br>
+ <a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" alt="analyzer in browser"></a>
+<br><b>Viewing static analyzer results in a web browser</b>
</td></tr></table>
<h2>Contents</h2>
@@ -77,8 +76,8 @@ aforementioned hack fails to work.</p>
<p>The <tt>scan-build</tt> command can be used to analyze an entire project by
essentially interposing on a project's build process. This means that to run the
analyzer using <tt>scan-build</tt>, you will use <tt>scan-build</tt> to analyze
-the source files compiled by <tt>gcc</tt> during a project build. This means
-that any files that are not compiled will also not be analyzed.</p>
+the source files compiled by <tt>gcc</tt>/<tt>clang</tt> during a project build.
+This means that any files that are not compiled will also not be analyzed.</p>
<h3 id="scanbuild_basicusage">Basic Usage</h3>
@@ -101,7 +100,7 @@ $ <span class="code_highlight">scan-build</span> <i>[scan-build options]</i> <sp
</pre>
<p>Operationally, <tt>scan-build</tt> literally runs &lt;command&gt; with all of the
-subsequent options passed to it. For example, one can pass <nobr><tt>-j4</tt></nobr> to
+subsequent options passed to it. For example, one can pass <tt>-j4</tt> to
<tt>make</tt> get a parallel build over 4 cores:</p>
<pre class="code_example">
@@ -141,17 +140,17 @@ options prefix the build command. For example:</p>
<tr><td><b>-o</b></td><td>Target directory for HTML report files. Subdirectories
will be created as needed to represent separate "runs" of the analyzer. If this
option is not specified, a directory is created in <tt>/tmp</tt> to store the
-reports.</td><tr>
+reports.</td></tr>
-<tr><td><b>-h</b><br><i><nobr>(or no arguments)</nobr></i></td><td>Display all
+<tr><td><b>-h</b><br><i>(or&nbsp;no&nbsp;arguments)</i></td><td>Display all
<tt>scan-build</tt> options.</td></tr>
-<tr><td><b>-k</b><br><nobr><b>--keep-going</b></nobr></td><td>Add a "keep on
+<tr><td><b>-k</b><br><b>--keep-going</b></td><td>Add a "keep on
going" option to the specified build command. <p>This option currently supports
<tt>make</tt> and <tt>xcodebuild</tt>.</p> <p>This is a convenience option; one
can specify this behavior directly using build options.</p></td></tr>
-<tr><td><b>-v<b></td><td>Verbose output from scan-build and the analyzer. <b>A
+<tr><td><b>-v</b></td><td>Verbose output from scan-build and the analyzer. <b>A
second and third "-v" increases verbosity</b>, and is useful for filing bug
reports against the analyzer.</td></tr>
@@ -217,12 +216,12 @@ $ scan-build make
<i>interposing</i> on the compiler. This interposition is currently done by
<tt>scan-build</tt> temporarily setting the environment variable <tt>CC</tt> to
<tt>ccc-analyzer</tt>. The program <tt>ccc-analyzer</tt> acts like a fake
-compiler, forwarding its command line arguments over to <tt>gcc</tt> to perform
+compiler, forwarding its command line arguments over to the compiler to perform
regular compilation and <tt>clang</tt> to perform static analysis.</p>
<p>Running <tt>configure</tt> typically generates makefiles that have hardwired
paths to the compiler, and by running <tt>configure</tt> through
-<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p.>
+<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p>
<!--
<h2 id="Debugging">Debugging the Analyzer</h2>
@@ -314,18 +313,17 @@ $ scan-build xcodebuild -configuration Debug -sdk iphonesimulator3.0
<h3>Gotcha: using the right compiler</h3>
-<p>Recall that <b>scan-build</b> analyzes your project by using <tt>gcc</tt> to
-compile the project and <tt>clang</tt> to analyze your project. When analyzing
+<p>Recall that <b>scan-build</b> analyzes your project by using a compiler to
+compile the project and <tt>clang</tt> to analyze your project. The script uses
+simple heuristics to determine which compiler should be used (it defaults to
+<tt>clang</tt> on Darwin and <tt>gcc</tt> on other platforms). When analyzing
iPhone projects, <b>scan-build</b> may pick the wrong compiler than the one
-Xcode would use to build your project. This is because multiple versions of
-<tt>gcc</tt> may be installed on your system, especially if you are developing
-for the iPhone.</p>
-
-<p>Where this particularly might be a problem is if you are using Mac OS 10.5
-(Leopard) to develop for iPhone OS 3.0. The default desktop compiler on Leopard
-is gcc-4.0, while the compiler for iPhone OS 3.0 is gcc-4.2. When compiling your
-application to run on the simulator, it is important that <b>scan-build</b>
-finds the correct version of <tt>gcc</tt>. Otherwise, you may see strange build
+Xcode would use to build your project. For example, this could be because
+multiple versions of a compiler may be installed on your system, especially if
+you are developing for the iPhone.</p>
+
+<p>When compiling your application to run on the simulator, it is important that <b>scan-build</b>
+finds the correct version of <tt>gcc/clang</tt>. Otherwise, you may see strange build
errors that only happen when you run <tt>scan-build</tt>.
<p><b>scan-build</b> provides the <tt>--use-cc</tt> and <tt>--use-c++</tt>
diff --git a/www/analyzer/xcode.html b/www/analyzer/xcode.html
index 51c5a5616387..ac75a0475470 100644
--- a/www/analyzer/xcode.html
+++ b/www/analyzer/xcode.html
@@ -3,8 +3,8 @@
<html>
<head>
<title>Build and Analyze: running the analyzer within Xcode</title>
- <link type="text/css" rel="stylesheet" href="content.css" />
- <link type="text/css" rel="stylesheet" href="menu.css" />
+ <link type="text/css" rel="stylesheet" href="content.css">
+ <link type="text/css" rel="stylesheet" href="menu.css">
<script type="text/javascript" src="scripts/menu.js"></script>
<script type="text/javascript" src="scripts/dbtree.js"></script>
</head>
@@ -33,10 +33,9 @@ presents analysis results directly within Xcode's editor.</p>
<p><b>Yes</b>. Instructions are included below.</p>
</td>
-<td style="padding-left:10px">
-<center>
- <a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="620px" border=0></a>
-<br><b>Viewing static analyzer results in Xcode</b></center>
+<td style="padding-left:10px; text-align:center">
+ <a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="620px" alt="analyzer in xcode"></a>
+<br><b>Viewing static analyzer results in Xcode</b>
</td></tr></table>
<h3>Key features:</h3>
diff --git a/www/clang_video-05-25-2007.html b/www/clang_video-05-25-2007.html
index a85cadcb1d03..f0acaedba6bb 100644
--- a/www/clang_video-05-25-2007.html
+++ b/www/clang_video-05-25-2007.html
@@ -2,10 +2,10 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>2007 LLVM Developer's Meeting</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
<!--#include virtual="menu.html.incl"-->
diff --git a/www/clang_video-07-25-2007.html b/www/clang_video-07-25-2007.html
index 179e499651a4..0fee7bcb6d12 100644
--- a/www/clang_video-07-25-2007.html
+++ b/www/clang_video-07-25-2007.html
@@ -2,10 +2,10 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>LLVM 2.0 and Beyond!</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
<!--#include virtual="menu.html.incl"-->
diff --git a/www/comparison.html b/www/comparison.html
index 4b72a8527179..2898ce8407f6 100644
--- a/www/comparison.html
+++ b/www/comparison.html
@@ -3,10 +3,10 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Comparing clang to other open source compilers</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
<!--#include virtual="menu.html.incl"-->
@@ -183,6 +183,7 @@
inefficient code and does not support many important targets.</li>
<li>Like Elsa, PCC's does not have an integrated preprocessor, making it
extremely difficult to use it for source analysis tools.</li>
+ </ul>
</div>
</body>
</html>
diff --git a/www/compatibility.html b/www/compatibility.html
index 2102ccca7e1d..725c52ff4bbc 100644
--- a/www/compatibility.html
+++ b/www/compatibility.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Language Compatibility</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
@@ -47,7 +47,7 @@
<li><a href="#c_variables-class">C variables in @class or @protocol</a></li>
</ul>
</li>
- <li><a href="#c++">C++ compatibility</a>
+ <li><a href="#cxx">C++ compatibility</a>
<ul>
<li><a href="#vla">Variable-length arrays</a></li>
<li><a href="#dep_lookup">Unqualified lookup in templates</a></li>
@@ -60,13 +60,13 @@
<li><a href="#param_name_lookup">Parameter name lookup</a></li>
</ul>
</li>
- <li><a href="#c++11">C++11 compatibility</a>
+ <li><a href="#cxx11">C++11 compatibility</a>
<ul>
<li><a href="#deleted-special-func">Deleted special member
functions</a></li>
</ul>
</li>
- <li><a href="#objective-c++">Objective-C++ compatibility</a>
+ <li><a href="#objective-cxx">Objective-C++ compatibility</a>
<ul>
<li><a href="#implicit-downcasts">Implicit downcasts</a></li>
</ul>
@@ -77,7 +77,7 @@
</ul>
<!-- ======================================================================= -->
-<h2 id="c">C compatibility</h3>
+<h2 id="c">C compatibility</h2>
<!-- ======================================================================= -->
<!-- ======================================================================= -->
@@ -318,7 +318,7 @@ add $4, (%rax)
this makes your code more clear and is compatible with both GCC and Clang.</p>
<!-- ======================================================================= -->
-<h2 id="objective-c">Objective-C compatibility</h3>
+<h2 id="objective-c">Objective-C compatibility</h2>
<!-- ======================================================================= -->
<!-- ======================================================================= -->
@@ -409,7 +409,7 @@ extern int c; // allowed
</pre>
<!-- ======================================================================= -->
-<h2 id="c++">C++ compatibility</h3>
+<h2 id="cxx">C++ compatibility</h2>
<!-- ======================================================================= -->
<!-- ======================================================================= -->
@@ -761,7 +761,7 @@ void f(int a, int a);
<p>Clang diagnoses this error (where the parameter name has been redeclared). To fix this problem, rename one of the parameters.</p>
<!-- ======================================================================= -->
-<h2 id="c++11">C++11 compatibility</h2>
+<h2 id="cxx11">C++11 compatibility</h2>
<!-- ======================================================================= -->
<!-- ======================================================================= -->
@@ -769,7 +769,7 @@ void f(int a, int a);
<!-- ======================================================================= -->
<p>In C++11, the explicit declaration of a move constructor or a move
-assignment operator within a class disables the implicit declaration
+assignment operator within a class deletes the implicit declaration
of the copy constructor and copy assignment operator. This change came
fairly late in the C++11 standardization process, so early
implementations of C++11 (including Clang before 3.0, GCC before 4.7,
@@ -778,22 +778,23 @@ accept this ill-formed code:</p>
<pre>
struct X {
- X(X&amp;&amp;); <i>// suppresses implicit copy constructor</i>
+ X(X&amp;&amp;); <i>// deletes implicit copy constructor:</i>
+ <i>// X(const X&amp;) = delete;</i>
};
void f(X x);
void g(X x) {
- f(x); <i>// error: X has no copy constructor</i>
+ f(x); <i>// error: X has a deleted copy constructor</i>
}
</pre>
-<p>This affects some C++11 code, including Boost's popular <a
+<p>This affects some early C++11 code, including Boost's popular <a
href="http://www.boost.org/doc/libs/release/libs/smart_ptr/shared_ptr.htm"><tt>shared_ptr</tt></a>
up to version 1.47.0. The fix for Boost's <tt>shared_ptr</tt> is
<a href="https://svn.boost.org/trac/boost/changeset/73202">available here</a>.</p>
<!-- ======================================================================= -->
-<h2 id="objective-c++">Objective-C++ compatibility</h2>
+<h2 id="objective-cxx">Objective-C++ compatibility</h2>
<!-- ======================================================================= -->
<!-- ======================================================================= -->
@@ -859,7 +860,7 @@ int cls;
@implementation I
- (int) Meth { return I.class; }
@end
-<pre>
+</pre>
<p>Use explicit message-send syntax instead, i.e. <code>[I class]</code>.</p>
diff --git a/www/cxx_compatibility.html b/www/cxx_compatibility.html
index 6aa0bbf4bed5..5351a02aabe8 100644
--- a/www/cxx_compatibility.html
+++ b/www/cxx_compatibility.html
@@ -3,10 +3,10 @@
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="5; url=compatibility.html#c++">
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - C++ Compatibility</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
diff --git a/www/cxx_status.html b/www/cxx_status.html
index 3fb1ef614bd0..1b7d8140a252 100644
--- a/www/cxx_status.html
+++ b/www/cxx_status.html
@@ -3,17 +3,15 @@
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Clang - C++ and C++'11 Status</title>
+ <title>Clang - C++98 and C++11 Status</title>
<link type="text/css" rel="stylesheet" href="menu.css">
<link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
- .category { background-color: #FFFFCC; text-align: center; }
- .na { background-color: #C0C0C0; text-align: center; }
- .broken { background-color: #C11B17 }
- .basic { background-color: #F88017 }
- .medium { background-color: #FDD017 }
- .advanced { background-color: #347C17 }
- .complete { background-color: #00FF00 }
+ .none { background-color: #FFCCCC }
+ .svn { background-color: #FFFF99 }
+ .full { background-color: #CCFF99 }
+ .na { background-color: #DDDDDD }
+ th { background-color: #FFDDAA }
</style>
</head>
<body>
@@ -23,18 +21,20 @@
<div id="content">
<!--*************************************************************************-->
-<h1>C++ and C++'11 Support in Clang</h1>
+<h1>C++98 and C++11 Support in Clang</h1>
<!--*************************************************************************-->
-<p>Last updated: $Date: 2011-10-15 01:35:48 +0200 (Sat, 15 Oct 2011) $</p>
+<p>Last updated: $Date: 2012-04-13 03:02:19 +0200 (Fri, 13 Apr 2012) $</p>
+
+<h2 id="cxx98">C++98 implementation status</h2>
<p>Clang currently implements all of the ISO C++ 1998 standard
(including the defects addressed in the ISO C++ 2003 standard)
- except for 'export' (which has been removed in C++'11)
+ except for 'export' (which has been removed in C++11)
and is considered a production-quality C++ compiler. The <a
href="http://llvm.org/bugs/">LLVM bug tracker</a> contains a Clang
C++ component that tracks known Clang C++ bugs.</p>
-<h2 id="cxx11">C++11 Implementation status</h2>
+<h2 id="cxx11">C++11 implementation status</h2>
<p>Clang provides support for a number of features included in the new <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372">ISO C++ Standard, ISO/IEC 14882:2011</a>. The following table describes which C++11 features have been implemented in Clang and in which Clang versions they became available.</p>
@@ -45,327 +45,336 @@ with clang; other versions have not been tested.</p>
<table width="689" border="1" cellspacing="0">
<tr>
- <th bgcolor="#ffddaa">Language Feature</th>
- <th bgcolor="#ffddaa">C++0x Proposal</th>
- <th bgcolor="#ffddaa">Available in Clang?</th>
+ <th>Language Feature</th>
+ <th>C++11 Proposal</th>
+ <th>Available in Clang?</th>
</tr>
<tr>
<td>Rvalue references</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;Rvalue references for <code>*this</code></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm">N2439</a></td>
- <td align="center">Clang 2.9<br/></td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Initialization of class objects by rvalues</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html">N1610</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Non-static data member initializers</td>
<td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm">N2756</a></td>
- <td align="center">Clang 3.0</a></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Variadic templates</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">N2242</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;Extending variadic template template parameters</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Initializer lists</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">N2672</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Static assertions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">N1720</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td><code>auto</code>-typed variables</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">N1984</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;Multi-declarator <code>auto</code></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf">N1737</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;Removal of auto as a storage-class specifier</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm">N2546</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;New function declarator syntax</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">N2541</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
- <td>New wording for C++0x lambdas</td>
+ <td>Lambda expressions</td>
<td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf">N2927</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Declared type of an expression</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
+ </tr>
+ <tr>
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;Incomplete return types</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">N3276</a></td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Right angle brackets</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Default template arguments for function templates</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226">DR226</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Solving the SFINAE problem for expressions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html">DR339</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Alias templates</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">N2258</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Extern templates</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm">N1987</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Null pointer constant</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Strongly-typed enums</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">N2347</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Forward declarations for enums</td>
- <td>
- <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf">N2764
- </a></td>
- <td align="center">No</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf">N2764</a>
+ <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1206">DR1206</a></td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Generalized attributes</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">N2761</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Generalized constant expressions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Alignment support</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf">N2341</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<!-- Skipped N1627: Conditionally-support behavior -->
<!-- Skipped N1727: Changing Undefined Behavior into Diagnosable Errors -->
<tr>
<td>Delegating constructors</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">N1986</a></td>
- <td align="center">Clang 3.0<br/></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Inheriting constructors</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm">N2540</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Explicit conversion operators</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>New character types</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">N2249</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Unicode string literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Raw string literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
- <td>Universal character name literals</td>
+ <td>Universal character names in literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">N2170</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>User-defined literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">N2765</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Standard Layout Types</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm">N2342</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
+ </tr>
+ <tr>
+ <td>Defaulted functions</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
- <td>Defaulted and deleted functions</td>
+ <td>Deleted functions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Extended friend declarations</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf">N1791</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Extending <code>sizeof</code></td>
- <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html">N2253</a></td>
- <td align="center">No</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html">N2253</a>
+ <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#850">DR850</a></td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Inline namespaces</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Unrestricted unions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Local and unnamed types as template arguments</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">N2657</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Range-based for</td>
<td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html">N2930</a></td>
- <td align="center">Clang 3.0</td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Explicit virtual overrides</td>
<td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm">N2928</a>
- <br/><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">N3206</a>
-<br/><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">N3272</a></td>
- <td align="center">Clang 3.0</td>
+ <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">N3206</a>
+ <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">N3272</a></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Minimal support for garbage collection and reachability-based leak detection</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm">N2670</a></td>
- <td align="center">No</td>
+ <td class="na" align="center">N/A</td>
</tr>
<tr>
<td>Allowing move constructors to throw [noexcept]</td>
- <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.htm">N3050</a></td>
- <td align="center">Clang 3.0</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050</a></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr>
<td>Defining move special member functions</td>
- <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.htm">N3053</a></td>
- <td align="center">Clang 3.0</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html">N3053</a></td>
+ <td class="full" align="center">Clang 3.0</td>
</tr>
<tr class="separator">
- <th align="center" colspan="3" bgcolor="#ffddaa">Concurrency</th>
+ <th align="center" colspan="3">Concurrency</th>
</tr>
<tr>
<td>Sequence points</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html">N2239</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Atomic operations</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">N2427</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Strong Compare and Exchange</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html">N2748</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Bidirectional Fences</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">N2752</a></td>
- <td align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Memory model</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm">N2429</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Data-dependency ordering: atomics and memory model</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm">N2664</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Propagating exceptions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Abandoning a process and at_quick_exit</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm">N2440</a></td>
- <td align="center">No</td>
+ <td class="na" align="center">N/A</td>
</tr>
<tr>
<td>Allow atomics use in signal handlers</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm">N2547</a></td>
- <td align="center"><span class="unsupported">No</span></td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Thread-local storage</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">N2659</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr>
<td>Dynamic initialization and destruction with concurrency</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">N2660</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
<tr class="separator">
- <th align="center" colspan="3" bgcolor="#ffddaa">C99 Features in C++0x</th>
+ <th align="center" colspan="3">C99 Features in C++11</th>
</tr>
<tr>
<td><code>__func__</code> predefined identifier</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm">N2340</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>C99 preprocessor</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm">N1653</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td><code>long long</code></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf">N1811</a></td>
- <td align="center">Clang 2.9</td>
+ <td class="full" align="center">Clang 2.9</td>
</tr>
<tr>
<td>Extended integral types</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf">N1988</a></td>
- <td align="center">No</td>
+ <td class="none" align="center">No</td>
</tr>
</table>
-<br />
</div>
</body>
</html>
diff --git a/www/diagnostics.html b/www/diagnostics.html
index b3b168b88836..45f69074bcfd 100644
--- a/www/diagnostics.html
+++ b/www/diagnostics.html
@@ -4,10 +4,14 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Clang - Expressive Diagnostics</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
-</style>
+ .warn { color:magenta; }
+ .err { color:red; }
+ .snip { color:darkgreen; }
+ .point { color:blue; }
+ </style>
</head>
<body>
@@ -35,14 +39,14 @@ that embed Clang and extract equivalent information through internal APIs.-->
<p>First, all diagnostics produced by clang include full column number
information. The clang command-line compiler driver uses this information
-to print "caret diagnostics".
+to print "point diagnostics".
(IDEs can use the information to display in-line error markup.)
Precise error location in the source is a feature provided by many commercial
compilers, but is generally missing from open source
compilers. This is nice because it makes it very easy to understand exactly
what is wrong in a particular piece of code</p>
-<p>The caret (the blue "^" character) exactly shows where the problem is, even
+<p>The point (the blue "^" character) exactly shows where the problem is, even
inside of a string. This makes it really easy to jump to the problem and
helps when multiple instances of the same character occur on a line. (We'll
revisit this more in following examples.)</p>
@@ -51,9 +55,9 @@ revisit this more in following examples.)</p>
$ <b>gcc-4.2 -fsyntax-only -Wformat format-strings.c</b>
format-strings.c:91: warning: too few arguments for format
$ <b>clang -fsyntax-only format-strings.c</b>
- format-strings.c:91:13: <font color="magenta">warning:</font> '.*' specified field precision is missing a matching 'int' argument
- <font color="darkgreen"> printf("%.*d");</font>
- <font color="blue"> ^</font>
+ format-strings.c:91:13: <span class="warn">warning:</span> '.*' specified field precision is missing a matching 'int' argument
+ <span class="snip"> printf("%.*d");</span>
+ <span class="point"> ^</span>
</pre>
<h2>Range Highlighting for Related Text</h2>
@@ -63,7 +67,7 @@ statements, and other constructs in your program and uses this to make
diagnostics highlight related information. In the following somewhat
nonsensical example you can see that you don't even need to see the original source code to
understand what is wrong based on the Clang error. Because clang prints a
-caret, you know exactly <em>which</em> plus it is complaining about. The range
+point, you know exactly <em>which</em> plus it is complaining about. The range
information highlights the left and right side of the plus which makes it
immediately obvious what the compiler is talking about.
Range information is very useful for
@@ -73,9 +77,9 @@ cases involving precedence issues and many other cases.</p>
$ <b>gcc-4.2 -fsyntax-only t.c</b>
t.c:7: error: invalid operands to binary + (have 'int' and 'struct A')
$ <b>clang -fsyntax-only t.c</b>
- t.c:7:39: <font color="red">error:</font> invalid operands to binary expression ('int' and 'struct A')
- <font color="darkgreen"> return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</font>
- <font color="blue"> ~~~~~~~~~~~~~~ ^ ~~~~~</font>
+ t.c:7:39: <span class="err">error:</span> invalid operands to binary expression ('int' and 'struct A')
+ <span class="snip"> return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</span>
+ <span class="point"> ~~~~~~~~~~~~~~ ^ ~~~~~</span>
</pre>
<h2>Precision in Wording</h2>
@@ -84,7 +88,7 @@ cases involving precedence issues and many other cases.</p>
out of clang contain exactly the pertinent information about what is wrong and
why. In the example above, we tell you what the inferred types are for
the left and right hand sides, and we don't repeat what is obvious from the
-caret (e.g., that this is a "binary +").</p>
+point (e.g., that this is a "binary +").</p>
<p>Many other examples abound. In the following example, not only do we tell you that there is a problem with the *
and point to it, we say exactly why and tell you what the type is (in case it is
@@ -96,9 +100,9 @@ quickly.</p>
$ <b>gcc-4.2 -fsyntax-only t.c</b>
t.c:5: error: invalid type argument of 'unary *'
$ <b>clang -fsyntax-only t.c</b>
- t.c:5:11: <font color="red">error:</font> indirection requires pointer operand ('int' invalid)
- <font color="darkgreen"> int y = *SomeA.X;</font>
- <font color="blue"> ^~~~~~~~</font>
+ t.c:5:11: <span class="err">error:</span> indirection requires pointer operand ('int' invalid)
+ <span class="snip"> int y = *SomeA.X;</span>
+ <span class="point"> ^~~~~~~~</span>
</pre>
<h2>No Pretty Printing of Expressions in Diagnostics</h2>
@@ -111,9 +115,9 @@ it tries to do this. In this example P and Q have type "int*":</p>
$ <b>gcc-4.2 -fsyntax-only t.c</b>
#'exact_div_expr' not supported by pp_c_expression#'t.c:12: error: called object is not a function
$ <b>clang -fsyntax-only t.c</b>
- t.c:12:8: <font color="red">error:</font> called object type 'int' is not a function or function pointer
- <font color="darkgreen"> (P-Q)();</font>
- <font color="blue"> ~~~~~^</font>
+ t.c:12:8: <span class="err">error:</span> called object type 'int' is not a function or function pointer
+ <span class="snip"> (P-Q)();</span>
+ <span class="point"> ~~~~~^</span>
</pre>
<p>This can be particularly bad in G++, which often emits errors
@@ -136,9 +140,9 @@ it tries to do this. In this example P and Q have type "int*":</p>
t.cc:9: error: no match for 'operator+' in '(((a*)P) + (*(long int*)(P-&gt;foo::&lt;anonymous&gt;.a::_vptr$a + -0x00000000000000020)))-&gt;a::bar() + * P'
t.cc:9: error: return-statement with a value, in function returning 'void'
$ <b>clang t.cc</b>
- t.cc:9:18: <font color="red">error:</font> invalid operands to binary expression ('int' and 'foo')
- <font color="darkgreen"> return P->bar() + *P;</font>
- <font color="blue"> ~~~~~~~~ ^ ~~</font>
+ t.cc:9:18: <span class="err">error:</span> invalid operands to binary expression ('int' and 'foo')
+ <span class="snip"> return P->bar() + *P;</span>
+ <span class="point"> ~~~~~~~~ ^ ~~</span>
</pre>
@@ -160,9 +164,9 @@ message would be ugly just because it was long and hard to read.</p>
$ <b>gcc-4.2 -fsyntax-only t.c</b>
t.c:15: error: invalid operands to binary / (have 'float __vector__' and 'const int *')
$ <b>clang -fsyntax-only t.c</b>
- t.c:15:11: <font color="red">error:</font> can't convert between vector values of different size ('__m128' and 'int const *')
- <font color="darkgreen"> myvec[1]/P;</font>
- <font color="blue"> ~~~~~~~~^~</font>
+ t.c:15:11: <span class="err">error:</span> can't convert between vector values of different size ('__m128' and 'int const *')
+ <span class="snip"> myvec[1]/P;</span>
+ <span class="point"> ~~~~~~~~^~</span>
</pre>
<p>The following example shows where it is useful for the compiler to expose
@@ -173,9 +177,9 @@ system "pid_t" typedef is defined, Clang helpfully displays it with "aka".</p>
$ <b>gcc-4.2 -fsyntax-only t.c</b>
t.c:13: error: request for member 'x' in something not a structure or union
$ <b>clang -fsyntax-only t.c</b>
- t.c:13:9: <font color="red">error:</font> member reference base type 'pid_t' (aka 'int') is not a structure or union
- <font color="darkgreen"> myvar = myvar.x;</font>
- <font color="blue"> ~~~~~ ^</font>
+ t.c:13:9: <span class="err">error:</span> member reference base type 'pid_t' (aka 'int') is not a structure or union
+ <span class="snip"> myvar = myvar.x;</span>
+ <span class="point"> ~~~~~ ^</span>
</pre>
<p>In C++, type preservation includes retaining any qualification written into type names. For example, if we take a small snippet of code such as:
@@ -204,9 +208,9 @@ void addHTTPService(servers::Server const &amp;server, ::services::WebService co
$ <b>g++-4.2 -fsyntax-only t.cpp</b>
t.cpp:9: error: no match for 'operator+=' in 'server += http'
$ <b>clang -fsyntax-only t.cpp</b>
- t.cpp:9:10: <font color="red">error:</font> invalid operands to binary expression ('servers::Server const' and '::services::WebService const *')
- <font color="darkgreen">server += http;</font>
- <font color="blue">~~~~~~ ^ ~~~~</font>
+ t.cpp:9:10: <span class="err">error:</span> invalid operands to binary expression ('servers::Server const' and '::services::WebService const *')
+ <span class="snip">server += http;</span>
+ <span class="point">~~~~~~ ^ ~~~~</span>
</pre>
<p>Naturally, type preservation extends to uses of templates, and Clang retains information about how a particular template specialization (like <code>std::vector&lt;Real&gt;</code>) was spelled within the source code. For example:</p>
@@ -215,9 +219,9 @@ void addHTTPService(servers::Server const &amp;server, ::services::WebService co
$ <b>g++-4.2 -fsyntax-only t.cpp</b>
t.cpp:12: error: no match for 'operator=' in 'str = vec'
$ <b>clang -fsyntax-only t.cpp</b>
- t.cpp:12:7: <font color="red">error:</font> incompatible type assigning 'vector&lt;Real&gt;', expected 'std::string' (aka 'class std::basic_string&lt;char&gt;')
- <font color="darkgreen">str = vec</font>;
- <font color="blue">^ ~~~</font>
+ t.cpp:12:7: <span class="err">error:</span> incompatible type assigning 'vector&lt;Real&gt;', expected 'std::string' (aka 'class std::basic_string&lt;char&gt;')
+ <span class="snip">str = vec</span>;
+ <span class="point">^ ~~~</span>
</pre>
<h2>Fix-it Hints</h2>
@@ -230,18 +234,18 @@ specific guidance in the form of a code transformation to correct the
problem. In the following example, Clang warns about the use of a GCC
extension that has been considered obsolete since 1993. The underlined
code should be removed, then replaced with the code below the
-caret line (".x =" or ".y =", respectively).</p>
+point line (".x =" or ".y =", respectively).</p>
<pre>
$ <b>clang t.c</b>
- t.c:5:28: <font color="magenta">warning:</font> use of GNU old-style field designator extension
- <font color="darkgreen">struct point origin = { x: 0.0, y: 0.0 };</font>
- <font color="red">~~</font> <font color="blue">^</font>
- <font color="darkgreen">.x = </font>
- t.c:5:36: <font color="magenta">warning:</font> use of GNU old-style field designator extension
- <font color="darkgreen">struct point origin = { x: 0.0, y: 0.0 };</font>
- <font color="red">~~</font> <font color="blue">^</font>
- <font color="darkgreen">.y = </font>
+ t.c:5:28: <span class="warn">warning:</span> use of GNU old-style field designator extension
+ <span class="snip">struct point origin = { x: 0.0, y: 0.0 };</span>
+ <span class="err">~~</span> <span class="point">^</span>
+ <span class="snip">.x = </span>
+ t.c:5:36: <span class="warn">warning:</span> use of GNU old-style field designator extension
+ <span class="snip">struct point origin = { x: 0.0, y: 0.0 };</span>
+ <span class="err">~~</span> <span class="point">^</span>
+ <span class="snip">.y = </span>
</pre>
<p>"Fix-it" hints are most useful for
@@ -253,10 +257,10 @@ diagnostic.<p>
<pre>
$ <b>clang t.cpp</b>
- t.cpp:9:3: <font color="red">error:</font> template specialization requires 'template&lt;&gt;'
+ t.cpp:9:3: <span class="err">error:</span> template specialization requires 'template&lt;&gt;'
struct iterator_traits&lt;file_iterator&gt; {
- <font color="blue">^</font>
- <font color="darkgreen">template&lt;&gt; </font>
+ <span class="point">^</span>
+ <span class="snip">template&lt;&gt; </span>
</pre>
<h2>Automatic Macro Expansion</h2>
@@ -273,12 +277,12 @@ and also shows how some of the other pieces work in a bigger example.</p>
t.c: In function 'test':
t.c:80: error: invalid operands to binary &lt; (have 'struct mystruct' and 'float')
$ <b>clang -fsyntax-only t.c</b>
- t.c:80:3: <font color="red">error:</font> invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
- <font color="darkgreen"> X = MYMAX(P, F);</font>
- <font color="blue"> ^~~~~~~~~~~</font>
+ t.c:80:3: <span class="err">error:</span> invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
+ <span class="snip"> X = MYMAX(P, F);</span>
+ <span class="point"> ^~~~~~~~~~~</span>
t.c:76:94: note: instantiated from:
- <font color="darkgreen">#define MYMAX(A,B) __extension__ ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a &lt; __b ? __b : __a; })</font>
- <font color="blue"> ~~~ ^ ~~~</font>
+ <span class="snip">#define MYMAX(A,B) __extension__ ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a &lt; __b ? __b : __a; })</span>
+ <span class="point"> ~~~ ^ ~~~</span>
</pre>
<p>Here's another real world warning that occurs in the "window" Unix package (which
@@ -286,15 +290,15 @@ implements the "wwopen" class of APIs):</p>
<pre>
$ <b>clang -fsyntax-only t.c</b>
- t.c:22:2: <font color="magenta">warning:</font> type specifier missing, defaults to 'int'
- <font color="darkgreen"> ILPAD();</font>
- <font color="blue"> ^</font>
+ t.c:22:2: <span class="warn">warning:</span> type specifier missing, defaults to 'int'
+ <span class="snip"> ILPAD();</span>
+ <span class="point"> ^</span>
t.c:17:17: note: instantiated from:
- <font color="darkgreen">#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */</font>
- <font color="blue"> ^</font>
+ <span class="snip">#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */</span>
+ <span class="point"> ^</span>
t.c:14:2: note: instantiated from:
- <font color="darkgreen"> register i; \</font>
- <font color="blue"> ^</font>
+ <span class="snip"> register i; \</span>
+ <span class="point"> ^</span>
</pre>
<p>In practice, we've found that Clang's treatment of macros is actually more useful in multiply nested
@@ -308,7 +312,7 @@ little things add up over time and contribute to a great user experience.</p>
<p>The following example shows a trivial little tweak, where we tell you to put the semicolon at
the end of the line that is missing it (line 4) instead of at the beginning of
the following line (line 5). This is particularly important with fixit hints
-and caret diagnostics, because otherwise you don't get the important context.
+and point diagnostics, because otherwise you don't get the important context.
</p>
<pre>
@@ -316,10 +320,10 @@ and caret diagnostics, because otherwise you don't get the important context.
t.c: In function 'foo':
t.c:5: error: expected ';' before '}' token
$ <b>clang t.c</b>
- t.c:4:8: <font color="red">error:</font> expected ';' after expression
- <font color="darkgreen"> bar()</font>
- <font color="blue"> ^</font>
- <font color="blue"> ;</font>
+ t.c:4:8: <span class="err">error:</span> expected ';' after expression
+ <span class="snip"> bar()</span>
+ <span class="point"> ^</span>
+ <span class="point"> ;</span>
</pre>
<p>The following example shows much better error recovery than GCC. The message coming out
@@ -330,9 +334,9 @@ and produces a much more useful diagnosis of the problem.</p>
$ <b>gcc-4.2 t.c</b>
t.c:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
$ <b>clang t.c</b>
- t.c:3:1: <font color="red">error:</font> unknown type name 'foo_t'
- <font color="darkgreen">foo_t *P = 0;</font>
- <font color="blue">^</font>
+ t.c:3:1: <span class="err">error:</span> unknown type name 'foo_t'
+ <span class="snip">foo_t *P = 0;</span>
+ <span class="point">^</span>
</pre>
<p>The following example shows that we recover from the simple case of
@@ -352,14 +356,14 @@ forgetting a ; after a struct definition much better than GCC.</p>
t.cc:4: error: invalid type in declaration before ';' token
t.cc:6: error: expected unqualified-id at end of input
$ <b>clang t.cc</b>
- t.cc:2:11: <font color="red">error:</font> expected ';' after class
- <font color="darkgreen">class a {}</font>
- <font color="blue"> ^</font>
- <font color="blue"> ;</font>
- t.cc:6:2: <font color="red">error:</font> expected ';' after struct
- <font color="darkgreen">}</font>
- <font color="blue"> ^</font>
- <font color="blue"> ;</font>
+ t.cc:2:11: <span class="err">error:</span> expected ';' after class
+ <span class="snip">class a {}</span>
+ <span class="point"> ^</span>
+ <span class="point"> ;</span>
+ t.cc:6:2: <span class="err">error:</span> expected ';' after struct
+ <span class="snip">}</span>
+ <span class="point"> ^</span>
+ <span class="point"> ;</span>
</pre>
<p>While each of these details is minor, we feel that they all add up to provide
diff --git a/www/features.html b/www/features.html
index 9e342ea0eca5..d55391a34fb4 100644
--- a/www/features.html
+++ b/www/features.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Features and Goals</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
@@ -71,7 +71,8 @@ options for performance analysis.</p>
is significantly quicker than gcc and uses less memory For example, when
compiling "Carbon.h" on Mac OS/X, we see that clang is 2.5x faster than GCC:</p>
-<img class="img_slide" src="feature-compile1.png" width="400" height="300" />
+<img class="img_slide" src="feature-compile1.png" width="400" height="300"
+ alt="Time to parse carbon.h: -fsyntax-only">
<p>Carbon.h is a monster: it transitively includes 558 files, 12.3M of code,
declares 10000 functions, has 2000 struct definitions, 8000 fields, 20000 enum
@@ -94,7 +95,8 @@ memory use is even moreso: the less memory the code takes the more code you can
fit into memory at a time (useful for whole program analysis tools, for
example).</p>
-<img class="img_slide" src="feature-memory1.png" width="400" height="300" />
+<img class="img_slide" src="feature-memory1.png" width="400" height="300"
+ alt="Space">
<p>Here we see a huge advantage of clang: its ASTs take <b>5x less memory</b>
than GCC's syntax trees, despite the fact that clang's ASTs capture far more
@@ -107,7 +109,8 @@ architecture</a> that makes it relatively easy to adapt it and build new tools
with it. This means that it is often possible to apply out-of-the-box thinking
and novel techniques to improve compilation in various ways.</p>
-<img class="img_slide" src="feature-compile2.png" width="400" height="300" />
+<img class="img_slide" src="feature-compile2.png" width="400" height="300"
+ alt="Preprocessor Speeds: GCC 4.2 vs clang-all">
<p>This slide shows how the clang preprocessor can be used to make "distcc"
parallelization <b>3x</b> more scalable than when using the GCC preprocessor.
@@ -149,8 +152,8 @@ GCC and Clang diagnostic:</p>
t.c:7: error: invalid operands to binary + (have 'int' and 'struct A')
$ <b>clang -fsyntax-only t.c</b>
t.c:7:39: error: invalid operands to binary expression ('int' and 'struct A')
- <font color="darkgreen"> return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</font>
- <font color="blue"> ~~~~~~~~~~~~~~ ^ ~~~~~</font>
+ <span style="color:darkgreen"> return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</span>
+ <span style="color:blue"> ~~~~~~~~~~~~~~ ^ ~~~~~</span>
</pre>
<p>Here you can see that you don't even need to see the original source code to
@@ -200,13 +203,13 @@ and uses. In addition, the library-based approach encourages good interfaces
and makes it easier for new developers to get involved (because they only need
to understand small pieces of the big picture).</p>
-<blockquote>
+<blockquote><p>
"The world needs better compiler tools, tools which are built as libraries.
This design point allows reuse of the tools in new and novel ways. However,
building the tools as libraries isn't enough: they must have clean APIs, be as
decoupled from each other as possible, and be easy to modify/extend. This
requires clean layering, decent design, and keeping the libraries independent of
-any specific client."</blockquote>
+any specific client."</p></blockquote>
<p>
Currently, clang is divided into the following libraries and tool:
@@ -295,7 +298,7 @@ hard, and we don't always get it right the first time, but we fix any problems
when we realize we made a mistake.</p>
<!--=======================================================================-->
-<h3><a name="ideintegration">Integration with IDEs</h3>
+<h3 id="ideintegration">Integration with IDEs</h3>
<!--=======================================================================-->
<p>
diff --git a/www/get_involved.html b/www/get_involved.html
index eb9a97945b06..9ed2d470c1bd 100644
--- a/www/get_involved.html
+++ b/www/get_involved.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Get Involved</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
@@ -32,8 +32,8 @@ interests. The two clang lists are:</p>
</a> - This list is for patch submission/discussion.</li>
<li><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">cfe-dev</a> -
-This list is for everything else clang related (questions and answers, bug
-reports, etc).</li>
+This list is for everything else Clang related (questions and answers, design
+discussions, etc).</li>
</ul>
@@ -56,7 +56,7 @@ discussions or follow the list development on the web if you prefer.</p>
<p>If you're looking for something to work on, check out our <a href="OpenProjects.html">Open Projects</a> page or go look through the <a href="http://llvm.org/bugs/">Bugzilla bug database</a>.</p>
-<h2 name="criteria">Contributing Extensions to Clang</h2>
+<h2 id="criteria">Contributing Extensions to Clang</h2>
<p>Clang has always been designed as a platform for experimentation,
allowing programmers to easily extend the compiler to support great
diff --git a/www/get_started.html b/www/get_started.html
index 515cd57ce259..d819532f0dbd 100644
--- a/www/get_started.html
+++ b/www/get_started.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Getting Started</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
@@ -45,17 +45,27 @@ follows:</p>
http://www.python.org/download</a></li>
</ul>
- <li>Checkout LLVM:</li>
+ <li>Checkout LLVM:
<ul>
<li>Change directory to where you want the llvm directory placed.</li>
<li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
</ul>
- <li>Checkout Clang:</li>
+ </li>
+ <li>Checkout Clang:
<ul>
<li><tt>cd llvm/tools</tt>
<li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
</ul>
- <li>Build LLVM and Clang:</li>
+ </li>
+ <li>Checkout Compiler-RT:
+ <ul>
+ <li><tt>cd ../..</tt> (back to where you started)</li>
+ <li><tt>cd llvm/projects</tt>
+ <li><tt>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk
+ compiler-rt</tt></li>
+ </ul>
+ </li>
+ <li>Build LLVM and Clang:
<ul>
<li><tt>cd ../..</tt> (back to where you started)</li>
<li><tt>mkdir build</tt> (for building without polluting the source dir)
@@ -66,15 +76,15 @@ follows:</p>
<li>This builds both LLVM and Clang for debug mode.</li>
<li>Note: For subsequent Clang development, you can just do make at the
clang directory level.</li>
+ <li>It is also possible to use CMake instead of the makefiles. With CMake
+ it is also possible to generate project files for several IDEs: Eclipse
+ CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3.</li>
</ul>
-
- <p>It is also possible to use CMake instead of the makefiles. With CMake it
- is also possible to generate project files for several IDEs: Eclipse CDT4,
- CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3.</p>
+ </li>
<li>If you intend to work on Clang C++ support, you may need to tell it how
to find your C++ standard library headers. If Clang cannot find your
- system libstdc++ headers, please follow these instructions:</li>
+ system libstdc++ headers, please follow these instructions:
<ul>
<li>'<tt>gcc -v -x c++ /dev/null -fsyntax-only</tt>' to get the
path.</li>
@@ -82,7 +92,8 @@ follows:</p>
hard-coded paths" in <tt>clang/lib/Frontend/InitHeaderSearch.cpp</tt> and
change the lines below to include that path.</li>
</ul>
- <li>Try it out (assuming you add llvm/Debug+Asserts/bin to your path):</li>
+ </li>
+ <li>Try it out (assuming you add llvm/Debug+Asserts/bin to your path):
<ul>
<li><tt>clang --help</tt></li>
<li><tt>clang file.c -fsyntax-only</tt> (check for correctness)</li>
@@ -90,6 +101,7 @@ follows:</p>
<li><tt>clang file.c -S -emit-llvm -o - -O3</tt></li>
<li><tt>clang file.c -S -O3 -o -</tt> (output native machine code)</li>
</ul>
+ </li>
</ol>
<p>Note that the C front-end uses LLVM, but does not depend on llvm-gcc. If you
@@ -116,7 +128,7 @@ to subversion. </p>
Visual Studio:</p>
<ol>
- <li>Get the required tools:</li>
+ <li>Get the required tools:
<ul>
<li><b>Subversion</b>. Source code control program. Get it from:
<a href="http://subversion.tigris.org/getting.html">
@@ -125,7 +137,7 @@ Visual Studio:</p>
project files. Get it from:
<a href="http://www.cmake.org/cmake/resources/software.html">
http://www.cmake.org/cmake/resources/software.html</a></li>
- <li><b>Visual Studio 2005, 2008, or 2010</b></li>
+ <li><b>Visual Studio 2008 or 2010</b></li>
<li><b>Python</b>. This is needed only if you will be running the tests
(which is essential, if you will be developing for clang).
Get it from:
@@ -139,23 +151,25 @@ Visual Studio:</p>
Get them from <a href="http://getgnuwin32.sourceforge.net/">
http://getgnuwin32.sourceforge.net/</a>.</li>
</ul>
+ </li>
- <li>Checkout LLVM:</li>
+ <li>Checkout LLVM:
<ul>
<li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
</ul>
- <li>Checkout Clang:</li>
+ </li>
+ <li>Checkout Clang:
<ul>
<li><tt>cd llvm\tools</tt>
<li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
</ul>
- <li>Run cmake to generate the Visual Studio solution and project files:</li>
+ </li>
+ <li>Run cmake to generate the Visual Studio solution and project files:
<ul>
<li><tt>cd ..\..</tt> (back to where you started)</li>
<li><tt>mkdir build</tt> (for building without polluting the source dir)</li>
<li><tt>cd build</tt></li>
- <li>If you are using Visual Studio 2005: <tt>cmake -G "Visual Studio 8 2005" ..\llvm</tt></li>
- <li>Or if you are using Visual Studio 2008: <tt>cmake -G "Visual Studio 9 2008" ..\llvm</tt></li>
+ <li>If you are using Visual Studio 2008: <tt>cmake -G "Visual Studio 9 2008" ..\llvm</tt></li>
<li>Or if you are using Visual Studio 2010: <tt>cmake -G "Visual Studio 10" ..\llvm</tt></li>
<li>By default, cmake will target LLVM to X86. If you want all targets
(needed if you want to run the LLVM tests), add the <tt>-DLLVM_TARGETS_TO_BUILD=all</tt> option to the
@@ -163,16 +177,17 @@ Visual Studio:</p>
definition in CMakeLists.txt.</li>
<li>See the <a href="http://www.llvm.org/docs/CMake.html">LLVM CMake guide</a> for
more information on other configuration options for cmake.</li>
-</li>
<li>The above, if successful, will have created an LLVM.sln file in the
<tt>build</tt> directory.
</ul>
- <li>Build Clang:</li>
+ </li>
+ <li>Build Clang:
<ul>
<li>Open LLVM.sln in Visual Studio.</li>
<li>Build the "clang" project for just the compiler driver and front end, or
the "ALL_BUILD" project to build everything, including tools.</li>
</ul>
+ </li>
<li>Try it out (assuming you added llvm/debug/bin to your path). (See the
running examples from above.)</li>
<li>See <a href="hacking.html#testingWindows">
@@ -184,7 +199,7 @@ Visual Studio:</p>
to the latest code base, use the <tt>svn update</tt> command in both the
llvm and llvm\tools\clang directories, as they are separate repositories.</p>
-<a name="driver"><h2>Clang Compiler Driver (Drop-in Substitute for GCC)</h2></a>
+<h2 id="driver">Clang Compiler Driver (Drop-in Substitute for GCC)</h2>
<p>The <tt>clang</tt> tool is the compiler driver and front-end, which is
designed to be a drop-in replacement for the <tt>gcc</tt> command. Here are
@@ -243,9 +258,9 @@ $ <b>clang -fsyntax-only ~/t.c</b>
<pre class="code">
$ <b>clang -fsyntax-only ~/t.c -pedantic</b>
-/Users/sabre/t.c:2:17: warning: extension used
-typedef float V __attribute__((vector_size(16)));
- ^
+/Users/sabre/t.c:2:17: <span style="color:magenta">warning:</span> extension used
+<span style="color:darkgreen">typedef float V __attribute__((vector_size(16)));</span>
+<span style="color:blue"> ^</span>
1 diagnostic generated.
</pre>
diff --git a/www/hacking.html b/www/hacking.html
index b65768c9873a..2c11ce1896d2 100644
--- a/www/hacking.html
+++ b/www/hacking.html
@@ -3,10 +3,13 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hacking on clang</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
+ <style type="text/css">
+ pre { margin-left: 1.5em; }
+ </style>
</head>
<body>
<!--#include virtual="menu.html.incl"-->
@@ -22,18 +25,19 @@
<li><a href="#style">Coding Standards</a></li>
<li><a href="#docs">Developer Documentation</a></li>
<li><a href="#debugging">Debugging</a></li>
- <li><a href="#testing">Testing</a></li>
+ <li><a href="#testing">Testing</a>
<ul>
<li><a href="#testingNonWindows">Testing on Unix-like Systems</a></li>
<li><a href="#testingWindows">Testing using Visual Studio on Windows</a></li>
<li><a href="#testingCommands">Testing on the Command Line</a></li>
</ul>
+ </li>
<li><a href="#patches">Creating Patch Files</a></li>
<li><a href="#irgen">LLVM IR Generation</a></li>
</ul>
<!--=====================================================================-->
- <h2 id="docs">Coding Standards</h2>
+ <h2 id="style">Coding Standards</h2>
<!--=====================================================================-->
<p>Clang follows the
@@ -100,7 +104,7 @@
<li>Edit your local <tt>autoexp.dat</tt> (make sure you make a backup first!),
located in <tt>Visual Studio Directory\Common7\Packages\Debugger</tt> and append
the contents of <tt>clangVisuailzers.txt</tt> to it. This method should work for
- Visual Studio 2005 and above.
+ Visual Studio 2008 and above.
</li>
</ul>
@@ -139,7 +143,7 @@
<p>During the run of <tt>make test</tt>, the terminal output will
display a line similar to the following:</p>
- <ul><tt>--- Running clang tests for i686-pc-linux-gnu ---</tt></ul>
+ <pre>--- Running clang tests for i686-pc-linux-gnu ---</pre>
<p>followed by a line continually overwritten with the current test
file being compiled, and an overall completion percentage.</p>
@@ -150,12 +154,12 @@
<tt>Failing Tests (count):</tt> message will be followed by a list
of the test source file paths that failed. For example:</p>
- <tt><pre>
+ <pre>
Failing Tests (3):
/home/john/llvm/tools/clang/test/SemaCXX/member-name-lookup.cpp
/home/john/llvm/tools/clang/test/SemaCXX/namespace-alias.cpp
/home/john/llvm/tools/clang/test/SemaCXX/using-directive.cpp
- </pre></tt>
+</pre>
<p>If you used the <tt>make VERBOSE=1</tt> option, the terminal
output will reflect the error messages from the compiler and
@@ -210,42 +214,57 @@
<p>To run all the tests from the command line, execute a command like
the following:</p>
- <tt>
- python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
- (path to llvm)/llvm/tools/clang/test
- </tt>
+ <pre>
+ python (path to llvm)\llvm\utils\lit\lit.py -sv
+ --param=build_mode=Win32 --param=build_config=Debug
+ --param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg
+ (path to llvm)\llvm\tools\clang\test
+</pre>
<p>For CMake builds e.g. on Windows with Visual Studio, you will need
to specify your build configuration (Debug, Release, etc.) via
- <tt>--param=build_config=(build config)</tt>.</p>
+ <tt>--param=build_config=(build config)</tt>. You may also need to specify
+ the build mode (Win32, etc) via <tt>--param=build_mode=(build mode)</tt>.</p>
+
+ <p>Additionally, you will need to specify the lit site configuration which
+ lives in (build dir)\tools\clang\test, via
+ <tt>--param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg</tt>.
+ </p>
<p>To run a single test:</p>
- <tt>
- python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
- (path to llvm)/llvm/tools/clang/test/(dir)/(test)
- </tt>
+ <pre>
+ python (path to llvm)\llvm\utils\lit\lit.py -sv
+ --param=build_mode=Win32 --param=build_config=Debug
+ --param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg
+ (path to llvm)\llvm\tools\clang\test\(dir)\(test)
+</pre>
<p>For example:</p>
- <tt>
- python C:/Tools/llvm/utils/lit/lit.py -sv --no-progress-bar
- C:/Tools/llvm/tools/clang/test/Sema/wchar.c
- </tt>
+ <pre>
+ python C:\Tool\llvm\utils\lit\lit.py -sv
+ --param=build_mode=Win32 --param=build_config=Debug
+ --param=clang_site_config=c:\Tools\build\tools\clang\test\lit.site.cfg
+ C:\Tools\llvm\tools\clang\test\Sema\wchar.c
+</pre>
<p>The -sv option above tells the runner to show the test output if
any tests failed, to help you determine the cause of failure.</p>
+ <p>You can also pass in the --no-progress-bar option if you wish to disable
+ progress indications while the tests are running.</p>
+
<p>Your output might look something like this:</p>
-<tt><pre>lit.py: lit.cfg:152: note: using clang: 'C:/Tools/llvm/bin/Release\\clang.EXE'
+ <pre>lit.py: lit.cfg:152: note: using clang: 'C:\Tools\llvm\bin\Release\clang.EXE'
-- Testing: Testing: 2534 tests, 4 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 81.52s
Expected Passes : 2503
Expected Failures : 28
Unsupported Tests : 3
-</pre></tt>
+</pre>
<p>The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.</p>
@@ -255,24 +274,23 @@ Testing Time: 81.52s
<p>To return changes to the Clang team, unless you have checkin
privileges, the preferred way is to send patch files to the
- cfe-commits mailing list, with an explanation of what the patch is for.
- Or, if you have questions, or want to have a wider discussion of what
- you are doing, such as if you are new to Clang development, you can use
- the cfe-dev mailing list also.
- </p>
+ cfe-commits mailing list, with an explanation of what the patch is
+ for. If your patch requires a wider discussion (for example,
+ because it is an architectural change), you can use the cfe-dev
+ mailing list. </p>
<p>To create these patch files, change directory
to the llvm/tools/clang root and run:</p>
- <ul><tt>svn diff (relative path) >(patch file name)</tt></ul>
+ <pre>svn diff (relative path) >(patch file name)</pre>
<p>For example, for getting the diffs of all of clang:</p>
- <ul><tt>svn diff . >~/mypatchfile.patch</tt></ul>
+ <pre>svn diff . >~/mypatchfile.patch</pre>
<p>For example, for getting the diffs of a single file:</p>
- <ul><tt>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</tt></ul>
+ <pre>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</pre>
<p>Note that the paths embedded in the patch depend on where you run it,
so changing directory to the llvm/tools/clang directory is recommended.</p>
diff --git a/www/index.html b/www/index.html
index 095eed790df8..6455262a461a 100644
--- a/www/index.html
+++ b/www/index.html
@@ -94,7 +94,7 @@
targeting X86-32, X86-64, and ARM (other targets may have caveats, but are
usually easy to fix). If you are looking for source analysis or
source-to-source transformation tools, clang is probably a great
- solution for you. Clang does not support C++'11 yet, please see the <a
+ solution for you. Clang supports most of C++11, please see the <a
href="cxx_status.html">C++ status</a> page for more
information.</p>
diff --git a/www/performance-2008-10-31.html b/www/performance-2008-10-31.html
index 5246ac30b857..b2876670d3b1 100644
--- a/www/performance-2008-10-31.html
+++ b/www/performance-2008-10-31.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Performance</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
@@ -20,7 +20,7 @@
<!--*************************************************************************-->
<p>This page tracks the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
<ul>
<li><i>Sketch</i>: The Objective-C example application shipped on
Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@ interesting benchmarks:
dependencies. This stresses the back-end's performance on generating
assembly code and debug information.</li>
</ul>
-</p>
<!--*************************************************************************-->
<h2><a name="enduser">Experiments</a></h2>
@@ -46,7 +45,7 @@ interesting benchmarks:
<p>Measurements are done by serially processing each file in the
respective benchmark, using Clang, gcc, and llvm-gcc as compilers. In
order to track the performance of various subsystems the timings have
-been broken down into separate stages where possible:
+been broken down into separate stages where possible:</p>
<ul>
<li><tt>-Eonly</tt>: This option runs the preprocessor but does not
@@ -65,7 +64,6 @@ been broken down into separate stages where possible:
<li><tt>-S -O0 -g</tt>: This adds emission of debug information to
the assembly output.</li>
</ul>
-</p>
<p>This set of stages is chosen to be approximately additive, that is
each subsequent stage simply adds some additional processing. The
@@ -94,9 +92,9 @@ compile time here.</p>
<h3><a name="2008-10-31">2008-10-31</a></h3>
<!--=======================================================================-->
-<center><h4>Sketch</h4></center>
+<h4 style="text-align:center">Sketch</h4>
<img class="img_slide"
- src="timing-data/2008-10-31/sketch.png" alt="Sketch Timings"/>
+ src="timing-data/2008-10-31/sketch.png" alt="Sketch Timings">
<p>This shows Clang's substantial performance improvements in
preprocessing and semantic analysis; over 90% faster on
@@ -112,9 +110,9 @@ with PCH; about 4x in wall time. Unfortunately, Clang does not yet
have an implementation of PCH-style optimizations, but we are actively
working to address this.</p>
-<center><h4>176.gcc</h4></center>
+<h4 style="text-align:center">176.gcc</h4>
<img class="img_slide"
- src="timing-data/2008-10-31/176.gcc.png" alt="176.gcc Timings"/>
+ src="timing-data/2008-10-31/176.gcc.png" alt="176.gcc Timings">
<p>Unlike the <i>Sketch</i> timings, compilation of <i>176.gcc</i>
involves a large amount of code generation. The time spent in Clang's
diff --git a/www/performance-2009-03-02.html b/www/performance-2009-03-02.html
index f76fc7a0094d..3e8c41110536 100644
--- a/www/performance-2009-03-02.html
+++ b/www/performance-2009-03-02.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Performance</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
@@ -20,7 +20,7 @@
<!--*************************************************************************-->
<p>This page shows the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
<ul>
<li><i>Sketch</i>: The Objective-C example application shipped on
Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@ interesting benchmarks:
dependencies. This stresses the back-end's performance on generating
assembly code and debug information.</li>
</ul>
-</p>
<p>
For previous performance numbers, please
@@ -57,7 +56,7 @@ in order to evaluate the overhead of the driver itself.</p>
have been broken down into separate stages where possible. This is
done by over-riding the CC environment variable used during the build
to point to one of a few simple shell scripts which may skip part of
-the build.
+the build.</p>
<ul>
<li><tt>non-compiler</tt>: The overhead of the build system itself;
@@ -78,7 +77,6 @@ the build.
<li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
<li><tt>+ linker</tt>: Add linker time.</li>
</ul>
-</p>
<p>This set of stages is chosen to be approximately additive, that is
each subsequent stage simply adds some additional processing. The
@@ -99,12 +97,12 @@ analysis (and preprocessing/parsing, in the case of gcc).</p>
<a href="timing-data/2009-03-02/sketch.pdf">
<img class="img_slide"
- src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings"/>
+ src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings">
</a>
<a href="timing-data/2009-03-02/176.gcc.pdf">
<img class="img_slide"
- src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings"/>
+ src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings">
</a>
</div>
diff --git a/www/performance.html b/www/performance.html
index 2bb8fe272f2d..e85f19185544 100644
--- a/www/performance.html
+++ b/www/performance.html
@@ -2,10 +2,10 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang - Performance</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
</style>
</head>
@@ -20,7 +20,7 @@
<!--*************************************************************************-->
<p>This page shows the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
<ul>
<li><i>Sketch</i>: The Objective-C example application shipped on
Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@ interesting benchmarks:
dependencies. This stresses the back-end's performance on generating
assembly code and debug information.</li>
</ul>
-</p>
<p>
For previous performance numbers, please
@@ -56,7 +55,7 @@ compilers.</p>
have been broken down into separate stages where possible. This is
done by over-riding the CC environment variable used during the build
to point to one of a few simple shell scripts which may skip part of
-the build.
+the build.</p>
<ul>
<li><tt>non-compiler</tt>: The overhead of the build system itself;
@@ -73,7 +72,6 @@ the build.
<li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
<li><tt>+ linker</tt>: Add linker time.</li>
</ul>
-</p>
<p>This set of stages is chosen to be approximately additive, that is each
subsequent stage simply adds some additional processing. The timings measure the
@@ -93,12 +91,12 @@ semantic analysis after PCH generation is done.</p>
<a href="timing-data/2009-06-26/sketch.pdf">
<img class="img_slide"
- src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings"/>
+ src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings">
</a>
<a href="timing-data/2009-06-26/176.gcc.pdf">
<img class="img_slide"
- src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings"/>
+ src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings">
</a>
</div>
diff --git a/www/related.html b/www/related.html
index 9fcd390d2399..a1ff79b67de2 100644
--- a/www/related.html
+++ b/www/related.html
@@ -3,10 +3,10 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clang Related Projects</title>
- <link type="text/css" rel="stylesheet" href="menu.css" />
- <link type="text/css" rel="stylesheet" href="content.css" />
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
</head>
<body>
<!--#include virtual="menu.html.incl"-->