summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
commitbca07a4524feb4edec581062d631a13116320a24 (patch)
treea9243275843fbeaa590afc07ee888e006b8d54ea /www
parent998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff)
Notes
Diffstat (limited to 'www')
-rw-r--r--www/OpenProjects.html41
-rw-r--r--www/analyzer/annotations.html155
-rw-r--r--www/analyzer/filing_bugs.html2
-rw-r--r--www/analyzer/index.html8
-rw-r--r--www/analyzer/installation.html2
-rw-r--r--www/analyzer/latest_checker.html.incl2
-rw-r--r--www/analyzer/release_notes.html48
-rw-r--r--www/analyzer/xcode.html14
-rwxr-xr-xwww/builtins.py160
-rw-r--r--www/compatibility.html350
-rw-r--r--www/cxx_status.html505
-rw-r--r--www/favicon.icobin0 -> 1150 bytes
-rw-r--r--www/features.html2
-rw-r--r--www/get_started.html29
-rw-r--r--www/hacking.html34
-rw-r--r--www/index.html9
-rw-r--r--www/menu.html.incl3
-rw-r--r--www/related.html55
-rw-r--r--www/robots.txt2
19 files changed, 1212 insertions, 209 deletions
diff --git a/www/OpenProjects.html b/www/OpenProjects.html
index 46d9716c78561..52fcabebbaa46 100644
--- a/www/OpenProjects.html
+++ b/www/OpenProjects.html
@@ -21,11 +21,6 @@ intended to be comprehensive. Please ask on cfe-dev for more specifics or to
verify that one of these isn't already completed. :)</p>
<ul>
-<li><b>Compile your favorite C/ObjC project with Clang</b>:
-Clang's type-checking and code generation is very close to complete (but not bug free!) for C and Objective-C. We appreciate all reports of code that is
-rejected or miscompiled by the front-end. If you notice invalid code that is not rejected, or poor diagnostics when code is rejected, that is also very important to us. For make-based projects,
-the <a href="get_started.html#driver"><code>clang</code></a> driver works as a drop-in replacement for GCC.</li>
-
<li><b>Undefined behavior checking</b>: CodeGen could
insert runtime checks for all sorts of different undefined behaviors, from
reading uninitialized variables, buffer overflows, and many other things. This
@@ -50,11 +45,17 @@ rich understanding of the code.</li>
<li><b>Use clang libraries to implement better versions of existing tools</b>:
Clang is built as a set of libraries, which means that it is possible to
implement capabilities similar to other source language tools, improving them
-in various ways. Two examples are <a href="http://distcc.samba.org/">distcc</a>
-and the <a href="http://delta.tigris.org/">delta testcase reduction tool</a>.
-The former can be improved to scale better and be more efficient. The latter
-could also be faster and more efficient at reducing C-family programs if built
-on the clang preprocessor.</li>
+in various ways. Three examples are <a
+href="http://distcc.samba.org/">distcc</a>, the <a
+href="http://delta.tigris.org/">delta testcase reduction tool</a>, and the
+"indent" source reformatting tool.
+distcc can be improved to scale better and be more efficient. Delta could be
+faster and more efficient at reducing C-family programs if built on the clang
+preprocessor, indent could do proper formatting for complex C++ features, and it
+would be straight-forward to extend a clang-based implementation to handle
+simple structural rules like those in <a
+href="http://llvm.org/docs/CodingStandards.html#hl_earlyexit">the LLVM coding
+standards</a>.</li>
<li><b>Use clang libraries to extend Ragel with a JIT</b>: <a
href="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state
@@ -77,26 +78,17 @@ improve the quality of clang by self-testing. Some examples:
</ul>
</li>
-<li><b>Continue work on C++ support</b>: Implementing all of C++ is a very big
-job, but there are lots of little pieces that can be picked off and implemented. Here are some small- to mid-sized C++ implementation projects:
-<ul>
- <li>Fix bugs: there are a number of XFAIL'd test cases in Clang's repository (particularly in the CXX subdirectory). Pick a test case and fix Clang to make it work!</li>
- <li>Write tests: the CXX test subdirectory in Clang's repository has placeholders for tests of every paragraph in the C++ standard. Pick a paragraph, write a few tests, and see if they work! Even if they don't we'd still like the new tests (with XFAIL'd) so that we know what to fix.</li>
- <li>Parsing and semantic analysis for using declarations in classes</li>
- <li>Inherited conversion functions</li>
- <li>Improved diagnostics for overloading failures and ambiguities</li>
- <li>Improved template error messages, e.g., with more informative backtraces</li>
-</ul>
-
-Also, see the <a href="cxx_status.html">C++ status report page</a> to
-find out what is missing and what is already at least partially
-supported.</li>
+<li><b>Continue work on C++'0x support</b>:
+ C++'98 is feature complete, but there is still a lot of C++'0x featuers to
+ implement. Please see the <a href="cxx_status.html">C++ status report
+ page</a> to find out what is missing.</li>
</ul>
<p>If you hit a bug with clang, it is very useful for us if you reduce the code
that demonstrates the problem down to something small. There are many ways to
do this; ask on cfe-dev for advice.</p>
+<ul>
<li><b>StringRef'ize APIs</b>: A thankless but incredibly useful project is
StringRef'izing (converting to use <tt>llvm::StringRef</tt> instead of <tt>const
char *</tt> or <tt>std::string</tt>) various clang interfaces. This generally
@@ -108,6 +100,7 @@ experience -- it should be easy to cross compile applications, install support
for new architectures, access different compilers and tools, and be consistent
across different platforms. See the <a href="UniversalDriver.html">Universal
Driver</a> web page for more information.</li>
+</ul>
</div>
</body>
diff --git a/www/analyzer/annotations.html b/www/analyzer/annotations.html
index 5184aeddfef49..b33b4bfcdde93 100644
--- a/www/analyzer/annotations.html
+++ b/www/analyzer/annotations.html
@@ -6,7 +6,6 @@
<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>
- <script type="text/javascript" src="scripts/dbtree.js"></script>
</head>
<body>
@@ -38,7 +37,7 @@ recognized by GCC. Their use can be conditioned using preprocessor macros
<h4>Specific Topics</h4>
-<ul id="collapsetree" class="dbtree onclick multiple">
+<ul>
<li><a href="#generic">Annotations to Enhance Generic Checks</a>
<ul>
<li><a href="#null_checking"><span>Null Pointer Checking</span></a>
@@ -56,6 +55,9 @@ recognized by GCC. Their use can be conditioned using preprocessor macros
<li><a href="#attr_ns_returns_not_retained">Attribute 'ns_returns_not_retained'</a></li>
<li><a href="#attr_cf_returns_retained">Attribute 'cf_returns_retained'</a></li>
<li><a href="#attr_cf_returns_not_retained">Attribute 'cf_returns_not_retained'</a></li>
+ <li><a href="#attr_ns_consumed">Attribute 'ns_consumed'</a></li>
+ <li><a href="#attr_cf_consumed">Attribute 'cf_consumed'</a></li>
+ <li><a href="#attr_ns_consumes_self">Attribute 'ns_consumes_self'</a></li>
</ul>
</li>
</ul>
@@ -294,15 +296,15 @@ CFDateRef returnsRetainedCFDate() {
@implementation MyClass
- (NSDate*) returnsCFRetained {
- return (NSDate*) returnsRetainedCFDate(); // No leak.
+ return (NSDate*) returnsRetainedCFDate(); <b><i>// No leak.</i></b>
}
- (NSDate*) alsoReturnsRetained {
- return (NSDate*) returnsRetainedCFDate(); // Always report a leak.
+ return (NSDate*) returnsRetainedCFDate(); <b><i>// Always report a leak.</i></b>
}
- (NSDate*) returnsNSRetained {
- return (NSDate*) returnsRetainedCFDate(); // Report a leak when using GC.
+ return (NSDate*) returnsRetainedCFDate(); <b><i>// Report a leak when using GC.</i></b>
}
@end
</pre>
@@ -350,6 +352,147 @@ its availability, as it is not available in earlier versions of the analyzer:</p
#endif
</pre>
+<h4 id="attr_ns_consumed">Attribute 'ns_consumed'
+(Clang-specific)</h4>
+
+<p>The 'ns_consumed' attribute can be placed on a specific parameter in either the declaration of a function or an Objective-C method.
+ It indicates to the static analyzer that a <tt>release</tt> message is implicitly sent to the parameter upon
+ completion of the call to the given function or method.
+
+<p><b>Important note when using Garbage Collection</b>: Note that the analyzer
+essentially ignores this attribute when code is compiled to use Objective-C
+garbage collection. This is because the <tt>release</tt> message does nothing
+when using GC. If the underlying function/method uses something like
+<tt>CFRelease</tt> to decrement the reference count, consider using
+the <a href="#attr_cf_consumed">cf_consumed</a> attribute instead.</p>
+
+<p><b>Example</b></p>
+
+<pre class="code_example">
+<span class="command">$ cat test.m</span>
+#ifndef __has_feature // Optional.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+#ifndef NS_CONSUMED
+#if __has_feature(attribute_ns_consumed)
+<span class="code_highlight">#define NS_CONSUMED __attribute__((ns_consumed))</span>
+#else
+#define NS_CONSUMED
+#endif
+#endif
+
+void consume_ns(id <span class="code_highlight">NS_CONSUMED</span> x);
+
+void test() {
+ id x = [[NSObject alloc] init];
+ consume_ns(x); <b><i>// No leak!</i></b>
+}
+
+@interface Foo : NSObject
++ (void) releaseArg:(id) <span class="code_highlight">NS_CONSUMED</span> x;
++ (void) releaseSecondArg:(id)x second:(id) <span class="code_highlight">NS_CONSUMED</span> y;
+@end
+
+void test_method() {
+ id x = [[NSObject alloc] init];
+ [Foo releaseArg:x]; <b><i>// No leak!</i></b>
+}
+
+void test_method2() {
+ id a = [[NSObject alloc] init];
+ id b = [[NSObject alloc] init];
+ [Foo releaseSecondArg:a second:b]; <b><i>// 'a' is leaked, but 'b' is released.</i></b>
+}
+</pre>
+
+<h4 id="attr_cf_consumed">Attribute 'cf_consumed'
+(Clang-specific)</h4>
+
+<p>The 'cf_consumed' attribute is practically identical to <a href="#attr_ns_consumed">ns_consumed</a>.
+The attribute can be placed on a specific parameter in either the declaration of a function or an Objective-C method.
+It indicates to the static analyzer that the object reference is implicitly passed to a call to <tt>CFRelease</tt> upon
+completion of the call to the given function or method.</p>
+
+<p>Operationally this attribute is nearly identical to ns_consumed
+with the main difference that the reference count decrement still occurs when using Objective-C garbage
+collection (which is import for Core Foundation types, which are not automatically garbage collected).</p>
+
+<p><b>Example</b></p>
+
+<pre class="code_example">
+<span class="command">$ cat test.m</span>
+#ifndef __has_feature // Optional.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+#ifndef CF_CONSUMED
+#if __has_feature(attribute_cf_consumed)
+<span class="code_highlight">#define CF_CONSUMED __attribute__((cf_consumed))</span>
+#else
+#define CF_CONSUMED
+#endif
+#endif
+
+void consume_cf(id <span class="code_highlight">CF_CONSUMED</span> x);
+void consume_CFDate(CFDateRef <span class="code_highlight">CF_CONSUMED</span> x);
+
+void test() {
+ id x = [[NSObject alloc] init];
+ consume_cf(x); <b><i>// No leak!</i></b>
+}
+
+void test2() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent());
+ consume_CFDate(date); <b><i>// No leak, including under GC!</i></b>
+
+}
+
+@interface Foo : NSObject
++ (void) releaseArg:(CFDateRef) <span class="code_highlight">CF_CONSUMED</span> x;
+@end
+
+void test_method() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent());
+ [Foo releaseArg:date]; <b><i>// No leak!</i></b>
+}
+</pre>
+
+<h4 id="attr_ns_consumes_self">Attribute 'ns_consumes_self'
+(Clang-specific)</h4>
+
+<p>The 'ns_consumes_self' attribute can be placed only on an Objective-C method declaration.
+ It indicates that the receiver of the message is &quot;consumed&quot; (a single reference count decremented)
+ after the message is sent. This matches the semantics of all &quot;init&quot; methods.
+</p>
+
+<p>One use of this attribute is declare your own init-like methods that do not follow the
+ standard Cocoa naming conventions.</p>
+
+<p><b>Example</b></p>
+
+<pre class="code_example">
+#ifndef __has_feature
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+#ifndef NS_CONSUMES_SELF
+#if __has_feature((attribute_ns_consumes_self))
+<span class="code_highlight">#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))</span>
+#else
+#define NS_CONSUMES_SELF
+#endif
+#endif
+
+@interface MyClass : NSObject
+- initWith:(MyClass *)x;
+- nonstandardInitWith:(MyClass *)x <span class="code_highlight">NS_CONSUMES_SELF</span> NS_RETURNS_RETAINED;
+@end
+</pre>
+
+<p>In this example, <tt>nonstandardInitWith:</tt> has the same ownership semantics as the init method <tt>initWith:</tt>.
+ The static analyzer will observe that the method consumes the receiver, and then returns an object with a +1 retain count.</p>
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<h2 id="custom_assertions">Custom Assertion Handlers</h2>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -442,7 +585,7 @@ the use of preprocessor macros.</p>
<pre class="code_example">
#ifndef CLANG_ANALYZER_NORETURN
-#if __clang__
+#if __has_feature(attribute_analyzer_noreturn)
<span class="code_highlight">#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))</span>
#else
#define CLANG_ANALYZER_NORETURN
diff --git a/www/analyzer/filing_bugs.html b/www/analyzer/filing_bugs.html
index 746f1cb22eda4..460ef815c39c0 100644
--- a/www/analyzer/filing_bugs.html
+++ b/www/analyzer/filing_bugs.html
@@ -54,7 +54,7 @@ the analyzer has access to that bug database.</p>
<h2>Apple-internal Users</h2>
-<p>Please file bugs in Radar against the <b>llvm - checker</b> component.</p>
+<p>Please file bugs in Radar against the <b>clang - static analyzer</b> component.</p>
</div>
</div>
</body>
diff --git a/www/analyzer/index.html b/www/analyzer/index.html
index 082d35fdc488f..7d99ac9621e48 100644
--- a/www/analyzer/index.html
+++ b/www/analyzer/index.html
@@ -98,12 +98,12 @@ applications.</p>
<div style="padding:15px">
<h3 style="margin:0px;padding:0px">Mac OS X</h3>
<ul>
- <li>Latest build (Universal binary, 10.5+):<br>
+ <li>Latest build (Intel-only binary, 10.5+):<br>
<!--#include virtual="latest_checker.html.incl"-->
</li>
- <li>Can be used both from the command line and within Xcode</li>
- <li><a href="/installation.html">Installation</a> and <a
- href="/scan-build.html">usage</a></li>
+ <li><a href="/release_notes.html">Release notes</a></li></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>
</div>
</div>
diff --git a/www/analyzer/installation.html b/www/analyzer/installation.html
index 9eaacd72d7e32..b0e56f82c420f 100644
--- a/www/analyzer/installation.html
+++ b/www/analyzer/installation.html
@@ -91,7 +91,7 @@ source code</a>.<p>
<li>The location of the <tt>clang</tt> binary.
<p>For example, if you built a <em>Debug+Asserts</em> build of LLVM/Clang (the
-default), the resultant <tt>clang</tt> binary will be in $(OBJDIR)/Debug+Asserts
+default), the resultant <tt>clang</tt> binary will be in <tt>$(OBJDIR)/Debug+Asserts/bin</tt>
(where <tt>$(OBJDIR)</tt> is often the same as the root source directory). You
can also do <tt>make install</tt> to install the LLVM/Clang libaries and
binaries to the installation directory of your choice (specified when you run
diff --git a/www/analyzer/latest_checker.html.incl b/www/analyzer/latest_checker.html.incl
index 76e569d92acae..7cd6b2bff5dee 100644
--- a/www/analyzer/latest_checker.html.incl
+++ b/www/analyzer/latest_checker.html.incl
@@ -1 +1 @@
-<b><a href="/checker/checker-247.tar.bz2">checker-247.tar.bz2</a></b> (built July 30, 2010)
+<b><a href="/checker/checker-255.tar.bz2">checker-255.tar.bz2</a></b> (built February 11, 2011)
diff --git a/www/analyzer/release_notes.html b/www/analyzer/release_notes.html
new file mode 100644
index 0000000000000..7b6924fa344d3
--- /dev/null
+++ b/www/analyzer/release_notes.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<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" />
+ <script type="text/javascript" src="scripts/menu.js"></script>
+</head>
+<body>
+
+<div id="page">
+<!--#include virtual="menu.html.incl"-->
+<div id="content">
+
+<h1>Release notes for <tt>checker-XXX</tt> builds</h1>
+
+<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>highlights:</b></p>
+
+<ul>
+<li>Mac OS X builds are now Intel <tt>i386</tt> and <tt>x86_64</tt> only (no <tt>ppc</tt> support)</li>
+<li>Turns on new <tt>-init</tt> method checker by default</li>
+<li>Reduces memory usage of analyzer by 10%</li>
+<li>Misc. fixes to reduce false positives on dead stores and idempotent operations.</li>
+</ul>
+
+<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>highlights:</b></p>
+
+<ul>
+<li>Introduces new <tt>-init</tt> method checker to check if a super class's init method is properly called.</li>
+<li>Objective-C retain/release checker now reasons about calls to property accessor methods (setter/getter).</li>
+<li>Introduces new attribute <a href="annotations.html#attr_ns_consumes_self">ns_consumes_self</a> to educate the Objective-C retain/release checker about custom &quot;init-like&quot; methods that do not follow the standard Cocoa naming conventions.</li>
+<li>Introduces new attributes <a href="annotations.html#attr_ns_consumed">ns_consumed</a> and <a href="annotations.html#attr_cf_consumed">cf_consumed</a> to educate the Objective-C retain/release checker about methods/functions that decrement the reference count of a parameter.</li>
+</ul>
+
+</div>
+</div>
+</body>
+</html>
+
diff --git a/www/analyzer/xcode.html b/www/analyzer/xcode.html
index 474156e574f9d..51c5a56163870 100644
--- a/www/analyzer/xcode.html
+++ b/www/analyzer/xcode.html
@@ -102,6 +102,14 @@ specify for static analysis. Within this model it provides you two basic modes:
<li><b>--use-checker-build</b>: Switch Xcode to using the <tt>clang</tt> provided by the specified analyzer build.</li>
</ul>
+<h4>Things to keep in mind</h4>
+
+<ul>
+<li>You should quit Xcode prior to running <tt>set-xcode-analyzer</tt>.</li>
+<li>You will need to run <tt>set-xcode-analyzer</tt> under <b><tt>sudo</tt></b>
+ in order to have write privileges to modify the Xcode configuration files.</li>
+</ul>
+
<h4>Examples</h4>
<p><b>Example 1</b>: Telling Xcode to use checker-235 for <i>Build and Analyze</i>:</p>
@@ -110,7 +118,7 @@ specify for static analysis. Within this model it provides you two basic modes:
$ pwd
/tmp
$ tar xjf checker-235.tar.bz2
-$ checker-235/set-xcode-analyzer --use-checker-build=/tmp/checker-235
+$ sudo checker-235/set-xcode-analyzer --use-checker-build=/tmp/checker-235
</pre>
<p>Note that you typically won't install an analyzer build in <tt>/tmp</tt>, but
@@ -120,13 +128,13 @@ path to an untarred analyzer build.</p>
<p><b>Example 2</b>: Telling Xcode to use a very specific version of <tt>clang</tt>:</p>
<pre class="code_example">
-$ set-xcode-analyzer --use-checker-build=~/mycrazyclangbuild/bin/clang
+$ sudo set-xcode-analyzer --use-checker-build=~/mycrazyclangbuild/bin/clang
</pre>
<p><b>Example 3</b>: Resetting Xcode to its default behavior:</p>
<pre class="code_example">
-$ set-xcode-analyzer --use-xcode-clang
+$ sudo set-xcode-analyzer --use-xcode-clang
</pre>
</div>
diff --git a/www/builtins.py b/www/builtins.py
new file mode 100755
index 0000000000000..5e8577054f0c2
--- /dev/null
+++ b/www/builtins.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python
+
+import sys, fileinput
+
+err=0
+
+# Giant associative set of builtin->intrinsic mappings where clang doesn't
+# implement the builtin since the vector operation works by default.
+
+repl_map = {
+'__builtin_ia32_addps': '_mm_add_ps',
+'__builtin_ia32_addsd': '_mm_add_sd',
+'__builtin_ia32_addpd': '_mm_add_pd',
+'__builtin_ia32_addss': '_mm_add_ss',
+'__builtin_ia32_paddb128': '_mm_add_epi8',
+'__builtin_ia32_paddw128': '_mm_add_epi16',
+'__builtin_ia32_paddd128': '_mm_add_epi32',
+'__builtin_ia32_paddq128': '_mm_add_epi64',
+'__builtin_ia32_subps': '_mm_sub_ps',
+'__builtin_ia32_subsd': '_mm_sub_sd',
+'__builtin_ia32_subpd': '_mm_sub_pd',
+'__builtin_ia32_subss': '_mm_sub_ss',
+'__builtin_ia32_psubb128': '_mm_sub_epi8',
+'__builtin_ia32_psubw128': '_mm_sub_epi16',
+'__builtin_ia32_psubd128': '_mm_sub_epi32',
+'__builtin_ia32_psubq128': '_mm_sub_epi64',
+'__builtin_ia32_mulsd': '_mm_mul_sd',
+'__builtin_ia32_mulpd': '_mm_mul_pd',
+'__builtin_ia32_mulps': '_mm_mul_ps',
+'__builtin_ia32_mulss': '_mm_mul_ss',
+'__builtin_ia32_pmullw128': '_mm_mullo_epi16',
+'__builtin_ia32_divsd': '_mm_div_sd',
+'__builtin_ia32_divpd': '_mm_div_pd',
+'__builtin_ia32_divps': '_mm_div_ps',
+'__builtin_ia32_subss': '_mm_div_ss',
+'__builtin_ia32_andpd': '_mm_and_pd',
+'__builtin_ia32_andps': '_mm_and_ps',
+'__builtin_ia32_pand128': '_mm_and_si128',
+'__builtin_ia32_andnpd': '_mm_andnot_pd',
+'__builtin_ia32_andnps': '_mm_andnot_ps',
+'__builtin_ia32_pandn128': '_mm_andnot_si128',
+'__builtin_ia32_orpd': '_mm_or_pd',
+'__builtin_ia32_orps': '_mm_or_ps',
+'__builtin_ia32_por128': '_mm_or_si128',
+'__builtin_ia32_xorpd': '_mm_xor_pd',
+'__builtin_ia32_xorps': '_mm_xor_ps',
+'__builtin_ia32_pxor128': '_mm_xor_si128',
+'__builtin_ia32_cvtsd2ss': '_mm_cvtsd_ss',
+'__builtin_ia32_cvtsi2sd': '_mm_cvtsi32_sd',
+'__builtin_ia32_cvtss2sd': '_mm_cvtss_sd',
+'__builtin_ia32_cvttsd2si': '_mm_cvttsd_si32',
+'__builtin_ia32_vec_ext_v2df': '_mm_cvtsd_f64',
+'__builtin_ia32_loadhpd': '_mm_loadh_pd',
+'__builtin_ia32_loadlpd': '_mm_loadl_pd',
+'__builtin_ia32_loadlv4si': '_mm_loadl_epi64',
+'__builtin_ia32_cmpeqps': '_mm_cmpeq_ps',
+'__builtin_ia32_cmpltps': '_mm_cmplt_ps',
+'__builtin_ia32_cmpleps': '_mm_cmple_ps',
+'__builtin_ia32_cmpgtps': '_mm_cmpgt_ps',
+'__builtin_ia32_cmpgeps': '_mm_cmpge_ps',
+'__builtin_ia32_cmpunordps': '_mm_cmpunord_ps',
+'__builtin_ia32_cmpneqps': '_mm_cmpneq_ps',
+'__builtin_ia32_cmpnltps': '_mm_cmpnlt_ps',
+'__builtin_ia32_cmpnleps': '_mm_cmpnle_ps',
+'__builtin_ia32_cmpngtps': '_mm_cmpngt_ps',
+'__builtin_ia32_cmpordps': '_mm_cmpord_ps',
+'__builtin_ia32_cmpeqss': '_mm_cmpeq_ss',
+'__builtin_ia32_cmpltss': '_mm_cmplt_ss',
+'__builtin_ia32_cmpless': '_mm_cmple_ss',
+'__builtin_ia32_cmpunordss': '_mm_cmpunord_ss',
+'__builtin_ia32_cmpneqss': '_mm_cmpneq_ss',
+'__builtin_ia32_cmpnltss': '_mm_cmpnlt_ss',
+'__builtin_ia32_cmpnless': '_mm_cmpnle_ss',
+'__builtin_ia32_cmpngtss': '_mm_cmpngt_ss',
+'__builtin_ia32_cmpngess': '_mm_cmpnge_ss',
+'__builtin_ia32_cmpordss': '_mm_cmpord_ss',
+'__builtin_ia32_movss': '_mm_move_ss',
+'__builtin_ia32_movsd': '_mm_move_sd',
+'__builtin_ia32_movhlps': '_mm_movehl_ps',
+'__builtin_ia32_movlhps': '_mm_movelh_ps',
+'__builtin_ia32_movqv4si': '_mm_move_epi64',
+'__builtin_ia32_unpckhps': '_mm_unpackhi_ps',
+'__builtin_ia32_unpckhpd': '_mm_unpackhi_pd',
+'__builtin_ia32_punpckhbw128': '_mm_unpackhi_epi8',
+'__builtin_ia32_punpckhwd128': '_mm_unpackhi_epi16',
+'__builtin_ia32_punpckhdq128': '_mm_unpackhi_epi32',
+'__builtin_ia32_punpckhqdq128': '_mm_unpackhi_epi64',
+'__builtin_ia32_unpcklps': '_mm_unpacklo_ps',
+'__builtin_ia32_unpcklpd': '_mm_unpacklo_pd',
+'__builtin_ia32_punpcklbw128': '_mm_unpacklo_epi8',
+'__builtin_ia32_punpcklwd128': '_mm_unpacklo_epi16',
+'__builtin_ia32_punpckldq128': '_mm_unpacklo_epi32',
+'__builtin_ia32_punpcklqdq128': '_mm_unpacklo_epi64',
+'__builtin_ia32_cmpeqpd': '_mm_cmpeq_pd',
+'__builtin_ia32_cmpltpd': '_mm_cmplt_pd',
+'__builtin_ia32_cmplepd': '_mm_cmple_pd',
+'__builtin_ia32_cmpgtpd': '_mm_cmpgt_pd',
+'__builtin_ia32_cmpgepd': '_mm_cmpge_pd',
+'__builtin_ia32_cmpunordpd': '_mm_cmpunord_pd',
+'__builtin_ia32_cmpneqpd': '_mm_cmpneq_pd',
+'__builtin_ia32_cmpnltpd': '_mm_cmpnlt_pd',
+'__builtin_ia32_cmpnlepd': '_mm_cmpnle_pd',
+'__builtin_ia32_cmpngtpd': '_mm_cmpngt_pd',
+'__builtin_ia32_cmpngepd': '_mm_cmpnge_pd',
+'__builtin_ia32_cmpordpd': '_mm_cmpord_pd',
+'__builtin_ia32_cmpeqsd': '_mm_cmpeq_sd',
+'__builtin_ia32_cmpltsd': '_mm_cmplt_sd',
+'__builtin_ia32_cmplesd': '_mm_cmple_sd',
+'__builtin_ia32_cmpunordsd': '_mm_cmpunord_sd',
+'__builtin_ia32_cmpneqsd': '_mm_cmpneq_sd',
+'__builtin_ia32_cmpnltsd': '_mm_cmpnlt_sd',
+'__builtin_ia32_cmpnlesd': '_mm_cmpnle_sd',
+'__builtin_ia32_cmpordsd': '_mm_cmpord_sd',
+'__builtin_ia32_cvtsi642ss': '_mm_cvtsi64_ss',
+'__builtin_ia32_cvttss2si64': '_mm_cvtss_si64',
+'__builtin_ia32_shufps': '_mm_shuffle_ps',
+'__builtin_ia32_shufpd': '_mm_shuffle_pd',
+'__builtin_ia32_pshufhw': '_mm_shufflehi_epi16',
+'__builtin_ia32_pshuflw': '_mm_shufflelo_epi16',
+'__builtin_ia32_pshufd': '_mm_shuffle_epi32',
+'__builtin_ia32_movshdup': '_mm_movehdup_ps',
+'__builtin_ia32_movsldup': '_mm_moveldup_ps',
+'__builtin_ia32_vec_set_v16qi': '_mm_insert_epi8',
+'__builtin_ia32_vec_set_v8hi': '_mm_insert_epi16',
+'__builtin_ia32_vec_set_v4si': '_mm_insert_epi32',
+'__builtin_ia32_vec_set_v2di': '_mm_insert_epi64',
+'__builtin_ia32_vec_set_v4hi': '_mm_insert_pi16',
+'__builtin_ia32_vec_ext_v16qi': '_mm_extract_epi8',
+'__builtin_ia32_vec_ext_v8hi': '_mm_extract_epi16',
+'__builtin_ia32_vec_ext_v4si': '_mm_extract_epi32',
+'__builtin_ia32_vec_ext_v2di': '_mm_extract_epi64',
+'__builtin_ia32_vec_ext_v4hi': '_mm_extract_pi16',
+'__builtin_ia32_vec_ext_v4sf': '_mm_extract_ps'
+}
+
+# Special unhandled cases:
+# __builtin_ia32_vec_ext_*(__P, idx) -> _mm_store_sd/_mm_storeh_pd
+# depending on index. No abstract insert/extract for these oddly.
+unhandled = [
+'__builtin_ia32_vec_ext_v2df',
+'__builtin_ia32_vec_ext_v2si',
+]
+
+def report_repl(builtin, repl):
+ sys.stderr.write("%s:%d: x86 builtin %s used, replaced with %s\n" % (fileinput.filename(), fileinput.filelineno(), builtin, repl))
+
+def report_cant(builtin):
+ sys.stderr.write("%s:%d: x86 builtin %s used, too many replacements\n" % (fileinput.filename(), fileinput.filelineno(), builtin))
+
+for line in fileinput.input(inplace=1):
+ for builtin, repl in repl_map.iteritems():
+ if builtin in line:
+ line = line.replace(builtin, repl)
+ report_repl(builtin, repl)
+ for unh in unhandled:
+ if unh in line:
+ report_cant(unh)
+ sys.stdout.write(line)
+
+sys.exit(err) \ No newline at end of file
diff --git a/www/compatibility.html b/www/compatibility.html
index cf0d96e2f4ffb..aa6a39dda1b42 100644
--- a/www/compatibility.html
+++ b/www/compatibility.html
@@ -32,20 +32,24 @@
<li><a href="#c">C compatibility</a>
<ul>
<li><a href="#inline">C99 inline functions</a></li>
+ <li><a href="#vector_builtins">"missing" vector __builtin functions</a></li>
<li><a href="#lvalue-cast">Lvalue casts</a></li>
<li><a href="#blocks-in-protected-scope">Jumps to within <tt>__block</tt> variable scope</a></li>
+ <li><a href="#block-variable-initialization">Non-initialization of <tt>__block</tt> variables</a></li>
+ <li><a href="#inline-asm">Inline assembly</a></li>
</ul>
</li>
<li><a href="#objective-c">Objective-C compatibility</a>
<ul>
<li><a href="#super-cast">Cast of super</a></li>
<li><a href="#sizeof-interface">Size of interfaces</a></li>
+ <li><a href="#objc_objs-cast">Internal Objective-C types</a></li>
+ <li><a href="#c_variables-class">C variables in @class or @protocol</a></li>
</ul>
</li>
<li><a href="#c++">C++ compatibility</a>
<ul>
<li><a href="#vla">Variable-length arrays</a></li>
- <li><a href="#init_static_const">Initialization of non-integral static const data members within a class definition</a></li>
<li><a href="#dep_lookup">Unqualified lookup in templates</a></li>
<li><a href="#dep_lookup_bases">Unqualified lookup into dependent bases of class templates</a></li>
<li><a href="#undep_incomplete">Incomplete types in templates</a></li>
@@ -53,6 +57,7 @@
<li><a href="#default_init_const">Default initialization of const
variable of a class type requires user-defined default
constructor</a></li>
+ <li><a href="#param_name_lookup">Parameter name lookup</a></li>
</ul>
</li>
<li><a href="#objective-c++">Objective-C++ compatibility</a>
@@ -60,7 +65,7 @@
<li><a href="#implicit-downcasts">Implicit downcasts</a></li>
</ul>
<ul>
- <li><a href="#Use of class as method name">Use of class as method name</a></li>
+ <li><a href="#class-as-property-name">Using <code>class</code> as a property name</a></li>
</ul>
</li>
</ul>
@@ -73,8 +78,9 @@
<h3 id="inline">C99 inline functions</h3>
<!-- ======================================================================= -->
<p>By default, Clang builds C code according to the C99 standard,
-which provides different inlining semantics than GCC's default
-behavior. For example, when compiling the following code with no optimization:</p>
+which provides different semantics for the <code>inline</code> keyword
+than GCC's default behavior. For example, consider the following
+code:</p>
<pre>
inline int add(int i, int j) { return i + j; }
@@ -84,11 +90,13 @@ int main() {
}
</pre>
-<p>In C99, this is an incomplete (incorrect) program because there is
-no external definition of the <code>add</code> function: the inline
-definition is only used for optimization, if the compiler decides to
-perform inlining. Therefore, we will get a (correct) link-time error
-with Clang, e.g.:</p>
+<p>In C99, <code>inline</code> means that a function's definition is
+provided only for inlining, and that there is another definition
+(without <code>inline</code>) somewhere else in the program. That
+means that this program is incomplete, because if <code>add</code>
+isn't inlined (for example, when compiling without optimization), then
+<code>main</code> will have an unresolved reference to that other
+definition. Therefore we'll get a (correct) link-time error like this:</p>
<pre>
Undefined symbols:
@@ -96,17 +104,31 @@ Undefined symbols:
_main in cc-y1jXIr.o
</pre>
+<p>By contrast, GCC's default behavior follows the GNU89 dialect,
+which is the C89 standard plus a lot of extensions. C89 doesn't have
+an <code>inline</code> keyword, but GCC recognizes it as an extension
+and just treats it as a hint to the optimizer.</p>
+
<p>There are several ways to fix this problem:</p>
<ul>
<li>Change <code>add</code> to a <code>static inline</code>
- function. Static inline functions are always resolved within the
- translation unit, so you won't have to add an external, non-inline
- definition of the function elsewhere in your program.</li>
-
- <li>Provide an external (non-inline) definition of <code>add</code>
- somewhere in your program.</li>
-
+ function. This is usually the right solution if only one
+ translation unit needs to use the function. <code>static
+ inline</code> functions are always resolved within the translation
+ unit, so you won't have to add a non-<code>inline</code> definition
+ of the function elsewhere in your program.</li>
+
+ <li>Remove the <code>inline</code> keyword from this definition of
+ <code>add</code>. The <code>inline</code> keyword is not required
+ for a function to be inlined, nor does it guarantee that it will be.
+ Some compilers ignore it completely. Clang treats it as a mild
+ suggestion from the programmer.</li>
+
+ <li>Provide an external (non-<code>inline</code>) definition
+ of <code>add</code> somewhere else in your program. The two
+ definitions must be equivalent!</li>
+
<li>Compile with the GNU89 dialect by adding
<code>-std=gnu89</code> to the set of Clang options. This option is
only recommended if the program source cannot be changed or if the
@@ -114,6 +136,44 @@ Undefined symbols:
be changed.</li>
</ul>
+<p>All of this only applies to C code; the meaning of <code>inline</code>
+in C++ is very different from its meaning in either GNU89 or C99.</p>
+
+<!-- ======================================================================= -->
+<h3 id="vector_builtins">"missing" vector __builtin functions</h3>
+<!-- ======================================================================= -->
+
+<p>The Intel and AMD manuals document a number "<tt>&lt;*mmintrin.h&gt;</tt>"
+header files, which define a standardized API for accessing vector operations
+on X86 CPUs. These functions have names like <tt>_mm_xor_ps</tt> and
+<tt>_mm256_addsub_pd</tt>. Compilers have leeway to implement these functions
+however they want. Since Clang supports an excellent set of <a
+href="../docs/LanguageExtensions.html#vectors">native vector operations</a>,
+the Clang headers implement these interfaces in terms of the native vector
+operations.
+</p>
+
+<p>In contrast, GCC implements these functions mostly as a 1-to-1 mapping to
+builtin function calls, like <tt>__builtin_ia32_paddw128</tt>. These builtin
+functions are an internal implementation detail of GCC, and are not portable to
+the Intel compiler, the Microsoft compiler, or Clang. If you get build errors
+mentioning these, the fix is simple: switch to the *mmintrin.h functions.</p>
+
+<p>The same issue occurs for NEON and Altivec for the ARM and PowerPC
+architectures respectively. For these, make sure to use the &lt;arm_neon.h&gt;
+and &lt;altivec.h&gt; headers.</p>
+
+<p>For x86 architectures this <a href="builtins.py">script</a> should help with
+the manual migration process. It will rewrite your source files in place to
+use the APIs instead of builtin function calls. Just call it like this:</p>
+
+<pre>
+ builtins.py *.c *.h
+</pre>
+
+<p>and it will rewrite all of the .c and .h files in the current directory to
+use the API calls instead of calls like <tt>__builtin_ia32_paddw128</tt>.</p>
+
<!-- ======================================================================= -->
<h3 id="lvalue-cast">Lvalue casts</h3>
<!-- ======================================================================= -->
@@ -139,50 +199,117 @@ example, one could use:</p>
<h3 id="blocks-in-protected-scope">Jumps to within <tt>__block</tt> variable scope</h3>
<!-- ======================================================================= -->
-<p>Clang disallows jumps into the scope of a <tt>__block</tt> variable, similar
-to the manner in which both GCC and Clang disallow jumps into the scope of
-variables which have user defined constructors (in C++).</p>
-
-<p>Variables marked with <tt>__block</tt> require special runtime initialization
-before they can be used. A jump into the scope of a <tt>__block</tt> variable
-would bypass this initialization and therefore the variable cannot safely be
-used.</p>
-
-<p>For example, consider the following code fragment:</p>
+<p>Clang disallows jumps into the scope of a <tt>__block</tt>
+variable. Variables marked with <tt>__block</tt> require special
+runtime initialization. A jump into the scope of a <tt>__block</tt>
+variable bypasses this initialization, leaving the variable's metadata
+in an invalid state. Consider the following code fragment:</p>
<pre>
-int f0(int c) {
- if (c)
- goto error;
+int fetch_object_state(struct MyObject *c) {
+ if (!c->active) goto error;
- __block int x;
- x = 1;
- return x;
+ __block int result;
+ run_specially_somehow(^{ result = c->state; });
+ return result;
error:
- x = 0;
- return x;
+ fprintf(stderr, "error while fetching object state");
+ return -1;
}
</pre>
-<p>GCC accepts this code, but it will crash at runtime along the error path,
-because the runtime setup for the storage backing the <tt>x</tt> variable will
-not have been initialized. Clang rejects this code with a hard error:</p>
+<p>GCC accepts this code, but it produces code that will usually crash
+when <code>result</code> goes out of scope if the jump is taken. (It's
+possible for this bug to go undetected because it often won't crash if
+the stack is fresh, i.e. still zeroed.) Therefore, Clang rejects this
+code with a hard error:</p>
<pre>
t.c:3:5: error: goto into protected scope
goto error;
^
t.c:5:15: note: jump bypasses setup of __block variable
- __block int x;
+ __block int result;
^
</pre>
-<p>Some instances of this construct may be safe if the variable is never used
-after the jump target, however the protected scope checker does not check the
-uses of the variable, only the scopes in which it is visible. You should rewrite
-your code to put the <tt>__block</tt> variables in a scope which is only visible
-where they are used.</p>
+<p>The fix is to rewrite the code to not require jumping into a
+<tt>__block</tt> variable's scope, e.g. by limiting that scope:</p>
+
+<pre>
+ {
+ __block int result;
+ run_specially_somehow(^{ result = c->state; });
+ return result;
+ }
+</pre>
+
+<!-- ======================================================================= -->
+<h3 id="block-variable-initialization">Non-initialization of <tt>__block</tt>
+variables</h3>
+<!-- ======================================================================= -->
+
+<p>In the following example code, the <tt>x</tt> variable is used before it is
+defined:</p>
+<pre>
+int f0() {
+ __block int x;
+ return ^(){ return x; }();
+}
+</pre>
+
+<p>By an accident of implementation, GCC and llvm-gcc unintentionally always
+zero initialized <tt>__block</tt> variables. However, any program which depends
+on this behavior is relying on unspecified compiler behavior. Programs must
+explicitly initialize all local block variables before they are used, as with
+other local variables.</p>
+
+<p>Clang does not zero initialize local block variables, and programs which rely
+on such behavior will most likely break when built with Clang.</p>
+
+
+<!-- ======================================================================= -->
+<h3 id="inline-asm">Inline assembly</h3>
+<!-- ======================================================================= -->
+
+<p>In general, Clang is highly compatible with the GCC inline assembly
+extensions, allowing the same set of constraints, modifiers and operands as GCC
+inline assembly.</p>
+
+<p>On targets that use the integrated assembler (such as most X86 targets),
+inline assembly is run through the integrated assembler instead of your system
+assembler (which is most commonly "gas", the GNU assembler). The LLVM
+integrated assembler is extremely compatible with GAS, but there are a couple of
+minor places where it is more picky, particularly due to outright GAS bugs.</p>
+
+<p>One specific example is that the assembler rejects ambiguous X86 instructions
+that don't have suffixes. For example:</p>
+
+<pre>
+ asm("add %al, (%rax)");
+ asm("addw $4, (%rax)");
+ asm("add $4, (%rax)");
+</pre>
+
+<p>Both clang and GAS accept the first instruction: because the first
+instruction uses the 8-bit <tt>%al</tt> register as an operand, it is clear that
+it is an 8-bit add. The second instruction is accepted by both because the "w"
+suffix indicates that it is a 16-bit add. The last instruction is accepted by
+GAS even though there is nothing that specifies the size of the instruction (and
+the assembler randomly picks a 32-bit add). Because it is ambiguous, Clang
+rejects the instruction with this error message:
+</p>
+
+<pre>
+&lt;inline asm&gt;:3:1: error: ambiguous instructions require an explicit suffix (could be 'addb', 'addw', 'addl', or 'addq')
+add $4, (%rax)
+^
+1 error generated.
+</pre>
+
+<p>To fix this compatibility issue, add an explicit suffix to the instruction:
+this makes your code more clear and is compatible with both GCC and Clang.</p>
<!-- ======================================================================= -->
<h2 id="objective-c">Objective-C compatibility</h3>
@@ -235,6 +362,47 @@ this problem, use the Objective-C runtime API function
</pre>
<!-- ======================================================================= -->
+<h3 id="objc_objs-cast">Internal Objective-C types</h3>
+<!-- ======================================================================= -->
+
+<p>GCC allows using pointers to internal Objective-C objects, <tt>struct objc_object*</tt>,
+<tt>struct objc_selector*</tt>, and <tt>struct objc_class*</tt> in place of the types
+<tt>id</tt>, <tt>SEL</tt>, and <tt>Class</tt> respectively. Clang treats the
+internal Objective-C structures as implementation detail and won't do implicit conversions:
+
+<pre>
+t.mm:11:2: error: no matching function for call to 'f'
+ f((struct objc_object *)p);
+ ^
+t.mm:5:6: note: candidate function not viable: no known conversion from 'struct objc_object *' to 'id' for 1st argument
+void f(id x);
+ ^
+</pre>
+
+<p>Code should use types <tt>id</tt>, <tt>SEL</tt>, and <tt>Class</tt>
+instead of the internal types.</p>
+
+<!-- ======================================================================= -->
+<h3 id="c_variables-class">C variables in @interface or @protocol</h3>
+<!-- ======================================================================= -->
+
+<p>GCC allows the declaration of C variables in
+an <code>@interface</code> or <code>@protocol</code>
+declaration. Clang does not allow variable declarations to appear
+within these declarations unless they are marked <code>extern</code>.</p>
+
+<p>Variables may still be declared in an @implementation.</p>
+
+<pre>
+@interface XX
+int a; // not allowed in clang
+int b = 1; // not allowed in clang
+extern int c; // allowed
+@end
+
+</pre>
+
+<!-- ======================================================================= -->
<h2 id="c++">C++ compatibility</h3>
<!-- ======================================================================= -->
@@ -250,8 +418,8 @@ compatibility with GNU C and C99 programs:</p>
<ul>
<li>The element type of a variable length array must be a POD
("plain old data") type, which means that it cannot have any
- user-declared constructors or destructors, base classes, or any
- members if non-POD type. All C types are POD types.</li>
+ user-declared constructors or destructors, any base classes, or any
+ members of non-POD type. All C types are POD types.</li>
<li>Variable length arrays cannot be used as the type of a non-type
template parameter.</li> </ul>
@@ -260,12 +428,9 @@ template parameter.</li> </ul>
<ol>
<li>replace the variable length array with a fixed-size array if you can
- determine a
- reasonable upper bound at compile time; sometimes this is as
+ determine a reasonable upper bound at compile time; sometimes this is as
simple as changing <tt>int size = ...;</tt> to <tt>const int size
- = ...;</tt> (if the definition of <tt>size</tt> is a compile-time
- integral constant);</li>
-<li>use an <tt>std::string</tt> instead of a <tt>char []</tt>;</li>
+ = ...;</tt> (if the initializer is a compile-time constant);</li>
<li>use <tt>std::vector</tt> or some other suitable container type;
or</li>
<li>allocate the array on the heap instead using <tt>new Type[]</tt> -
@@ -273,46 +438,6 @@ template parameter.</li> </ul>
</ol>
<!-- ======================================================================= -->
-<h3 id="init_static_const">Initialization of non-integral static const data members within a class definition</h3>
-<!-- ======================================================================= -->
-
-The following code is ill-formed in C++'03:
-
-<pre>
-class SomeClass {
- public:
- static const double SomeConstant = 0.5;
-};
-
-const double SomeClass::SomeConstant;
-</pre>
-
-Clang errors with something similar to:
-
-<pre>
-.../your_file.h:42:42: error: 'SomeConstant' can only be initialized if it is a static const integral data member
- static const double SomeConstant = 0.5;
- ^ ~~~
-</pre>
-
-Only <i>integral</i> constant expressions are allowed as initializers
-within the class definition. See C++'03 [class.static.data] p4 for the
-details of this restriction. The fix here is straightforward: move
-the initializer to the definition of the static data member, which
-must exist outside of the class definition:
-
-<pre>
-class SomeClass {
- public:
- static const double SomeConstant;
-};
-
-const double SomeClass::SomeConstant<b> = 0.5</b>;
-</pre>
-
-Note that the forthcoming C++0x standard will allow this.
-
-<!-- ======================================================================= -->
<h3 id="dep_lookup">Unqualified lookup in templates</h3>
<!-- ======================================================================= -->
@@ -614,6 +739,18 @@ void Bar() {
</pre>
<!-- ======================================================================= -->
+<h3 id="param_name_lookup">Parameter name lookup</h3>
+<!-- ======================================================================= -->
+
+<p>Due to a bug in its implementation, GCC allows the redeclaration of function parameter names within a function prototype in C++ code, e.g.</p>
+<blockquote>
+<pre>
+void f(int a, int a);
+</pre>
+</blockquote>
+<p>Clang diagnoses this error (where the parameter name has been redeclared). To fix this problem, rename one of the parameters.</p>
+
+<!-- ======================================================================= -->
<h2 id="objective-c++">Objective-C++ compatibility</h3>
<!-- ======================================================================= -->
@@ -622,18 +759,18 @@ void Bar() {
<!-- ======================================================================= -->
<p>Due to a bug in its implementation, GCC allows implicit downcasts
-(from base class to a derived class) when calling functions. Such code is
-inherently unsafe, since the object might not actually be an instance
-of the derived class, and is rejected by Clang. For example, given
-this code:</p>
+of Objective-C pointers (from a base class to a derived class) when
+calling functions. Such code is inherently unsafe, since the object
+might not actually be an instance of the derived class, and is
+rejected by Clang. For example, given this code:</p>
<pre>
@interface Base @end
@interface Derived : Base @end
-void f(Derived *);
-void g(Base *base) {
- f(base);
+void f(Derived *p);
+void g(Base *p) {
+ f(p);
}
</pre>
@@ -641,11 +778,11 @@ void g(Base *base) {
<pre>
downcast.mm:6:3: error: no matching function for call to 'f'
- f(base);
+ f(p);
^
downcast.mm:4:6: note: candidate function not viable: cannot convert from
superclass 'Base *' to subclass 'Derived *' for 1st argument
-void f(Derived *);
+void f(Derived *p);
^
</pre>
@@ -658,13 +795,17 @@ explicit cast:</p>
</pre>
<!-- ======================================================================= -->
-<h3 id="Use of class as method name">Use of class as method name</h3>
+<h3 id="class-as-property-name">Using <code>class</code> as a property name</h3>
<!-- ======================================================================= -->
-<p>Use of 'class' name to declare a method is allowed in objective-c++ mode to
-be compatible with GCC. However, use of property dot syntax notation to call
-this method is not allowed in clang++, as [I class] is a suitable syntax that
-will work. So, this test will fail in clang++.
+<p>In C and Objective-C, <code>class</code> is a normal identifier and
+can be used to name fields, ivars, methods, and so on. In
+C++, <code>class</code> is a keyword. For compatibility with existing
+code, Clang permits <code>class</code> to be used as part of a method
+selector in Objective-C++, but this does not extend to any other part
+of the language. In particular, it is impossible to use property dot
+syntax in Objective-C++ with the property name <code>class</code>, so
+the following code will fail to parse:</p>
<pre>
@interface I {
@@ -678,6 +819,7 @@ int cls;
@end
<pre>
+<p>Use explicit message-send syntax instead, i.e. <code>[I class]</code>.</p>
</div>
</body>
diff --git a/www/cxx_status.html b/www/cxx_status.html
index 7312c16b3bd96..942d0d3e7a29d 100644
--- a/www/cxx_status.html
+++ b/www/cxx_status.html
@@ -7,6 +7,7 @@
<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 }
@@ -24,7 +25,7 @@
<!--*************************************************************************-->
<h1>C++ and C++'0x Support in Clang</h1>
<!--*************************************************************************-->
-<p>Last updated: $Date: 2010-08-26 16:20:18 +0200 (Thu, 26 Aug 2010) $</p>
+<p>Last updated: $Date: 2011-01-26 22:35:14 +0100 (Wed, 26 Jan 2011) $</p>
<ul>
<li><a href="#projects">Projects Building with Clang</a></li>
@@ -35,9 +36,7 @@
<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 from the C++'0x draft).
- However, the implementation of Clang C++ is still somewhat immature, with
- remaining bugs that may cause compiler crashes, erroneous errors and warnings,
- or miscompiled code. The <a href="http://llvm.org/bugs/">LLVM bug tracker</a>
+ 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="projects">Projects Building with Clang</h2>
@@ -115,7 +114,9 @@ of support for a given section:
<th>Many examples work</th>
<th>Nearly everything works</th>
<th>Complete</th>
+<!--
<th>Complete (with tests for each paragraph)</th>
+-->
</tr>
<tr>
<td></td>
@@ -124,11 +125,18 @@ of support for a given section:
<td class="basic"></td>
<td class="medium"></td>
<td class="advanced"></td>
- <td class="complete"></td>
+ <td class="complete">rXXXXXX</td>
+<!--
<td class="complete" align="center">&#x2713;</td>
+-->
</tr>
</table>
+<p>In addition, boxes marked with &#x2713 have complete and passing tests.
+ Similarly, boxes marked with &#x2717 have complete tests, some of which
+ are failing, and a <b>?</b> indicates partial tests while not making any
+ statement about passing status.</p>
+
<p>A feature is "complete" when the appropriate Clang component (Parse, AST,
Sema, CodeGen) implements the behavior described in all of the
paragraphs in the relevant C++'0x draft standard. The major
@@ -160,7 +168,7 @@ components are:</p>
welcome!</p>
<table width="689" border="1" cellspacing="0">
-<tr><td colspan="6" align="center" bgcolor="#ffffcc">C++0x Features</td>
+<tr><td colspan="7" align="center" bgcolor="#ffddaa">C++0x Features (current draft report <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3225.pdf">here</a>) </td>
</tr>
<tr>
<th>Feature</th>
@@ -168,65 +176,508 @@ welcome!</p>
<th>AST</th>
<th>Sema</th>
<th>CodeGen</th>
+ <th>Standard Sections</th>
<th>Notes</th>
</tr>
-
+<tr><td colspan="7" class="category">Control Flow Modifications</td></tr>
<tr>
- <td>Explicit conversion operators (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a>)</td>
- <td class="complete" align="center"></td>
- <td class="medium" align="center"></td>
- <td class="advanced" align="center"></td>
- <td class="broken"></td>
- <td>No name mangling; ASTs don't contain calls to conversion operators</td>
+ <td>Range-based for loop</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>6.5.4</td>
+ <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2243.html">N2243</a></td>
</tr>
+
+<tr><td colspan="7" class="category">Type System Modifications</td></tr>
<tr>
- <td>Static assertions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.pdf">N1720</a>)</td>
+ <td>rvalue references</td>
<td class="complete" align="center"></td>
<td class="complete" align="center"></td>
<td class="complete" align="center"></td>
+ <td class="complete"></td>
+ <td>8.3.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a>,
+ <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2831.html">N2831</a> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm">N2439</a>
+ </td>
+</tr>
+<tr>
+ <td>decltype</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="advanced" align="center"></td>
<td class="na">N/A</td>
+ <td>7.1.6.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1478.pdf">N1478</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1978.pdf">N1978</a>
+ </td>
+</tr>
+<tr>
+ <td>auto type deduction</td>
+ <td></td>
+ <td></td>
+ <td></td>
<td></td>
+ <td>7.1.6.2, 7.1.6.4</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">N1984</a></td>
</tr>
<tr>
- <td>Deleted functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a>)</td>
+ <td>nullptr</td>
<td class="complete" align="center"></td>
<td class="complete" align="center"></td>
- <td class="complete" align="center"></td>
- <td class="na">N/A</td>
+ <td class="medium" align="center"></td>
+ <td class="broken"></td>
+ <td>2.14.7, 4.10, 4.11</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf">N1488</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf">N2214</a>
+ </td>
+</tr>
+<tr>
+ <td>enum classes</td>
+ <td class="complete"></td>
+ <td class="advanced"></td>
+ <td class="advanced"></td>
<td></td>
+ <td>7.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1513.pdf">N1513</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">N2347</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf">N2499</a>
+ Includes forward declaration capability
+ </td>
</tr>
<tr>
- <td>Rvalue references (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a> + <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2831.html">N2831</a>)</td>
- <td class="complete" align="center"></td>
- <td class="complete" align="center"></td>
+ <td>long long</td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td>3.9.1</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf">N1811</a>
+ </td>
+</tr>
+<tr>
+ <td>constexpr</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>3.6.2, 3.9, 5.19, 7.1.5</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1521.pdf">N1521</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235</a>
+ </td>
+</tr>
+<tr>
+ <td>char16_t/char32_t</td>
+ <td class="medium"></td>
+ <td class="medium"></td>
+ <td class="medium"></td>
+ <td class="medium"></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">N2249</a></td>
+</tr>
+<tr>
+ <td>Unicode string literal types</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>2.14.3, 2.14.5</td>
+ <td></td>
+</tr>
+<tr>
+ <td>Raw string literal types</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>2.14.5</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2053.html">N2053</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.html">N2442</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2378.pdf">N2378</a>
+ </td>
+</tr>
+<tr>
+ <td>user-defined literal types</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>2.14.8</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2378.pdf">N2378</a></td>
+</tr>
+<tr>
+ <td>POD defintion changes</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>3.9, 9</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2294.html">N2294</a></td>
+</tr>
+<tr>
+ <td>Unrestricted unions</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>9.5</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a></td>
+</tr>
+<tr>
+ <td>Tighter narrowing rules</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>8.5.4</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1890.pdf">N1890</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2215.pdf">N2215</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf">N2640</a>
+ </td>
+</tr>
+<tr><td colspan="7" class="category">Class Modifications</td></tr>
+<tr>
+ <td>delegating constructors</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>12.6.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986">N1986</a></td>
+</tr>
+<tr>
+ <td>inheriting constructors</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>12.9</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1890.pdf">N1890</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1898.pdf">N1898</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2512.html">N2512</a>
+ </td>
+</tr>
+<tr>
+ <td>In-declaration member initialization</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2628.html">N2628</a></td>
+</tr>
+<tr>
+ <td>Changes to implicitly generated methods</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>Includes implicit generation of move operations</td>
+</tr>
+<tr>
+ <td>defaulted methods</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1717.pdf">N1717</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html">N2326</a>
+ </td>
+</tr>
+<tr>
+ <td>destructor defaults to noexcept</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>sizeof on members without object instance</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2150.html">N2150</a></td>
+</tr>
+<tr>
+ <td>virtual function safety modifications</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>Explicit conversion operators</td>
<td class="complete" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td class="basic" align="center"></td>
<td class="broken"></td>
+ <td>12.3</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2333.html">N2333</a>
+ No name mangling; ASTs don't contain calls to conversion operators</td>
+</tr>
+<tr><td colspan="7" class="category">Template Modifications</td></tr>
+<tr>
+ <td>Right angle brackets</td>
+ <td class="complete" align="center"></td>
+ <td class="na" align="center">N/A</td>
+ <td class="na" align="center">N/A</td>
+ <td class="na">N/A</td>
<td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a></td>
</tr>
<tr>
- <td>nullptr (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a>)</td>
+ <td>variadic templates</td>
<td class="complete" align="center"></td>
<td class="complete" align="center"></td>
<td class="complete" align="center"></td>
- <td class="broken"></td>
+ <td class="complete" align="center"></td>
+ <td>14.6.3</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2080.pdf">N2080</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2087.pdf">N2087</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">N2242</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2488.pdf">N2488</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555</a>
+ </td>
+</tr>
+<tr>
+ <td>template aliases</td>
<td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>7.1.3, 14.6.7</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1489.pdf">N1489</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">N2258</a>
+ Includes non-template type aliasing
+ </td>
</tr>
<tr>
- <td>Right angle brackets (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a>)</td>
- <td class="complete" align="center"></td>
- <td class="na" align="center">N/A</td>
- <td class="na" align="center">N/A</td>
+ <td>Removal of export</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
<td class="na">N/A</td>
<td></td>
+ <td>This was never implemented in C++03</td>
+</tr>
+<tr>
+ <td>extern templates</td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td class="complete"></td>
+ <td>14.8.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm">N1987</a></td>
+</tr>
+<tr>
+ <td>Local classes as template parameters</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2402.pdf">N2402</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">N2657</a>
+ </td>
</tr>
+<tr><td colspan="7" class="category">Exception Modifications</td></tr>
<tr>
- <td>Decltype (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a>)</td>
+ <td>Deprecation of exception specifications</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>15.4</td>
+ <td></td>
+</tr>
+<tr>
+ <td>noexcept</td>
<td class="complete" align="center">&#x2713;</td>
<td class="complete" align="center">&#x2713;</td>
<td class="complete" align="center">&#x2713;</td>
<td class="na">N/A</td>
+ <td>5.3.7, 15.4</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050</a></td>
+</tr>
+<tr><td colspan="7" class="category">Preprocessor Modifications</td></tr>
+<tr>
+ <td>__STDC_HOSTED__</td>
+ <td></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>16.8</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568</a>
+ </td>
+</tr>
+<tr>
+ <td>_Pragma</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>16.9</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568</a>
+ </td>
+</tr>
+<tr>
+ <td>Variable argument macros</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>16.3</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568</a>
+ </td>
+</tr>
+<tr>
+ <td>Empty macro arguments</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>16.3</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568</a>
+ </td>
+</tr>
+<tr>
+ <td>__func__</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>8.4.1</td>
+ <td>C99
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568</a>
+ </td>
+</tr>
+<tr>
+ <td>__cplusplus</td>
+ <td class="complete"></td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td class="na">N/A</td>
+ <td>16.8</td>
+ <td></td>
+</tr>
+<tr><td colspan="7" class="category">Things Completely New</td></tr>
+<tr>
+ <td>Late-specified return type</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>8.3.5</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2445.html">N2445</a></td>
+</tr>
+<tr>
+ <td>lambda expressions</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>5.1.2</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1968.htm">N1968</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2550.pdf">N2550</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2859.pdf">N2859</a>
+ </td>
+</tr>
+<tr>
+ <td>Uniform initializers </td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>12.6</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2215.pdf">N2215</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf">N2640</a>
+ </td>
+</tr>
+<tr>
+ <td>Memory model</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>1.7</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2556.html">N2556</a></td>
+</tr>
+<tr><td colspan="7" class="category">Miscellania</td></tr>
+<tr>
+ <td>Standard attribute syntax</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2418.pdf">N2418</a></td>
+</tr>
+<tr>
+ <td>alignment control</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>Deleted functions</td>
+ <td class="complete" align="center"></td>
+ <td class="complete" align="center"></td>
+ <td class="medium" align="center"></td>
+ <td class="na">N/A</td>
+ <td>8.4.3</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.htm">N2326</a></br>
+ This also includes class methods.</td>
+</tr>
+<tr>
+ <td>static_assert</td>
+ <td class="complete" align="center"></td>
+ <td class="complete" align="center"></td>
+ <td class="advanced" align="center"></td>
+ <td class="na">N/A</td>
+ <td>7</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1381.htm">N1381</a>
+ <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.pdf">N1720</a>
+ </td>
+</tr>
+<tr>
+ <td>Inline namespaces</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">N/A</td>
+ <td>7.3.1</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535</a></td>
+</tr>
+<tr>
+ <td>thread_local storage</td>
+ <td></td>
+ <td></td>
+ <td></td>
<td></td>
+ <td>3.7.2, 7.1.1</td>
+ <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">N2660</a></td>
</tr>
+<tr><td colspan="7" class="category">Standard Library Modifications, see <a href="http://libcxx.llvm.org/index.html">libc++</a> or <a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x">libstdc++</a> or <a href="http://blogs.msdn.com/b/vcblog/archive/2010/07/02/video-introduction-to-the-stl-part-1.aspx">VC++ 2010</a></td></tr>
</table>
<br />
</div>
diff --git a/www/favicon.ico b/www/favicon.ico
new file mode 100644
index 0000000000000..724ad6e12dd40
--- /dev/null
+++ b/www/favicon.ico
Binary files differ
diff --git a/www/features.html b/www/features.html
index 6034ae783987a..869d0d8ad1ddd 100644
--- a/www/features.html
+++ b/www/features.html
@@ -326,7 +326,7 @@ specifically designed and built to capture this information.
<h3><a name="license">Use the LLVM 'BSD' License</a></h3>
<!--=======================================================================-->
-<p>We actively indend for clang (and a LLVM as a whole) to be used for
+<p>We actively intend for clang (and LLVM as a whole) to be used for
commercial projects, and the BSD license is the simplest way to allow this. We
feel that the license encourages contributors to pick up the source and work
with it, and believe that those individuals and organizations will contribute
diff --git a/www/get_started.html b/www/get_started.html
index b64a5f285fb0c..54f7442b88bb5 100644
--- a/www/get_started.html
+++ b/www/get_started.html
@@ -19,10 +19,13 @@
options. This should get you up and running with the minimum of muss and fuss.
If you like what you see, please consider <a href="get_involved.html">getting
involved</a> with the Clang community. If you run into problems, please file
-bugs in <a href="http://llvm.org/bugs/">LLVM Bugzilla</a> or bring up the issue
-on the
-<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">Clang development
-mailing list</a>.</p>
+bugs in <a href="http://llvm.org/bugs/">LLVM Bugzilla</a>.</p>
+
+<h2 id="download">Release Clang Versions</h2>
+
+<p>Clang has been released as part of regular LLVM releases since LLVM 2.6. You
+can download the release versions
+from <a href="http://llvm.org/releases/">http://llvm.org/releases/</a>.</p>
<h2 id="build">Building Clang and Working with the Code</h2>
@@ -54,8 +57,11 @@ follows:</p>
</ul>
<li>Build LLVM and Clang:</li>
<ul>
- <li><tt>cd ..</tt> (back to llvm)</li>
- <li><tt>./configure</tt></li>
+ <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><tt>../llvm/configure</tt></li>
<li><tt>make</tt></li>
<li>This builds both LLVM and Clang for debug mode.</li>
<li>Note: For subsequent Clang development, you can just do make at the
@@ -119,7 +125,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 or 2008</b></li>
+ <li><b>Visual Studio 2005, 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:
@@ -145,9 +151,12 @@ Visual Studio:</p>
</ul>
<li>Run cmake to generate the Visual Studio solution and project files:</li>
<ul>
- <li><tt>cd ..</tt> (Change directory back to the llvm top.)</li>
- <li>If you are using Visual Studio 2005: <tt>cmake .</tt></li>
- <li>Or if you are using Visual Studio 2008: <tt>cmake -G "Visual Studio 9 2008" .</tt></li>
+ <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>Or if you are using Visual Studio 2010: <tt>cmake -G "Visual Studio 10" ..\llvm</tt></li>
<li>The above, if successful, will have created an LLVM.sln file in the
llvm directory.
</ul>
diff --git a/www/hacking.html b/www/hacking.html
index 7bd718ba3abc6..978c99f141397 100644
--- a/www/hacking.html
+++ b/www/hacking.html
@@ -185,6 +185,10 @@
(path to llvm)/llvm/tools/clang/test
</tt>
+ <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>
+
<p>To run a single test:</p>
<tt>
@@ -202,30 +206,18 @@
<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>Note that a few tests currently fail on Windows. We are working to
- correct this. Therefore your output might look something like this:</p>
+ <p>Your output might look something like this:</p>
-<tt><pre>lit.py: lit.cfg:152: note: using clang: 'C:/Tools/llvm/bin/Debug\\clang.EXE'
--- Testing: 1723 tests, 2 threads --
-FAIL: Clang::(test path) (659 of 1723)
-******************** TEST 'Clang::(test path)' FAILED ********************
-Script:
- (commands run)
-Command Output (stdout):
- (output here)
-Command Output (stderr):
- (output here)
-********************
-Testing Time: 83.66s
-********************
-Failing Tests (1):
- Clang::(test path)
- Expected Passes : 1704
- Expected Failures : 18
- Unexpected Failures: 1
+<tt><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>
- <p>The last statistic, "Unexpected Failures", is the important one.</p>
+ <p>The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.</p>
<!--=====================================================================-->
<h2 id="patches">Creating Patch Files</h2>
diff --git a/www/index.html b/www/index.html
index 7bf3e5f6948dc..623f7198827a7 100644
--- a/www/index.html
+++ b/www/index.html
@@ -90,12 +90,11 @@
<!--=====================================================================-->
<p>Clang is still under heavy development. Clang is considered to
- be a production quality C and Objective-C compiler when targetting
- X86-32 and X86-64 (other targets may have caveats, but are usually
- easy to fix). If you are looking for source analysis or
+ be a production quality C, Objective-C, C++ and Objective-C++ compiler when
+ 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's C++ support is currently beta quality,
- but is rapidly maturing: see the <a
+ solution for you. Clang does not support C++'0x yet, please see the <a
href="cxx_status.html">C++ status</a> page for more
information.</p>
diff --git a/www/menu.html.incl b/www/menu.html.incl
index d828449ca2560..4acfbe54f9662 100644
--- a/www/menu.html.incl
+++ b/www/menu.html.incl
@@ -8,6 +8,7 @@
<a href="/index.html">About</a>
<a href="/features.html">Features</a>
<a href="/comparison.html">Comparisons</a>
+ <a href="/related.html">Related Projects</a>
<a href="/docs/UsersManual.html">User's Manual</a>
<a href="/compatibility.html">Language&nbsp;Compatibility</a>
<a href="/docs/LanguageExtensions.html">Language&nbsp;Extensions</a>
@@ -32,7 +33,7 @@
<div class="submenu">
<label>Communication</label>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">cfe-dev List</a>
- <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">cfe-commit List</a>
+ <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">cfe-commits List</a>
<a href="irc://irc.oftc.net/llvm">IRC: irc.oftc.net#llvm</a>
<a href="http://llvm.org/bugs/">Bug Reports</a>
</div>
diff --git a/www/related.html b/www/related.html
new file mode 100644
index 0000000000000..9fcd390d23997
--- /dev/null
+++ b/www/related.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<!-- 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" />
+ <title>Clang Related Projects</title>
+ <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"-->
+ <div id="content">
+ <h1>Clang Related Projects</h1>
+
+ <p>As Clang matures, more and more projects are being built atop the Clang
+ libraries and other open source projects are starting their own Clang
+ related subprojects, like building their source code with Clang or writing
+ custom analysis tools using Clang. This page tracks some of those Clang
+ related projects.</p>
+
+ <p>Please email cfe-dev if you have a Clang related project you would like
+ added to this list.</p>
+
+ <dl>
+ <dt>FreeBSD Clang Page</dt>
+ <dd>
+ <p>
+ <b>Site:</b>
+ <a href="http://wiki.freebsd.org/BuildingFreeBSDWithClang">
+ http://wiki.freebsd.org/BuildingFreeBSDWithClang</a>
+ </p>
+ <p>
+ This is an effort to get FreeBSD to build with clang/llvm. Clang is a
+ compiler built on the Low Level Virtual Machine compiler
+ infrastructure. Both clang and llvm are released under a BSD like
+ license.
+ </p>
+ </dd>
+
+ <dt>Chromium Clang Page</dt>
+ <dd>
+ <p>
+ <b>Site:</b>
+ <a href="http://code.google.com/p/chromium/wiki/Clang">
+ http://code.google.com/p/chromium/wiki/Clang</a>
+ </p>
+ <p>
+ Notes on using Clang to build the Chromium web browser.
+ </p>
+ </dd>
+ </dl>
+ </div>
+</body>
+</html>
diff --git a/www/robots.txt b/www/robots.txt
new file mode 100644
index 0000000000000..9e60f970fbd02
--- /dev/null
+++ b/www/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: