diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 8a257f78c1..0d8844f95a 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -1,106 +1,106 @@ -//===--- SemaCXXScopeSpec.cpp - Semantic Analysis for C++ scope specifiers-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements C++ semantic analysis for scope specifiers. -// -//===----------------------------------------------------------------------===// - -#include "Sema.h" -#include "clang/AST/ASTContext.h" -#include "clang/Parse/DeclSpec.h" -#include "llvm/ADT/STLExtras.h" -using namespace clang; - - -/// ActOnCXXGlobalScopeSpecifier - Return the object that represents the -/// global scope ('::'). -Sema::CXXScopeTy *Sema::ActOnCXXGlobalScopeSpecifier(Scope *S, - SourceLocation CCLoc) { - return cast(Context.getTranslationUnitDecl()); -} - -/// ActOnCXXNestedNameSpecifier - Called during parsing of a -/// nested-name-specifier. e.g. for "foo::bar::" we parsed "foo::" and now -/// we want to resolve "bar::". 'SS' is empty or the previously parsed -/// nested-name part ("foo::"), 'IdLoc' is the source location of 'bar', -/// 'CCLoc' is the location of '::' and 'II' is the identifier for 'bar'. -/// Returns a CXXScopeTy* object representing the C++ scope. -Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S, - const CXXScopeSpec &SS, - SourceLocation IdLoc, - SourceLocation CCLoc, - IdentifierInfo &II) { - NamedDecl *SD = LookupParsedName(S, &SS, &II, LookupNestedNameSpecifierName); - - if (SD) { - if (TypedefDecl *TD = dyn_cast(SD)) { - if (const RecordType* Record = TD->getUnderlyingType()->getAsRecordType()) - return cast(Record->getDecl()); - } else if (isa(SD) || isa(SD)) { - return cast(SD); - } - - // FIXME: Template parameters and dependent types. - // FIXME: C++0x scoped enums - - // Fall through to produce an error: we found something that isn't - // a class or a namespace. - } - - // If we didn't find anything during our lookup, try again with - // ordinary name lookup, which can help us produce better error - // messages. - if (!SD) - SD = LookupParsedName(S, &SS, &II, LookupOrdinaryName); - unsigned DiagID; - if (SD) - DiagID = diag::err_expected_class_or_namespace; - else if (SS.isSet()) - DiagID = diag::err_typecheck_no_member; - else - DiagID = diag::err_undeclared_var_use; - - if (SS.isSet()) - Diag(IdLoc, DiagID) << &II << SS.getRange(); - else - Diag(IdLoc, DiagID) << &II; - - return 0; -} - -/// ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global -/// scope or nested-name-specifier) is parsed, part of a declarator-id. -/// After this method is called, according to [C++ 3.4.3p3], names should be -/// looked up in the declarator-id's scope, until the declarator is parsed and -/// ActOnCXXExitDeclaratorScope is called. -/// The 'SS' should be a non-empty valid CXXScopeSpec. -void Sema::ActOnCXXEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) { - assert(SS.isSet() && "Parser passed invalid CXXScopeSpec."); - assert(PreDeclaratorDC == 0 && "Previous declarator context not popped?"); - PreDeclaratorDC = static_cast(S->getEntity()); - CurContext = static_cast(SS.getScopeRep()); - S->setEntity(CurContext); -} - -/// ActOnCXXExitDeclaratorScope - Called when a declarator that previously -/// invoked ActOnCXXEnterDeclaratorScope(), is finished. 'SS' is the same -/// CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well. -/// Used to indicate that names should revert to being looked up in the -/// defining scope. -void Sema::ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS) { - assert(SS.isSet() && "Parser passed invalid CXXScopeSpec."); - assert(S->getEntity() == SS.getScopeRep() && "Context imbalance!"); - S->setEntity(PreDeclaratorDC); - PreDeclaratorDC = 0; - - // Reset CurContext to the nearest enclosing context. - while (!S->getEntity() && S->getParent()) - S = S->getParent(); - CurContext = static_cast(S->getEntity()); -} +//===--- SemaCXXScopeSpec.cpp - Semantic Analysis for C++ scope specifiers-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements C++ semantic analysis for scope specifiers. +// +//===----------------------------------------------------------------------===// + +#include "Sema.h" +#include "clang/AST/ASTContext.h" +#include "clang/Parse/DeclSpec.h" +#include "llvm/ADT/STLExtras.h" +using namespace clang; + + +/// ActOnCXXGlobalScopeSpecifier - Return the object that represents the +/// global scope ('::'). +Sema::CXXScopeTy *Sema::ActOnCXXGlobalScopeSpecifier(Scope *S, + SourceLocation CCLoc) { + return cast(Context.getTranslationUnitDecl()); +} + +/// ActOnCXXNestedNameSpecifier - Called during parsing of a +/// nested-name-specifier. e.g. for "foo::bar::" we parsed "foo::" and now +/// we want to resolve "bar::". 'SS' is empty or the previously parsed +/// nested-name part ("foo::"), 'IdLoc' is the source location of 'bar', +/// 'CCLoc' is the location of '::' and 'II' is the identifier for 'bar'. +/// Returns a CXXScopeTy* object representing the C++ scope. +Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S, + const CXXScopeSpec &SS, + SourceLocation IdLoc, + SourceLocation CCLoc, + IdentifierInfo &II) { + NamedDecl *SD = LookupParsedName(S, &SS, &II, LookupNestedNameSpecifierName); + + if (SD) { + if (TypedefDecl *TD = dyn_cast(SD)) { + if (const RecordType* Record = TD->getUnderlyingType()->getAsRecordType()) + return cast(Record->getDecl()); + } else if (isa(SD) || isa(SD)) { + return cast(SD); + } + + // FIXME: Template parameters and dependent types. + // FIXME: C++0x scoped enums + + // Fall through to produce an error: we found something that isn't + // a class or a namespace. + } + + // If we didn't find anything during our lookup, try again with + // ordinary name lookup, which can help us produce better error + // messages. + if (!SD) + SD = LookupParsedName(S, &SS, &II, LookupOrdinaryName); + unsigned DiagID; + if (SD) + DiagID = diag::err_expected_class_or_namespace; + else if (SS.isSet()) + DiagID = diag::err_typecheck_no_member; + else + DiagID = diag::err_undeclared_var_use; + + if (SS.isSet()) + Diag(IdLoc, DiagID) << &II << SS.getRange(); + else + Diag(IdLoc, DiagID) << &II; + + return 0; +} + +/// ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global +/// scope or nested-name-specifier) is parsed, part of a declarator-id. +/// After this method is called, according to [C++ 3.4.3p3], names should be +/// looked up in the declarator-id's scope, until the declarator is parsed and +/// ActOnCXXExitDeclaratorScope is called. +/// The 'SS' should be a non-empty valid CXXScopeSpec. +void Sema::ActOnCXXEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) { + assert(SS.isSet() && "Parser passed invalid CXXScopeSpec."); + assert(PreDeclaratorDC == 0 && "Previous declarator context not popped?"); + PreDeclaratorDC = static_cast(S->getEntity()); + CurContext = static_cast(SS.getScopeRep()); + S->setEntity(CurContext); +} + +/// ActOnCXXExitDeclaratorScope - Called when a declarator that previously +/// invoked ActOnCXXEnterDeclaratorScope(), is finished. 'SS' is the same +/// CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well. +/// Used to indicate that names should revert to being looked up in the +/// defining scope. +void Sema::ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS) { + assert(SS.isSet() && "Parser passed invalid CXXScopeSpec."); + assert(S->getEntity() == SS.getScopeRep() && "Context imbalance!"); + S->setEntity(PreDeclaratorDC); + PreDeclaratorDC = 0; + + // Reset CurContext to the nearest enclosing context. + while (!S->getEntity() && S->getParent()) + S = S->getParent(); + CurContext = static_cast(S->getEntity()); +} diff --git a/test/Parser/cxx-condition.cpp b/test/Parser/cxx-condition.cpp index 9ffdf79ba0..2a77193f25 100644 --- a/test/Parser/cxx-condition.cpp +++ b/test/Parser/cxx-condition.cpp @@ -1,11 +1,11 @@ -// RUN: clang -parse-noop -verify %s - -void f() { - int a; - while (a) ; - while (int x) ; // expected-error {{expected '=' after declarator}} - while (float x = 0) ; - if (const int x = a) ; - switch (int x = a+10) {} - for (; int x = ++a; ) ; -} +// RUN: clang -parse-noop -verify %s + +void f() { + int a; + while (a) ; + while (int x) ; // expected-error {{expected '=' after declarator}} + while (float x = 0) ; + if (const int x = a) ; + switch (int x = a+10) {} + for (; int x = ++a; ) ; +} diff --git a/test/Parser/cxx-variadic-func.cpp b/test/Parser/cxx-variadic-func.cpp index 0ef8684c1a..0e9c5ca285 100644 --- a/test/Parser/cxx-variadic-func.cpp +++ b/test/Parser/cxx-variadic-func.cpp @@ -1,5 +1,5 @@ -// RUN: clang -fsyntax-only %s - -void f(...) { - int g(int(...)); -} +// RUN: clang -fsyntax-only %s + +void f(...) { + int g(int(...)); +} diff --git a/test/SemaCXX/class-names.cpp b/test/SemaCXX/class-names.cpp index 8b01c89f39..1166b1016e 100644 --- a/test/SemaCXX/class-names.cpp +++ b/test/SemaCXX/class-names.cpp @@ -1,52 +1,52 @@ -// RUN: clang -fsyntax-only -verify %s -class C { }; - -C c; - -void D(int); - -class D {}; // expected-note {{previous use is here}} - -void foo() -{ - D(5); - class D d; -} - -class D; - -enum D; // expected-error {{use of 'D' with tag type that does not match previous declaration}} - -class A * A; - -class A * a2; - -void bar() -{ - A = 0; -} - -void C(int); - -void bar2() -{ - C(17); -} - -extern int B; -class B; -class B {}; -int B; - -enum E { e1_val }; -E e1; - -void E(int); - -void bar3() { - E(17); -} - -enum E e2; - -enum E2 { E2 }; +// RUN: clang -fsyntax-only -verify %s +class C { }; + +C c; + +void D(int); + +class D {}; // expected-note {{previous use is here}} + +void foo() +{ + D(5); + class D d; +} + +class D; + +enum D; // expected-error {{use of 'D' with tag type that does not match previous declaration}} + +class A * A; + +class A * a2; + +void bar() +{ + A = 0; +} + +void C(int); + +void bar2() +{ + C(17); +} + +extern int B; +class B; +class B {}; +int B; + +enum E { e1_val }; +E e1; + +void E(int); + +void bar3() { + E(17); +} + +enum E e2; + +enum E2 { E2 }; diff --git a/test/SemaCXX/do-while-scope.cpp b/test/SemaCXX/do-while-scope.cpp index 94a3116c57..8adaadedc4 100644 --- a/test/SemaCXX/do-while-scope.cpp +++ b/test/SemaCXX/do-while-scope.cpp @@ -1,8 +1,8 @@ // RUN: clang -fsyntax-only -verify %s void test() { - int x; - do - int x; - while (1); + int x; + do + int x; + while (1); } diff --git a/test/SemaCXX/function-type-qual.cpp b/test/SemaCXX/function-type-qual.cpp index b5487a9900..dd3e550e1d 100644 --- a/test/SemaCXX/function-type-qual.cpp +++ b/test/SemaCXX/function-type-qual.cpp @@ -1,23 +1,23 @@ -// RUN: clang -fsyntax-only -verify %s - -void f() const; // expected-error {{type qualifier is not allowed on this function}} - -typedef void cfn() const; -cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} - -class C { - void f() const; - cfn f2; - static void f3() const; // expected-error {{type qualifier is not allowed on this function}} - static cfn f4; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} - - void m1() { - x = 0; - } - - void m2() const { - x = 0; // expected-error {{read-only variable is not assignable}} - } - - int x; -}; +// RUN: clang -fsyntax-only -verify %s + +void f() const; // expected-error {{type qualifier is not allowed on this function}} + +typedef void cfn() const; +cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} + +class C { + void f() const; + cfn f2; + static void f3() const; // expected-error {{type qualifier is not allowed on this function}} + static cfn f4; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} + + void m1() { + x = 0; + } + + void m2() const { + x = 0; // expected-error {{read-only variable is not assignable}} + } + + int x; +}; diff --git a/test/SemaCXX/inherit.cpp b/test/SemaCXX/inherit.cpp index 8ccecddaf6..cca1f8dec7 100644 --- a/test/SemaCXX/inherit.cpp +++ b/test/SemaCXX/inherit.cpp @@ -1,32 +1,32 @@ -// RUN: clang -fsyntax-only -verify %s -class A { }; - -class B1 : A { }; - -class B2 : virtual A { }; - -class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base specifier}} - -class C : public B1, private B2 { }; - - -class D; - -class E : public D { }; // expected-error{{base class has incomplete type}} - -typedef int I; - -class F : public I { }; // expected-error{{base specifier must name a class}} - -union U1 : public A { }; // expected-error{{unions cannot have base classes}} - -union U2 {}; - -class G : public U2 { }; // expected-error{{unions cannot be base classes}} - -typedef G G_copy; -typedef G G_copy_2; -typedef G_copy G_copy_3; - -class H : G_copy, A, G_copy_2, // expected-error{{base class 'G_copy' specified more than once as a direct base class}} - public G_copy_3 { }; // expected-error{{base class 'G_copy' specified more than once as a direct base class}} +// RUN: clang -fsyntax-only -verify %s +class A { }; + +class B1 : A { }; + +class B2 : virtual A { }; + +class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base specifier}} + +class C : public B1, private B2 { }; + + +class D; + +class E : public D { }; // expected-error{{base class has incomplete type}} + +typedef int I; + +class F : public I { }; // expected-error{{base specifier must name a class}} + +union U1 : public A { }; // expected-error{{unions cannot have base classes}} + +union U2 {}; + +class G : public U2 { }; // expected-error{{unions cannot be base classes}} + +typedef G G_copy; +typedef G G_copy_2; +typedef G_copy G_copy_3; + +class H : G_copy, A, G_copy_2, // expected-error{{base class 'G_copy' specified more than once as a direct base class}} + public G_copy_3 { }; // expected-error{{base class 'G_copy' specified more than once as a direct base class}} diff --git a/www/clang_video-05-25-2007.html b/www/clang_video-05-25-2007.html index eb04761a93..ade0269f46 100644 --- a/www/clang_video-05-25-2007.html +++ b/www/clang_video-05-25-2007.html @@ -1,27 +1,27 @@ - - - - - - 2007 LLVM Developer's Meeting - - - - - -
-

2007 LLVM Developer's Meeting

- Discussion about Clang at the 2007 LLVM Developer's Meeting. -

About:

-

In this video, Steve Naroff introduces the Clang project and talks about some of the goals and motivations for starting the project. -

-

Details: New LLVM C Front-end - This talk describes a new from-scratch C frontend (which is aiming to support Objective C and C++ someday) for LLVM, built as a native part of the LLVM system and in the LLVM design style. -

The Presentation:

-

You can download a copy of the presentation in mov format. However, due to the picture quality, it is recommended that you also download the lecture slides for viewing while you watch the video. -

-
- + + + + + + 2007 LLVM Developer's Meeting + + + + + +
+

2007 LLVM Developer's Meeting

+ Discussion about Clang at the 2007 LLVM Developer's Meeting. +

About:

+

In this video, Steve Naroff introduces the Clang project and talks about some of the goals and motivations for starting the project. +

+

Details: New LLVM C Front-end - This talk describes a new from-scratch C frontend (which is aiming to support Objective C and C++ someday) for LLVM, built as a native part of the LLVM system and in the LLVM design style. +

The Presentation:

+

You can download a copy of the presentation in mov format. However, due to the picture quality, it is recommended that you also download the lecture slides for viewing while you watch the video. +

+
+ \ No newline at end of file diff --git a/www/clang_video-07-25-2007.html b/www/clang_video-07-25-2007.html index 53959ef367..d2225896c5 100644 --- a/www/clang_video-07-25-2007.html +++ b/www/clang_video-07-25-2007.html @@ -1,30 +1,30 @@ - - - - - - LLVM 2.0 and Beyond! - - - - - -
-

LLVM 2.0 and Beyond!

- A Google Techtalk by Chris Lattner -

About:

-

In this video, Chris Lattner talks about some of the features of Clang, especially in regards to performance. -

-

Details: The LLVM 2.0 release brings a number of new features and capabilities to the LLVM toolset. This talk briefly describes those features, then moves on to talk about what is next: llvm 2.1, llvm-gcc 4.2, and puts a special emphasis on the 'clang' C front-end. This describes how the 'clang' preprocessor can be used to improve the scalability of distcc by up to 4.4x. -

The Presentation:

-

You can view the presentation through google video. In addition, the slides from the presentation are also available, if you wish to retain a copy. -

-

Publishing Information:

- "LLVM 2.0 and Beyond!", Chris Lattner,
- Google Tech Talk, Mountain View, CA, July 2007. -
- + + + + + + LLVM 2.0 and Beyond! + + + + + +
+

LLVM 2.0 and Beyond!

+ A Google Techtalk by Chris Lattner +

About:

+

In this video, Chris Lattner talks about some of the features of Clang, especially in regards to performance. +

+

Details: The LLVM 2.0 release brings a number of new features and capabilities to the LLVM toolset. This talk briefly describes those features, then moves on to talk about what is next: llvm 2.1, llvm-gcc 4.2, and puts a special emphasis on the 'clang' C front-end. This describes how the 'clang' preprocessor can be used to improve the scalability of distcc by up to 4.4x. +

The Presentation:

+

You can view the presentation through google video. In addition, the slides from the presentation are also available, if you wish to retain a copy. +

+

Publishing Information:

+ "LLVM 2.0 and Beyond!", Chris Lattner,
+ Google Tech Talk, Mountain View, CA, July 2007. +
+ \ No newline at end of file diff --git a/www/comparison.html b/www/comparison.html index e873f73b61..fa853fb084 100644 --- a/www/comparison.html +++ b/www/comparison.html @@ -1,195 +1,195 @@ - - - - - - Comparing clang to other open source compilers - - - - - -
-

Clang vs Other Open Source Compilers

- -

Building an entirely new compiler front-end is a big task, and it isn't - always clear to people why we decided to do this. Here we compare clang - and its goals to other open source compiler front-ends that are - available. We restrict the discussion to very specific objective points - to avoid controversy where possible. Also, software is infinitely - mutable, so we don't talk about little details that can be fixed with - a reasonable amount of effort: we'll talk about issues that are - difficult to fix for architectural or political reasons.

- -

The goal of this list is to describe how differences in goals lead to - different strengths and weaknesses, not to make some compiler look bad. - This will hopefully help you to evaluate whether using clang is a good - idea for your personal goals. Because we don't know specifically what - you want to do, we describe the features of these compilers in - terms of our goals: if you are only interested in static - analysis, you may not care that something lacks codegen support, for - example.

- -

Please email cfe-dev if you think we should add another compiler to this - list or if you think some characterization is unfair here.

- - - - - -

Clang vs GCC (GNU Compiler Collection)

- - -

Pro's of GCC vs clang:

- -
    -
  • GCC supports languages that clang does not aim to, such as Java, Ada, - FORTRAN, etc.
  • -
  • GCC front-ends are very mature and already support C/C++/ObjC and all - the variants we are interested in. clang's - support for C++ in particular is nowhere near what GCC supports.
  • -
  • GCC supports more targets than LLVM.
  • -
  • GCC is popular and widely adopted.
  • -
  • GCC does not require a C++ compiler to build it.
  • -
- -

Pro's of clang vs GCC:

- -
    -
  • The Clang ASTs and design are intended to be easily understandable by - anyone who is familiar with the languages involved and who has a basic - understanding of how a compiler works. GCC has a very old codebase - which presents a steep learning curve to new developers.
  • -
  • Clang is designed as an API from its inception, allowing it to be reused - by source analysis tools, refactoring, IDEs (etc) as well as for code - generation. GCC is built as a monolithic static compiler, which makes - it extremely difficult to use as an API and integrate into other tools. - Further, its historic design and current - policy - makes it difficult to decouple the front-end from the rest of the - compiler.
  • -
  • Various GCC design decisions make it very difficult to reuse: its build - system is difficult to modify, you can't link multiple targets into one - binary, you can't link multiple front-ends into one binary, it uses a - custom garbage collector, uses global variables extensively, is not - reentrant or multi-threadable, etc. Clang has none of these problems. -
  • -
  • For every token, clang tracks information about where it was written and - where it was ultimately expanded into if it was involved in a macro. - GCC does not track information about macro instantiations when parsing - source code. This makes it very difficult for source rewriting tools - (e.g. for refactoring) to work in the presence of (even simple) - macros.
  • -
  • Clang does not implicitly simplify code as it parses it like GCC does. - Doing so causes many problems for source analysis tools: as one simple - example, if you write "x-x" in your source code, the GCC AST will - contain "0", with no mention of 'x'. This is extremely bad for a - refactoring tool that wants to rename 'x'.
  • -
  • Clang can serialize its AST out to disk and read it back into another - program, which is useful for whole program analysis. GCC does not have - this. GCC's PCH mechanism (which is just a dump of the compiler - memory image) is related, but is architecturally only - able to read the dump back into the exact same executable as the one - that produced it (it is not a structured format).
  • -
  • Clang is much faster and uses far - less memory than GCC.
  • -
  • Clang aims to provide extremely clear and concise diagnostics (error and - warning messages), and includes support for expressive diagnostics. GCC's - warnings are acceptable, but are often confusing and it does not support - expressive diagnostics. Clang also preserves typedefs in diagnostics - consistently.
  • -
  • GCC is licensed under the GPL license. clang uses a BSD license, which - allows it to be used by projects that do not themselves want to be - GPL.
  • -
  • Clang inherits a number of features from its use of LLVM as a backend, - including support for a bytecode representation for intermediate code, - pluggable optimizers, link-time optimization support, Just-In-Time - compilation, ability to link in multiple code generators, etc.
  • -
- - -

Clang vs Elsa (Elkhound-based C++ Parser)

- - -

Pro's of Elsa vs clang:

- -
    -
  • Elsa's support for C++ is far beyond what clang provides. If you need - C++ support in the next year, Elsa is a great way to get it. That said, - Elsa is missing important support for templates and other pieces: for - example, it is not capable of compiling the GCC STL headers from any - version newer than GCC 3.4.
  • -
  • Elsa's parser and AST is designed to be easily extensible by adding - grammar rules. Clang has a very simple and easily hackable parser, - but requires you to write C++ code to do it.
  • -
- -

Pro's of clang vs Elsa:

- -
    -
  • The Elsa community is extremely small and major development work seems - to have ceased in 2005, though it continues to be used by other small - projects - (e.g. Oink). Clang has a vibrant community including developers that - are paid to work on it full time. In practice this means that you can - file bugs against Clang and they will often be fixed for you. If you - use Elsa, you are (mostly) on your own for bug fixes and feature - enhancements.
  • -
  • Elsa is not built as a stack of reusable libraries like clang is. It is - very difficult to use part of Elsa without the whole front-end. For - example, you cannot use Elsa to parse C/ObjC code without building an - AST. You can do this in Clang and it is much faster than building an - AST.
  • -
  • Elsa does not have an integrated preprocessor, which makes it extremely - difficult to accurately map from a source location in the AST back to - its original position before preprocessing. Like GCC, it does not keep - track of macro expansions.
  • -
  • Elsa is even slower and uses more memory than GCC, which itself requires - far more space and time than clang.
  • -
  • Elsa only does partial semantic analysis. It is intended to work on - code that is already validated by GCC, so it does not do many semantic - checks required by the languages it implements.
  • -
  • Elsa does not support Objective-C.
  • -
  • Elsa does not support native code generation.
  • -
- -

Note that there is a fork of Elsa known as "Pork". It addresses some of - these shortcomings by loosely integrating a preprocessor. This allows it - to map from a source location in the AST to the original position before - preprocessing, providing it better support for static analysis and - refactoring. Note that Pork is in stasis now too.

- - - -

Clang vs PCC (Portable C Compiler)

- - -

Pro's of PCC vs clang:

- -
    -
  • The PCC source base is very small and builds quickly with just a C - compiler.
  • -
- -

Pro's of clang vs PCC:

- -
    -
  • PCC dates from the 1970's and has been dormant for most of that time. - The clang + llvm communities are very active.
  • -
  • PCC doesn't support C99, Objective-C, and doesn't aim to support - C++.
  • -
  • PCC's code generation is very limited compared to LLVM. It produces very - inefficient code and does not support many important targets.
  • -
  • Like Elsa, PCC's does not have an integrated preprocessor, making it - extremely difficult to use it for source analysis tools.
  • -
- - + + + + + + Comparing clang to other open source compilers + + + + + +
+

Clang vs Other Open Source Compilers

+ +

Building an entirely new compiler front-end is a big task, and it isn't + always clear to people why we decided to do this. Here we compare clang + and its goals to other open source compiler front-ends that are + available. We restrict the discussion to very specific objective points + to avoid controversy where possible. Also, software is infinitely + mutable, so we don't talk about little details that can be fixed with + a reasonable amount of effort: we'll talk about issues that are + difficult to fix for architectural or political reasons.

+ +

The goal of this list is to describe how differences in goals lead to + different strengths and weaknesses, not to make some compiler look bad. + This will hopefully help you to evaluate whether using clang is a good + idea for your personal goals. Because we don't know specifically what + you want to do, we describe the features of these compilers in + terms of our goals: if you are only interested in static + analysis, you may not care that something lacks codegen support, for + example.

+ +

Please email cfe-dev if you think we should add another compiler to this + list or if you think some characterization is unfair here.

+ + + + + +

Clang vs GCC (GNU Compiler Collection)

+ + +

Pro's of GCC vs clang:

+ +
    +
  • GCC supports languages that clang does not aim to, such as Java, Ada, + FORTRAN, etc.
  • +
  • GCC front-ends are very mature and already support C/C++/ObjC and all + the variants we are interested in. clang's + support for C++ in particular is nowhere near what GCC supports.
  • +
  • GCC supports more targets than LLVM.
  • +
  • GCC is popular and widely adopted.
  • +
  • GCC does not require a C++ compiler to build it.
  • +
+ +

Pro's of clang vs GCC:

+ +
    +
  • The Clang ASTs and design are intended to be easily understandable by + anyone who is familiar with the languages involved and who has a basic + understanding of how a compiler works. GCC has a very old codebase + which presents a steep learning curve to new developers.
  • +
  • Clang is designed as an API from its inception, allowing it to be reused + by source analysis tools, refactoring, IDEs (etc) as well as for code + generation. GCC is built as a monolithic static compiler, which makes + it extremely difficult to use as an API and integrate into other tools. + Further, its historic design and current + policy + makes it difficult to decouple the front-end from the rest of the + compiler.
  • +
  • Various GCC design decisions make it very difficult to reuse: its build + system is difficult to modify, you can't link multiple targets into one + binary, you can't link multiple front-ends into one binary, it uses a + custom garbage collector, uses global variables extensively, is not + reentrant or multi-threadable, etc. Clang has none of these problems. +
  • +
  • For every token, clang tracks information about where it was written and + where it was ultimately expanded into if it was involved in a macro. + GCC does not track information about macro instantiations when parsing + source code. This makes it very difficult for source rewriting tools + (e.g. for refactoring) to work in the presence of (even simple) + macros.
  • +
  • Clang does not implicitly simplify code as it parses it like GCC does. + Doing so causes many problems for source analysis tools: as one simple + example, if you write "x-x" in your source code, the GCC AST will + contain "0", with no mention of 'x'. This is extremely bad for a + refactoring tool that wants to rename 'x'.
  • +
  • Clang can serialize its AST out to disk and read it back into another + program, which is useful for whole program analysis. GCC does not have + this. GCC's PCH mechanism (which is just a dump of the compiler + memory image) is related, but is architecturally only + able to read the dump back into the exact same executable as the one + that produced it (it is not a structured format).
  • +
  • Clang is much faster and uses far + less memory than GCC.
  • +
  • Clang aims to provide extremely clear and concise diagnostics (error and + warning messages), and includes support for expressive diagnostics. GCC's + warnings are acceptable, but are often confusing and it does not support + expressive diagnostics. Clang also preserves typedefs in diagnostics + consistently.
  • +
  • GCC is licensed under the GPL license. clang uses a BSD license, which + allows it to be used by projects that do not themselves want to be + GPL.
  • +
  • Clang inherits a number of features from its use of LLVM as a backend, + including support for a bytecode representation for intermediate code, + pluggable optimizers, link-time optimization support, Just-In-Time + compilation, ability to link in multiple code generators, etc.
  • +
+ + +

Clang vs Elsa (Elkhound-based C++ Parser)

+ + +

Pro's of Elsa vs clang:

+ +
    +
  • Elsa's support for C++ is far beyond what clang provides. If you need + C++ support in the next year, Elsa is a great way to get it. That said, + Elsa is missing important support for templates and other pieces: for + example, it is not capable of compiling the GCC STL headers from any + version newer than GCC 3.4.
  • +
  • Elsa's parser and AST is designed to be easily extensible by adding + grammar rules. Clang has a very simple and easily hackable parser, + but requires you to write C++ code to do it.
  • +
+ +

Pro's of clang vs Elsa:

+ +
    +
  • The Elsa community is extremely small and major development work seems + to have ceased in 2005, though it continues to be used by other small + projects + (e.g. Oink). Clang has a vibrant community including developers that + are paid to work on it full time. In practice this means that you can + file bugs against Clang and they will often be fixed for you. If you + use Elsa, you are (mostly) on your own for bug fixes and feature + enhancements.
  • +
  • Elsa is not built as a stack of reusable libraries like clang is. It is + very difficult to use part of Elsa without the whole front-end. For + example, you cannot use Elsa to parse C/ObjC code without building an + AST. You can do this in Clang and it is much faster than building an + AST.
  • +
  • Elsa does not have an integrated preprocessor, which makes it extremely + difficult to accurately map from a source location in the AST back to + its original position before preprocessing. Like GCC, it does not keep + track of macro expansions.
  • +
  • Elsa is even slower and uses more memory than GCC, which itself requires + far more space and time than clang.
  • +
  • Elsa only does partial semantic analysis. It is intended to work on + code that is already validated by GCC, so it does not do many semantic + checks required by the languages it implements.
  • +
  • Elsa does not support Objective-C.
  • +
  • Elsa does not support native code generation.
  • +
+ +

Note that there is a fork of Elsa known as "Pork". It addresses some of + these shortcomings by loosely integrating a preprocessor. This allows it + to map from a source location in the AST to the original position before + preprocessing, providing it better support for static analysis and + refactoring. Note that Pork is in stasis now too.

+ + + +

Clang vs PCC (Portable C Compiler)

+ + +

Pro's of PCC vs clang:

+ +
    +
  • The PCC source base is very small and builds quickly with just a C + compiler.
  • +
+ +

Pro's of clang vs PCC:

+ +
    +
  • PCC dates from the 1970's and has been dormant for most of that time. + The clang + llvm communities are very active.
  • +
  • PCC doesn't support C99, Objective-C, and doesn't aim to support + C++.
  • +
  • PCC's code generation is very limited compared to LLVM. It produces very + inefficient code and does not support many important targets.
  • +
  • Like Elsa, PCC's does not have an integrated preprocessor, making it + extremely difficult to use it for source analysis tools.
  • +
+ + diff --git a/www/content.css b/www/content.css index f8406f31ce..7e5423ff30 100644 --- a/www/content.css +++ b/www/content.css @@ -1,23 +1,23 @@ -html, body { - padding:0px; - font-size:small; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222; - line-height:1.5; -} - -h1, h2, h3, tt { color: #000 } - -h1 { padding-top:0px; margin-top:0px;} -h2 { color:#333333; padding-top:0.5em; } -h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7} -li { padding-bottom: 0.5em; } -ul { padding-left:1.5em; } - -/* Slides */ -IMG.img_slide { - display: block; - margin-left: auto; - margin-right: auto -} - -/* Tables */ +html, body { + padding:0px; + font-size:small; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222; + line-height:1.5; +} + +h1, h2, h3, tt { color: #000 } + +h1 { padding-top:0px; margin-top:0px;} +h2 { color:#333333; padding-top:0.5em; } +h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7} +li { padding-bottom: 0.5em; } +ul { padding-left:1.5em; } + +/* Slides */ +IMG.img_slide { + display: block; + margin-left: auto; + margin-right: auto +} + +/* Tables */ tr { vertical-align:top } diff --git a/www/cxx_status.html b/www/cxx_status.html index 95ce0e5c15..7490b07b37 100644 --- a/www/cxx_status.html +++ b/www/cxx_status.html @@ -1,1706 +1,1706 @@ - - - - - Clang - C++ Support - - - - - - - - -
- - -

C++ Support in Clang

- - -

-This page tracks the status of C++ support in Clang.
-Currently most of the C++ features are missing; here you can find features that are at least partially supported in Clang.

- - - - -

The following table is used to help track our implementation - progress toward implementing the complete C++03 standard. We use a - simple, somewhat arbitrary color-coding scheme to describe the - relative completeness of features by section:

- - - - - - - - - - - - - - - - - - - - -
Not started/not evaluatedNot ApplicableBrokenSome examples workMany examples workNearly everything worksComplete!
N/A
- -

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++ standard. Note that many C++ features are -actually described in several different sections within the standard. The major components are:

- -
-
Parse
-
Clang is able to parse the grammar of this feature (or the grammar described by this section), but does not necessarily do anything with the parsed result. Use Clang's -fsyntax-only option to parse C++ programs.
- -
AST
-
Clang builds an abstract syntax tree (AST) for the feature, but does not necessarily perform any type-checking. Use Clang's -ast-print option to print the resulting ASTs.
- -
Sema
-
Clang parses and type-checks this feature and provides a well-formed AST annotated with types. Use Clang's -fsyntax-only to type-check code.
- -
CodeGen
-
Clang parses, type-checks, and generates code for this feature, allowing one to compile and execute programs.
-
- -

Updates to this table are welcome! Since Clang already supports -much of C, and therefore much C++, many of the currently-white cells -could be filled in. If you wish to do so, please compare Clang's -implementation against the C++ standard and provide a patch that -updates the table accordingly. Tests for the various features are also -welcome!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SectionParseASTSemaCodeGenNotes
2 [lex]N/AN/AN/A
  2.1 [lex.phases]N/AN/AN/AExtended characters aren't handled.
  2.2 [lex.charset]N/AN/AN/ANo support for extended characters.
  2.3 [lex.trigraph]N/AN/AN/A
  2.4 [lex.pptoken]N/AN/AN/A
  2.5 [lex.digraph]N/AN/AN/A
  2.6 [lex.token]N/AN/AN/A
  2.7 [lex.comment]N/AN/ANDR "form feed or vtab in comment" is not diagnosed. No AST representation of comments.
  2.8 [lex.header]N/AN/AN/A
  2.9 [lex.ppnumber]N/AN/AN/A
  2.10 [lex.name]N/AN/AN/ANo support for extended characters
  2.11 [lex.key]N/AN/AN/A
  2.12 [lex.operators]N/AN/AN/A
  2.13 [lex.literal]N/AN/AN/A
    2.13.1 [lex.icon]N/AN/AN/A
    2.13.2 [lex.ccon]N/AN/AN/APoor support for extended characters
    2.13.3 [lex.fcon]N/AN/AN/A
    2.13.4 [lex.string]N/AN/AN/APoor support for extended characters
    2.13.5 [lex.bool]N/AN/AN/A
3 [basic]N/AN/AN/AN/A
  3.1 [basic.def]N/A
  3.2 [basic.def.odr]
  3.3 [basic.scope]N/AN/AN/A
    3.3.1 [basic.scope.pdecl]N/AN/AN/ASee PR3184
    3.3.2 [basic.scope.local]N/AN/AN/Atry-catch not implemented
    3.3.3 [basic.scope.proto]N/AN/AN/A
    3.3.4 [basic.funscope]N/AN/AN/A
    3.3.5 [basic.scope.namespace]
    3.3.6 [basic.scope.class]
    3.3.7 [basic.scope.hiding]N/AN/AN/A
  3.4 [basic.lookup]N/AN/AN/A
    3.4.1 [basic.lookup.unqual]N/AN/AN/AMany cases beyond simple global and function-local lookup don't work
    3.4.2 [basic.lookup.argdep]N/AN/AMissing support for templates, friend functions.
    3.4.3 [basic.lookup.qual]N/AN/AN/A
      3.4.3.1 [class.qual]N/AN/AN/A
      3.4.3.2 [namespace.qual]N/AN/AN/A
    3.4.4 [basic.lookup.elab]
    3.4.5 [basic.lookup.classref]
    3.4.6 [basic.lookup.udir]
  3.5 [basic.link]
  3.6 [basic.start]
    3.6.1 [basic.start.main]
    3.6.2 [basic.start.init]
    3.6.3 [basic.start.term]
  3.7 [basic.stc]
    3.7.1 [basic.stc.static]
    3.7.2 [basic.stc.auto]
    3.7.3 [basic.stc.dynamic]
      3.7.3.1 [basic.stc.dynamic.allocation]
      3.7.3.2 [basic.stc.dynamic.deallocation]
    3.7.4 [basic.stc.inherit]
  3.8 [basic.life]
  3.9 [basic.types]
    3.9.1 [basic.fundamental]
    3.9.2 [basic.compound]
    3.9.3 [basic.type.qualifier]
  3.10 [basic.lval]
4 [conv]
  4.1 [conv.lval]
  4.2 [conv.array]
  4.3 [conv.func]
  4.4 [conv.qual]
  4.5 [conv.prom]
  4.6 [conv.fpprom]
  4.7 [conv.integral]
  4.8 [conv.double]
  4.9 [conv.fpint]
  4.10 [conv.ptr]
  4.11 [conv.mem]
  4.12 [conv.bool]
5 [expr]N/AN/A
  5.1 [expr.prim]template-ids are not supported, name lookup is not complete
  5.2 [expr.post]
    5.2.1 [expr.sub]
    5.2.2 [expr.call]Argument-dependent lookup is unsupported
    5.2.3 [expr.type.conv]Only between non-class types
    5.2.4 [expr.pseudo]
    5.2.5 [expr.ref]Cannot look up operator names, qualified-ids, or names in base classes
    5.2.6 [expr.post.incr]
    5.2.7 [expr.dynamic.cast]
    5.2.8 [expr.typeid]
    5.2.9 [expr.static.cast]Some custom conversions don't work.
    5.2.10 [expr.reinterpret.cast]
    5.2.11 [expr.const.cast]
  5.3 [expr.unary]
    5.3.1 [expr.unary.op]
      5.3.1p1 Unary *
      5.3.1p2-5 Unary &
      5.3.1p6 Unary +
      5.3.1p7 Unary -
      5.3.1p8 Unary !
      5.3.1p9 Unary ~
    5.3.2 [expr.pre.incr]
    5.3.3 [expr.sizeof]
    5.3.4 [expr.new]operator delete is not looked up, initialization not quite correct
    5.3.5 [expr.delete]
  5.4 [expr.cast]Too lenient, and may not always have correct semantics
  5.5 [expr.mptr.oper]Dereferenced member function pointers have the wrong type.
  5.6 [expr.mul]
  5.7 [expr.add]
  5.8 [expr.shift]
  5.9 [expr.rel]
  5.10 [expr.eq]
  5.11 [expr.bit.and]
  5.12 [expr.xor]
  5.13 [expr.or]
  5.14 [expr.log.and]
  5.15 [expr.log.or]
  5.16 [expr.cond]throw expressions not supported, type unification rules are based on C only
  5.17 [expr.ass]
  5.18 [expr.comma]
  5.19 [expr.const]Uses C semantics
6 [stmt.stmt]
  6.1 [stmt.label]
  6.2 [stmt.expr]
  6.3 [stmt.block]
  6.4 [stmt.select]Conversion of declarations to required types not really supported.
    6.4.1 [stmt.if]
    6.4.2 [stmt.switch]
  6.5 [stmt.iter]Conversion of declarations to required types not really supported.
    6.5.1 [stmt.while]
    6.5.2 [stmt.do]
    6.5.3 [stmt.for]
  6.6 [stmt.jump]
    6.6.1 [stmt.break]
    6.6.2 [stmt.cont]
    6.6.3 [stmt.return]
    6.6.4 [stmt.goto]
  6.7 [stmt.dcl]Skipping of initialization is not flagged. Existence and accessibility of destructors is not tested for.
  6.8 [stmt.ambig]
7 [dcl.dcl]
-   7.1 [dcl.spec]No support for friend declarations.
    7.1.1 [dcl.stc]Linkage merging has some errors.
    7.1.2 [dcl.fct.spec]
    7.1.3 [dcl.typedef]Typedefs of anonymous tag types do not use the name of the typedef for linkage purposes.
    7.1.4 [dcl.friend]
    7.1.5 [dcl.type]
      7.1.5.1 [dcl.type.cv]
      7.1.5.2 [dcl.type.simple]Cannot parse template IDs.
      7.1.5.3 [dcl.type.elab]Cannot parse template IDs.
  7.2 [dcl.enum]
  7.3 [basic.namespace]
    7.3.1 [namespace.def]Cannot parse namespace aliases.
      7.3.1.1 [namespace.unnamed]Unnamed namespace members cannot be looked up.
      7.3.1.2 [namespace.memdef]The friend stuff is not supported.
    7.3.2 [namespace.alias]
    7.3.3 [namespace.udecl]
    7.3.4[namespace.udir]Example in p4 fails.
-   7.4 [dcl.asm]
  7.5 [dcl.link]
8 [dcl.decl]
  8.1 [dcl.name]
  8.2 [dcl.ambig.res]
  8.3 [dcl.meaning]
    8.3.1 [dcl.ptr]
    8.3.2 [dcl.ref]
    8.3.3 [dcl.mptr]
    8.3.4 [dcl.array]
    8.3.5 [dcl.fct]
    8.3.6 [dcl.fct.default]Missing default arguments for templates.
  8.4 [dcl.fct.def]
  8.5 [dcl.init]
    8.5.1[dcl.init.aggr]No CodeGen for initializing non-aggregates or dynamic initialization.
    8.5.2 [dcl.init.string]
    8.5.3 [dcl.init.ref]
9 [class]
  9.1 [class.name]
  9.2 [class.mem]No parser support for using declarations, or templates.
  9.3 [class.mfct]
    9.3.1 [class.mfct.non-static]
    9.3.2 [class.this]
  9.4 [class.static]
    9.4.1 [class.static.mfct]
    9.4.2 [class.static.data]
  9.5 [class.union]Semantic analysis does not yet check all of the requirements placed on the members of unions.
  9.6 [class.bit]
  9.7 [class.nest]
  9.8 [class.local]
  9.9 [class.nested.type]
10 [class.derived]
  10.1 [class.mi]
  10.2 [class.member.lookup]
  10.3 [class.virtual]
  10.4 [class.abstract]
11 [class.access]
  11.1 [class.access.spec]
  11.2 [class.access.base]
  11.3 [class.access.dcl]
  11.4 [class.friend]
  11.5 [class.protected]
  11.6 [class.access.virt]
  11.7 [class.paths]
  11.8 [class.access.nest]
12 [special]
  12.1 [class.ctor]
  12.2 [class.temporary]
  12.3 [class.conv]
    12.3.1 [class.conv.ctor]
    12.3.2 [class.conv.fct]Conversion functions can be declared and defined, but aren't used for anything.
  12.4 [class.dtor]Most of the semantics of destructors are unimplemented.
  12.5 [class.free]
  12.6 [class.init]
    12.6.1 [class.expl.init]
    12.6.2 [class.base.init]No actual direct initialization; implicit initialization not checked.
  12.7 [class.cdtor]
  12.8 [class.copy]
13 [over]
  13.1 [over.load]Missing name mangling.
  13.2 [over.dcl]
  13.3 [over.match]
    13.3.1 [over.match.funcs]
      13.3.1.1 [over.match.call]
        13.3.1.1.1 [over.call.func]
        13.3.1.1.2 [over.call.object]Missing AST representation for the implicit conversion to a function reference/pointer
      13.3.1.2 [over.match.oper]
      13.3.1.3 [over.match.ctor]
      13.3.1.4 [over.match.copy]
      13.3.1.5 [over.match.conv]
      13.3.1.6 [over.match.ref]
    13.3.2 [over.match.viable]
    13.3.3 [over.match.best]
      13.3.3.1 [over.best.ics]
        13.3.3.1.1 [over.ics.scs]
        13.3.3.1.2 [over.ics.user]
        13.3.3.1.3 [over.ics.ellipsis]
        13.3.3.1.4 [over.ics.ref]
      13.3.3.2 [over.ics.rank]
  13.4 [over.over]Error messages need some work. Without templates or using - declarations, we don't have any ambiguities, so the semantic - analysis is incomplete.
  13.5 [over.oper]Some overloaded operators can only be called with function syntax, e.g., operator[](x).
    13.5.1 [over.unary]N/A
    13.5.2 [over.binary]N/A
    13.5.3 [over.ass]N/A
    13.5.4 [over.call]N/A
    13.5.5 [over.sub]N/A
    13.5.6 [over.ref]N/A
    13.5.7 [over.inc]N/A
  13.6 [over.built]N/AMissing pointer-to-member versions (p11, p16) and support for - the ternary operator (p24, p25).
14 [temp]
  14.1 [temp.param]
  14.2 [temp.names]
  14.3 [temp.arg]
    14.3.1 [temp.arg.type]
    14.3.2 [temp.arg.nontype]
    14.3.3 [temp.arg.template]
  14.4 [temp.type]
  14.5 [temp.decls]
    14.5.1 [temp.class]
      14.5.1.1 [temp.mem.func]
      14.5.1.2 [temp.mem.class]
      14.5.1.3 [temp.static]
    14.5.2 [temp.mem]
    14.5.3 [temp.friend]
    14.5.4 [temp.class.spec]
      14.5.5.1 [temp.class.spec.match]
      14.5.5.2 [temp.class.order]
      14.5.5.3 [temp.class.spec.mfunc]
    14.5.5 [temp.fct]
      14.5.5.1 [temp.over.link]
      14.5.5.2 [temp.func.order]
  14.6 [temp.res]
    14.6.1 [temp.local]
    14.6.2 [temp.dep]
      14.6.2.1 [temp.dep.type]
      14.6.2.2 [temp.dep.expr]
      14.6.2.3 [temp.dep.constexpr]
      14.6.2.4 [temp.dep.temp]
    14.6.3 [temp.nondep]
    14.6.4 [temp.dep.res]
      14.6.4.1 [temp.point]
      14.6.4.2 [temp.dep.candidate]
    14.6.5 [temp.inject]
  14.7 [temp.spec]
    14.7.1 [temp.inst]
    14.7.2 [temp.explicit]
    14.7.3 [temp.expl.spec]
  14.8 [temp.fct.spec]
    14.8.1 [temp.arg.explicit]
    14.8.2 [temp.deduct]
      14.8.2.1 [temp.deduct.call]
      14.8.2.2 [temp.deduct.funcaddr]
      14.8.2.3 [temp.deduct.conv]
      14.8.2.4 [temp.deduct.type]
    14.8.3 [temp.over]
15 [except]
  15.1 [except.throw]
  15.2 [except.ctor]
  15.3 [except.handle]
  15.4 [except.spec]
  15.5 [except.special]
    15.5.1 [except.terminate]
    15.5.2 [except.unexpected]
    15.5.3 [except.uncaught]
  15.6 [except.access]
16 [cpp]
  16.1 [cpp.cond]
  16.2 [cpp.include]
  16.3 [cpp.replace]
    16.3.1 [cpp.subst]
    16.3.2 [cpp.stringize]
    16.3.3 [cpp.concat]
    16.3.4 [cpp.rescan]
    16.3.5 [cpp.scope]
  16.4 [cpp.line]
  16.5 [cpp.error]
  16.6 [cpp.pragma]
  16.7 [cpp.null]
  16.8 [cpp.predefined]
A [gram]
  A.1 [gram.key]
  A.2 [gram.lex]
  A.3 [gram.basic]
  A.4 [gram.expr]
  A.5 [gram.stmt]
  A.6 [gram.dcl]
  A.7 [gram.decl]
  A.8 [gram.class]
  A.9 [gram.derived]
  A.10 [gram.special]
  A.11 [gram.over]
  A.12 [gram.temp]
  A.13 [gram.except]
  A.14 [gram.cpp]
B [implimits]
C [diff]
  C.1 [diff.iso]
    C.1.1 [diff.lex]
    C.1.2 [diff.basic]
    C.1.3 [diff.expr]
    C.1.4 [diff.stat]
    C.1.5 [diff.dcl]
    C.1.6 [diff.decl]
    C.1.7 [diff.class]
    C.1.8 [diff.special]
    C.1.9 [diff.cpp]
  C.2 [diff.library]
    C.2.1 [diff.mods.to.headers]
    C.2.2 [diff.mods.to.definitions]
      C.2.2.2 [diff.wchar.t]
      C.2.2.3 [diff.header.iso646.h]
      C.2.2.4 [diff.null]
    C.2.3 [diff.mods.to.declarations]
    C.2.4 [diff.mods.to.behavior]
      C.2.4.1 [diff.offsetof]
      C.2.4.2 [diff.malloc]
D [depr]
  D.1 [depr.incr.bool]
  D.2 [depr.static]
  D.3 [depr.access.dcl]
  D.4 [depr.string]
  D.5 [depr.c.headers]
E [extendid]
C++0x Features
Explicit conversion operators (N2437)No name mangling; ASTs don't contain calls to conversion operators
- -
- - + + + + + Clang - C++ Support + + + + + + + + +
+ + +

C++ Support in Clang

+ + +

+This page tracks the status of C++ support in Clang.
+Currently most of the C++ features are missing; here you can find features that are at least partially supported in Clang.

+ + + + +

The following table is used to help track our implementation + progress toward implementing the complete C++03 standard. We use a + simple, somewhat arbitrary color-coding scheme to describe the + relative completeness of features by section:

+ + + + + + + + + + + + + + + + + + + + +
Not started/not evaluatedNot ApplicableBrokenSome examples workMany examples workNearly everything worksComplete!
N/A
+ +

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++ standard. Note that many C++ features are +actually described in several different sections within the standard. The major components are:

+ +
+
Parse
+
Clang is able to parse the grammar of this feature (or the grammar described by this section), but does not necessarily do anything with the parsed result. Use Clang's -fsyntax-only option to parse C++ programs.
+ +
AST
+
Clang builds an abstract syntax tree (AST) for the feature, but does not necessarily perform any type-checking. Use Clang's -ast-print option to print the resulting ASTs.
+ +
Sema
+
Clang parses and type-checks this feature and provides a well-formed AST annotated with types. Use Clang's -fsyntax-only to type-check code.
+ +
CodeGen
+
Clang parses, type-checks, and generates code for this feature, allowing one to compile and execute programs.
+
+ +

Updates to this table are welcome! Since Clang already supports +much of C, and therefore much C++, many of the currently-white cells +could be filled in. If you wish to do so, please compare Clang's +implementation against the C++ standard and provide a patch that +updates the table accordingly. Tests for the various features are also +welcome!

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SectionParseASTSemaCodeGenNotes
2 [lex]N/AN/AN/A
  2.1 [lex.phases]N/AN/AN/AExtended characters aren't handled.
  2.2 [lex.charset]N/AN/AN/ANo support for extended characters.
  2.3 [lex.trigraph]N/AN/AN/A
  2.4 [lex.pptoken]N/AN/AN/A
  2.5 [lex.digraph]N/AN/AN/A
  2.6 [lex.token]N/AN/AN/A
  2.7 [lex.comment]N/AN/ANDR "form feed or vtab in comment" is not diagnosed. No AST representation of comments.
  2.8 [lex.header]N/AN/AN/A
  2.9 [lex.ppnumber]N/AN/AN/A
  2.10 [lex.name]N/AN/AN/ANo support for extended characters
  2.11 [lex.key]N/AN/AN/A
  2.12 [lex.operators]N/AN/AN/A
  2.13 [lex.literal]N/AN/AN/A
    2.13.1 [lex.icon]N/AN/AN/A
    2.13.2 [lex.ccon]N/AN/AN/APoor support for extended characters
    2.13.3 [lex.fcon]N/AN/AN/A
    2.13.4 [lex.string]N/AN/AN/APoor support for extended characters
    2.13.5 [lex.bool]N/AN/AN/A
3 [basic]N/AN/AN/AN/A
  3.1 [basic.def]N/A
  3.2 [basic.def.odr]
  3.3 [basic.scope]N/AN/AN/A
    3.3.1 [basic.scope.pdecl]N/AN/AN/ASee PR3184
    3.3.2 [basic.scope.local]N/AN/AN/Atry-catch not implemented
    3.3.3 [basic.scope.proto]N/AN/AN/A
    3.3.4 [basic.funscope]N/AN/AN/A
    3.3.5 [basic.scope.namespace]
    3.3.6 [basic.scope.class]
    3.3.7 [basic.scope.hiding]N/AN/AN/A
  3.4 [basic.lookup]N/AN/AN/A
    3.4.1 [basic.lookup.unqual]N/AN/AN/AMany cases beyond simple global and function-local lookup don't work
    3.4.2 [basic.lookup.argdep]N/AN/AMissing support for templates, friend functions.
    3.4.3 [basic.lookup.qual]N/AN/AN/A
      3.4.3.1 [class.qual]N/AN/AN/A
      3.4.3.2 [namespace.qual]N/AN/AN/A
    3.4.4 [basic.lookup.elab]
    3.4.5 [basic.lookup.classref]
    3.4.6 [basic.lookup.udir]
  3.5 [basic.link]
  3.6 [basic.start]
    3.6.1 [basic.start.main]
    3.6.2 [basic.start.init]
    3.6.3 [basic.start.term]
  3.7 [basic.stc]
    3.7.1 [basic.stc.static]
    3.7.2 [basic.stc.auto]
    3.7.3 [basic.stc.dynamic]
      3.7.3.1 [basic.stc.dynamic.allocation]
      3.7.3.2 [basic.stc.dynamic.deallocation]
    3.7.4 [basic.stc.inherit]
  3.8 [basic.life]
  3.9 [basic.types]
    3.9.1 [basic.fundamental]
    3.9.2 [basic.compound]
    3.9.3 [basic.type.qualifier]
  3.10 [basic.lval]
4 [conv]
  4.1 [conv.lval]
  4.2 [conv.array]
  4.3 [conv.func]
  4.4 [conv.qual]
  4.5 [conv.prom]
  4.6 [conv.fpprom]
  4.7 [conv.integral]
  4.8 [conv.double]
  4.9 [conv.fpint]
  4.10 [conv.ptr]
  4.11 [conv.mem]
  4.12 [conv.bool]
5 [expr]N/AN/A
  5.1 [expr.prim]template-ids are not supported, name lookup is not complete
  5.2 [expr.post]
    5.2.1 [expr.sub]
    5.2.2 [expr.call]Argument-dependent lookup is unsupported
    5.2.3 [expr.type.conv]Only between non-class types
    5.2.4 [expr.pseudo]
    5.2.5 [expr.ref]Cannot look up operator names, qualified-ids, or names in base classes
    5.2.6 [expr.post.incr]
    5.2.7 [expr.dynamic.cast]
    5.2.8 [expr.typeid]
    5.2.9 [expr.static.cast]Some custom conversions don't work.
    5.2.10 [expr.reinterpret.cast]
    5.2.11 [expr.const.cast]
  5.3 [expr.unary]
    5.3.1 [expr.unary.op]
      5.3.1p1 Unary *
      5.3.1p2-5 Unary &
      5.3.1p6 Unary +
      5.3.1p7 Unary -
      5.3.1p8 Unary !
      5.3.1p9 Unary ~
    5.3.2 [expr.pre.incr]
    5.3.3 [expr.sizeof]
    5.3.4 [expr.new]operator delete is not looked up, initialization not quite correct
    5.3.5 [expr.delete]
  5.4 [expr.cast]Too lenient, and may not always have correct semantics
  5.5 [expr.mptr.oper]Dereferenced member function pointers have the wrong type.
  5.6 [expr.mul]
  5.7 [expr.add]
  5.8 [expr.shift]
  5.9 [expr.rel]
  5.10 [expr.eq]
  5.11 [expr.bit.and]
  5.12 [expr.xor]
  5.13 [expr.or]
  5.14 [expr.log.and]
  5.15 [expr.log.or]
  5.16 [expr.cond]throw expressions not supported, type unification rules are based on C only
  5.17 [expr.ass]
  5.18 [expr.comma]
  5.19 [expr.const]Uses C semantics
6 [stmt.stmt]
  6.1 [stmt.label]
  6.2 [stmt.expr]
  6.3 [stmt.block]
  6.4 [stmt.select]Conversion of declarations to required types not really supported.
    6.4.1 [stmt.if]
    6.4.2 [stmt.switch]
  6.5 [stmt.iter]Conversion of declarations to required types not really supported.
    6.5.1 [stmt.while]
    6.5.2 [stmt.do]
    6.5.3 [stmt.for]
  6.6 [stmt.jump]
    6.6.1 [stmt.break]
    6.6.2 [stmt.cont]
    6.6.3 [stmt.return]
    6.6.4 [stmt.goto]
  6.7 [stmt.dcl]Skipping of initialization is not flagged. Existence and accessibility of destructors is not tested for.
  6.8 [stmt.ambig]
7 [dcl.dcl]
+   7.1 [dcl.spec]No support for friend declarations.
    7.1.1 [dcl.stc]Linkage merging has some errors.
    7.1.2 [dcl.fct.spec]
    7.1.3 [dcl.typedef]Typedefs of anonymous tag types do not use the name of the typedef for linkage purposes.
    7.1.4 [dcl.friend]
    7.1.5 [dcl.type]
      7.1.5.1 [dcl.type.cv]
      7.1.5.2 [dcl.type.simple]Cannot parse template IDs.
      7.1.5.3 [dcl.type.elab]Cannot parse template IDs.
  7.2 [dcl.enum]
  7.3 [basic.namespace]
    7.3.1 [namespace.def]Cannot parse namespace aliases.
      7.3.1.1 [namespace.unnamed]Unnamed namespace members cannot be looked up.
      7.3.1.2 [namespace.memdef]The friend stuff is not supported.
    7.3.2 [namespace.alias]
    7.3.3 [namespace.udecl]
    7.3.4[namespace.udir]Example in p4 fails.
+   7.4 [dcl.asm]
  7.5 [dcl.link]
8 [dcl.decl]
  8.1 [dcl.name]
  8.2 [dcl.ambig.res]
  8.3 [dcl.meaning]
    8.3.1 [dcl.ptr]
    8.3.2 [dcl.ref]
    8.3.3 [dcl.mptr]
    8.3.4 [dcl.array]
    8.3.5 [dcl.fct]
    8.3.6 [dcl.fct.default]Missing default arguments for templates.
  8.4 [dcl.fct.def]
  8.5 [dcl.init]
    8.5.1[dcl.init.aggr]No CodeGen for initializing non-aggregates or dynamic initialization.
    8.5.2 [dcl.init.string]
    8.5.3 [dcl.init.ref]
9 [class]
  9.1 [class.name]
  9.2 [class.mem]No parser support for using declarations, or templates.
  9.3 [class.mfct]
    9.3.1 [class.mfct.non-static]
    9.3.2 [class.this]
  9.4 [class.static]
    9.4.1 [class.static.mfct]
    9.4.2 [class.static.data]
  9.5 [class.union]Semantic analysis does not yet check all of the requirements placed on the members of unions.
  9.6 [class.bit]
  9.7 [class.nest]
  9.8 [class.local]
  9.9 [class.nested.type]
10 [class.derived]
  10.1 [class.mi]
  10.2 [class.member.lookup]
  10.3 [class.virtual]
  10.4 [class.abstract]
11 [class.access]
  11.1 [class.access.spec]
  11.2 [class.access.base]
  11.3 [class.access.dcl]
  11.4 [class.friend]
  11.5 [class.protected]
  11.6 [class.access.virt]
  11.7 [class.paths]
  11.8 [class.access.nest]
12 [special]
  12.1 [class.ctor]
  12.2 [class.temporary]
  12.3 [class.conv]
    12.3.1 [class.conv.ctor]
    12.3.2 [class.conv.fct]Conversion functions can be declared and defined, but aren't used for anything.
  12.4 [class.dtor]Most of the semantics of destructors are unimplemented.
  12.5 [class.free]
  12.6 [class.init]
    12.6.1 [class.expl.init]
    12.6.2 [class.base.init]No actual direct initialization; implicit initialization not checked.
  12.7 [class.cdtor]
  12.8 [class.copy]
13 [over]
  13.1 [over.load]Missing name mangling.
  13.2 [over.dcl]
  13.3 [over.match]
    13.3.1 [over.match.funcs]
      13.3.1.1 [over.match.call]
        13.3.1.1.1 [over.call.func]
        13.3.1.1.2 [over.call.object]Missing AST representation for the implicit conversion to a function reference/pointer
      13.3.1.2 [over.match.oper]
      13.3.1.3 [over.match.ctor]
      13.3.1.4 [over.match.copy]
      13.3.1.5 [over.match.conv]
      13.3.1.6 [over.match.ref]
    13.3.2 [over.match.viable]
    13.3.3 [over.match.best]
      13.3.3.1 [over.best.ics]
        13.3.3.1.1 [over.ics.scs]
        13.3.3.1.2 [over.ics.user]
        13.3.3.1.3 [over.ics.ellipsis]
        13.3.3.1.4 [over.ics.ref]
      13.3.3.2 [over.ics.rank]
  13.4 [over.over]Error messages need some work. Without templates or using + declarations, we don't have any ambiguities, so the semantic + analysis is incomplete.
  13.5 [over.oper]Some overloaded operators can only be called with function syntax, e.g., operator[](x).
    13.5.1 [over.unary]N/A
    13.5.2 [over.binary]N/A
    13.5.3 [over.ass]N/A
    13.5.4 [over.call]N/A
    13.5.5 [over.sub]N/A
    13.5.6 [over.ref]N/A
    13.5.7 [over.inc]N/A
  13.6 [over.built]N/AMissing pointer-to-member versions (p11, p16) and support for + the ternary operator (p24, p25).
14 [temp]
  14.1 [temp.param]
  14.2 [temp.names]
  14.3 [temp.arg]
    14.3.1 [temp.arg.type]
    14.3.2 [temp.arg.nontype]
    14.3.3 [temp.arg.template]
  14.4 [temp.type]
  14.5 [temp.decls]
    14.5.1 [temp.class]
      14.5.1.1 [temp.mem.func]
      14.5.1.2 [temp.mem.class]
      14.5.1.3 [temp.static]
    14.5.2 [temp.mem]
    14.5.3 [temp.friend]
    14.5.4 [temp.class.spec]
      14.5.5.1 [temp.class.spec.match]
      14.5.5.2 [temp.class.order]
      14.5.5.3 [temp.class.spec.mfunc]
    14.5.5 [temp.fct]
      14.5.5.1 [temp.over.link]
      14.5.5.2 [temp.func.order]
  14.6 [temp.res]
    14.6.1 [temp.local]
    14.6.2 [temp.dep]
      14.6.2.1 [temp.dep.type]
      14.6.2.2 [temp.dep.expr]
      14.6.2.3 [temp.dep.constexpr]
      14.6.2.4 [temp.dep.temp]
    14.6.3 [temp.nondep]
    14.6.4 [temp.dep.res]
      14.6.4.1 [temp.point]
      14.6.4.2 [temp.dep.candidate]
    14.6.5 [temp.inject]
  14.7 [temp.spec]
    14.7.1 [temp.inst]
    14.7.2 [temp.explicit]
    14.7.3 [temp.expl.spec]
  14.8 [temp.fct.spec]
    14.8.1 [temp.arg.explicit]
    14.8.2 [temp.deduct]
      14.8.2.1 [temp.deduct.call]
      14.8.2.2 [temp.deduct.funcaddr]
      14.8.2.3 [temp.deduct.conv]
      14.8.2.4 [temp.deduct.type]
    14.8.3 [temp.over]
15 [except]
  15.1 [except.throw]
  15.2 [except.ctor]
  15.3 [except.handle]
  15.4 [except.spec]
  15.5 [except.special]
    15.5.1 [except.terminate]
    15.5.2 [except.unexpected]
    15.5.3 [except.uncaught]
  15.6 [except.access]
16 [cpp]
  16.1 [cpp.cond]
  16.2 [cpp.include]
  16.3 [cpp.replace]
    16.3.1 [cpp.subst]
    16.3.2 [cpp.stringize]
    16.3.3 [cpp.concat]
    16.3.4 [cpp.rescan]
    16.3.5 [cpp.scope]
  16.4 [cpp.line]
  16.5 [cpp.error]
  16.6 [cpp.pragma]
  16.7 [cpp.null]
  16.8 [cpp.predefined]
A [gram]
  A.1 [gram.key]
  A.2 [gram.lex]
  A.3 [gram.basic]
  A.4 [gram.expr]
  A.5 [gram.stmt]
  A.6 [gram.dcl]
  A.7 [gram.decl]
  A.8 [gram.class]
  A.9 [gram.derived]
  A.10 [gram.special]
  A.11 [gram.over]
  A.12 [gram.temp]
  A.13 [gram.except]
  A.14 [gram.cpp]
B [implimits]
C [diff]
  C.1 [diff.iso]
    C.1.1 [diff.lex]
    C.1.2 [diff.basic]
    C.1.3 [diff.expr]
    C.1.4 [diff.stat]
    C.1.5 [diff.dcl]
    C.1.6 [diff.decl]
    C.1.7 [diff.class]
    C.1.8 [diff.special]
    C.1.9 [diff.cpp]
  C.2 [diff.library]
    C.2.1 [diff.mods.to.headers]
    C.2.2 [diff.mods.to.definitions]
      C.2.2.2 [diff.wchar.t]
      C.2.2.3 [diff.header.iso646.h]
      C.2.2.4 [diff.null]
    C.2.3 [diff.mods.to.declarations]
    C.2.4 [diff.mods.to.behavior]
      C.2.4.1 [diff.offsetof]
      C.2.4.2 [diff.malloc]
D [depr]
  D.1 [depr.incr.bool]
  D.2 [depr.static]
  D.3 [depr.access.dcl]
  D.4 [depr.string]
  D.5 [depr.c.headers]
E [extendid]
C++0x Features
Explicit conversion operators (N2437)No name mangling; ASTs don't contain calls to conversion operators
+ +
+ + diff --git a/www/demo/what is this directory.txt b/www/demo/what is this directory.txt index 47d5d4ed2d..a1306ac0dc 100644 --- a/www/demo/what is this directory.txt +++ b/www/demo/what is this directory.txt @@ -1,15 +1,15 @@ -This is for the LLVM+Clang browser based demo. -It is supposed to work like the LLVM+GCC demo here: http://llvm.org/demo/ but for the BSD licensed Clang instead. - -Perhaps it could also be used for getting crash information and details on errors.... I'm not sure if this would require some major changes or not to report this info. Maybe also adding ways that people can use it to test for errors and a way to report such errors would also be good. - -Status: -Anyways, right now, these file a basically just a copy of the LLVM+GCC demo (no changes have been made). The files don't even work right in this location on the server. As such, someone will need to edit the file or rewrite it. - -If nobody in the LLVM community has the skills, one suggestion would be to post a request on a friendly Perl forum and see if anybody might be interested in taking on the challenge. - -Alternatively, you could try a PHP, Python, Ruby, or Lisp mailing list and see if there are any takers who would be interested (and willing to do a rewrite to their language of choice). - --- -BTW, once this feature was working, my intention was to link to it from the index.html page in the section entitled: +This is for the LLVM+Clang browser based demo. +It is supposed to work like the LLVM+GCC demo here: http://llvm.org/demo/ but for the BSD licensed Clang instead. + +Perhaps it could also be used for getting crash information and details on errors.... I'm not sure if this would require some major changes or not to report this info. Maybe also adding ways that people can use it to test for errors and a way to report such errors would also be good. + +Status: +Anyways, right now, these file a basically just a copy of the LLVM+GCC demo (no changes have been made). The files don't even work right in this location on the server. As such, someone will need to edit the file or rewrite it. + +If nobody in the LLVM community has the skills, one suggestion would be to post a request on a friendly Perl forum and see if anybody might be interested in taking on the challenge. + +Alternatively, you could try a PHP, Python, Ruby, or Lisp mailing list and see if there are any takers who would be interested (and willing to do a rewrite to their language of choice). + +-- +BTW, once this feature was working, my intention was to link to it from the index.html page in the section entitled: Try Clang \ No newline at end of file diff --git a/www/distclang_status.html b/www/distclang_status.html index f8675ce7ad..26ba31424f 100644 --- a/www/distclang_status.html +++ b/www/distclang_status.html @@ -1,30 +1,30 @@ - - - - - Clang - Distributed Compilation Support - - - - - - - - -
- - -

Distributed Compilation Support in Clang

- - -

-This page tracks the status of Distributed Compilation support in Clang.
-Currently some basic features are working but the code is under heavy -development.

- - -
- - + + + + + Clang - Distributed Compilation Support + + + + + + + + +
+ + +

Distributed Compilation Support in Clang

+ + +

+This page tracks the status of Distributed Compilation support in Clang.
+Currently some basic features are working but the code is under heavy +development.

+ + +
+ + diff --git a/www/get_involved.html b/www/get_involved.html index 94268e82e6..643f6b4c4d 100644 --- a/www/get_involved.html +++ b/www/get_involved.html @@ -1,173 +1,173 @@ - - - - - Clang - Get Involved - - - - - - - -
- -

Getting Involved with the Clang Project

- -

Once you have checked out and built clang and -played around with it, you might be wondering what you can do to make it better -and contribute to its development. Alternatively, maybe you just want to follow -the development of the project to see it progress. -

- -

Follow what's going on

- -

Clang is a subproject of the LLVM Project, but -has its own mailing lists because the communities have people with different -interests. The two clang lists are:

- -
    -
  • cfe-commits - - This list is for patch submission/discussion.
  • - -
  • cfe-dev - -This list is for everything else clang related (questions and answers, bug -reports, etc).
  • - -
- -

If you are interested in clang only, these two lists should be all -you need. If you are interested in the LLVM optimizer and code generator, -please consider signing up for llvmdev and llvm-commits -as well.

- - -

The best way to talk with other developers on the project is through the cfe-dev mailing -list. The clang mailing list is a very friendly place and we welcome -newcomers. In addition to the cfe-dev list, a significant amount of design -discussion takes place on the cfe-commits mailing -list. All of these lists have archives, so you can browse through previous -discussions or follow the list development on the web if you prefer.

- - -

Open Projects

- -

Here are a few tasks that are available for newcomers to work on, depending -on what your interests are. This list is provided to generate ideas, it is not -intended to be comprehensive. Please ask on cfe-dev for more specifics or to -verify that one of these isn't already completed. :)

- -
    -
  • Compile your favorite C/ObjC project with "clang -fsyntax-only": -the clang type checker and verifier is quite close to complete (but not bug -free!) for C and Objective C. We appreciate all reports of code that is -rejected by the front-end, and if you notice invalid code that is not rejected -by clang, that is also very important to us. For make-based projects, -the ccc script in clang's -utils folder might help to get you started.
  • - -
  • Compile your favorite C project with "clang -emit-llvm": -The clang to LLVM converter is getting more mature, so you may be able to -compile it. If not, please let us know. Again, -ccc might help you. Once it -compiles it should run. If not, that's a bug :)
  • - -
  • Debug Info Generation: -emit-llvm doesn't fully support emission -of LLVM debug info -(which the code generator turns into DWARF). The missing pieces are pretty -minor at this point.
  • - -
  • Overflow detection: an interesting project would be to add a -ftrapv -compilation mode that causes -emit-llvm to generate overflow tests for all -signed integer arithmetic operators, and call abort if they overflow. Overflow -is undefined in C and hard for people to reason about. LLVM IR also has -intrinsics for generating arithmetic with overflow checks directly.
  • - -
  • Undefined behavior checking: similar to adding -ftrapv, codegen could -insert runtime checks for all sorts of different undefined behaviors, from -reading uninitialized variables, buffer overflows, and many other things. This -checking would be expensive, but the optimizers could eliminate many of the -checks in some cases, and it would be very interesting to test code in this mode -for certain crowds of people. Because the inserted code is coming from clang, -the "abort" message could be very detailed about exactly what went wrong.
  • - -
  • Continue work on C++ support: Implementing all of C++ is a very big -job, but there are lots of little pieces that can be picked off and implemented. -See the C++ status report page to find out what is -missing and what is already at least partially supported.
  • - -
  • Improve target support: The current target interfaces are heavily -stubbed out and need to be implemented fully. See the FIXME's in TargetInfo. -Additionally, the actual target implementations (instances of TargetInfoImpl) -also need to be completed. This includes defining builtin macros for linux -targets and other stuff like that.
  • - -
  • Implement 'builtin' headers: GCC provides a bunch of builtin headers, -such as stdbool.h, iso646.h, float.h, limits.h, etc. It also provides a bunch -of target-specific headers like altivec.h and xmmintrin.h. clang will -eventually need to provide its own copies of these (and there is a lot of -improvement that can be made to the GCC ones!) that are clean-room -implemented to avoid GPL taint.
  • - -
  • Implement a clang 'libgcc': As with the headers, clang (or a another -related subproject of llvm) will need to implement the features that libgcc -provides. libgcc provides a bunch of routines the code generator uses for -"fallback" when the chip doesn't support some operation (e.g. 64-bit divide on -a 32-bit chip). It also provides software floating point support and many other -things. I don't think that there is a specific licensing reason to reimplement -libgcc, but there is a lot of room for improvement in it in many -dimensions.
  • - -
  • Implement an tool to generate code documentation: Clang's -library-based design allows it to be used by a variety of tools that reason -about source code. One great application of Clang would be to build an -auto-documentation system like doxygen that generates code documentation from -source code. The advantage of using Clang for such a tool is that the tool would -use the same preprocessor/parser/ASTs as the compiler itself, giving it a very -rich understanding of the code.
  • - -
  • Use clang libraries to implement better versions of existing tools: -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 distcc -and the delta testcase reduction tool. -The former can be improved to scale better and be more efficient. The later -could also be faster and more efficient at reducing C-family programs if built -on the clang preprocessor.
  • - -
  • Use clang libraries to extend Ragel with a JIT: Ragel is a state -machine compiler that lets you embed C code into state machines and generate -C code. It would be relatively easy to turn this into a JIT compiler using -LLVM.
  • - -
  • Self-testing using clang: There are several neat ways to -improve the quality of clang by self-testing. Some examples: -
      -
    • Improve the reliability of AST printing and serialization by - ensuring that the AST produced by clang on an input doesn't change - when it is reparsed or unserialized. - -
    • Improve parser reliability and error generation by automatically - or randomly changing the input checking that clang doesn't crash and - that it doesn't generate excessive errors for small input - changes. Manipulating the input at both the text and token levels is - likely to produce interesting test cases. -
    -
  • - -
- -

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.

- -
- - + + + + + Clang - Get Involved + + + + + + + +
+ +

Getting Involved with the Clang Project

+ +

Once you have checked out and built clang and +played around with it, you might be wondering what you can do to make it better +and contribute to its development. Alternatively, maybe you just want to follow +the development of the project to see it progress. +

+ +

Follow what's going on

+ +

Clang is a subproject of the LLVM Project, but +has its own mailing lists because the communities have people with different +interests. The two clang lists are:

+ +
    +
  • cfe-commits + - This list is for patch submission/discussion.
  • + +
  • cfe-dev - +This list is for everything else clang related (questions and answers, bug +reports, etc).
  • + +
+ +

If you are interested in clang only, these two lists should be all +you need. If you are interested in the LLVM optimizer and code generator, +please consider signing up for llvmdev and llvm-commits +as well.

+ + +

The best way to talk with other developers on the project is through the cfe-dev mailing +list. The clang mailing list is a very friendly place and we welcome +newcomers. In addition to the cfe-dev list, a significant amount of design +discussion takes place on the cfe-commits mailing +list. All of these lists have archives, so you can browse through previous +discussions or follow the list development on the web if you prefer.

+ + +

Open Projects

+ +

Here are a few tasks that are available for newcomers to work on, depending +on what your interests are. This list is provided to generate ideas, it is not +intended to be comprehensive. Please ask on cfe-dev for more specifics or to +verify that one of these isn't already completed. :)

+ +
    +
  • Compile your favorite C/ObjC project with "clang -fsyntax-only": +the clang type checker and verifier is quite close to complete (but not bug +free!) for C and Objective C. We appreciate all reports of code that is +rejected by the front-end, and if you notice invalid code that is not rejected +by clang, that is also very important to us. For make-based projects, +the ccc script in clang's +utils folder might help to get you started.
  • + +
  • Compile your favorite C project with "clang -emit-llvm": +The clang to LLVM converter is getting more mature, so you may be able to +compile it. If not, please let us know. Again, +ccc might help you. Once it +compiles it should run. If not, that's a bug :)
  • + +
  • Debug Info Generation: -emit-llvm doesn't fully support emission +of LLVM debug info +(which the code generator turns into DWARF). The missing pieces are pretty +minor at this point.
  • + +
  • Overflow detection: an interesting project would be to add a -ftrapv +compilation mode that causes -emit-llvm to generate overflow tests for all +signed integer arithmetic operators, and call abort if they overflow. Overflow +is undefined in C and hard for people to reason about. LLVM IR also has +intrinsics for generating arithmetic with overflow checks directly.
  • + +
  • Undefined behavior checking: similar to adding -ftrapv, codegen could +insert runtime checks for all sorts of different undefined behaviors, from +reading uninitialized variables, buffer overflows, and many other things. This +checking would be expensive, but the optimizers could eliminate many of the +checks in some cases, and it would be very interesting to test code in this mode +for certain crowds of people. Because the inserted code is coming from clang, +the "abort" message could be very detailed about exactly what went wrong.
  • + +
  • Continue work on C++ support: Implementing all of C++ is a very big +job, but there are lots of little pieces that can be picked off and implemented. +See the C++ status report page to find out what is +missing and what is already at least partially supported.
  • + +
  • Improve target support: The current target interfaces are heavily +stubbed out and need to be implemented fully. See the FIXME's in TargetInfo. +Additionally, the actual target implementations (instances of TargetInfoImpl) +also need to be completed. This includes defining builtin macros for linux +targets and other stuff like that.
  • + +
  • Implement 'builtin' headers: GCC provides a bunch of builtin headers, +such as stdbool.h, iso646.h, float.h, limits.h, etc. It also provides a bunch +of target-specific headers like altivec.h and xmmintrin.h. clang will +eventually need to provide its own copies of these (and there is a lot of +improvement that can be made to the GCC ones!) that are clean-room +implemented to avoid GPL taint.
  • + +
  • Implement a clang 'libgcc': As with the headers, clang (or a another +related subproject of llvm) will need to implement the features that libgcc +provides. libgcc provides a bunch of routines the code generator uses for +"fallback" when the chip doesn't support some operation (e.g. 64-bit divide on +a 32-bit chip). It also provides software floating point support and many other +things. I don't think that there is a specific licensing reason to reimplement +libgcc, but there is a lot of room for improvement in it in many +dimensions.
  • + +
  • Implement an tool to generate code documentation: Clang's +library-based design allows it to be used by a variety of tools that reason +about source code. One great application of Clang would be to build an +auto-documentation system like doxygen that generates code documentation from +source code. The advantage of using Clang for such a tool is that the tool would +use the same preprocessor/parser/ASTs as the compiler itself, giving it a very +rich understanding of the code.
  • + +
  • Use clang libraries to implement better versions of existing tools: +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 distcc +and the delta testcase reduction tool. +The former can be improved to scale better and be more efficient. The later +could also be faster and more efficient at reducing C-family programs if built +on the clang preprocessor.
  • + +
  • Use clang libraries to extend Ragel with a JIT: Ragel is a state +machine compiler that lets you embed C code into state machines and generate +C code. It would be relatively easy to turn this into a JIT compiler using +LLVM.
  • + +
  • Self-testing using clang: There are several neat ways to +improve the quality of clang by self-testing. Some examples: +
      +
    • Improve the reliability of AST printing and serialization by + ensuring that the AST produced by clang on an input doesn't change + when it is reparsed or unserialized. + +
    • Improve parser reliability and error generation by automatically + or randomly changing the input checking that clang doesn't crash and + that it doesn't generate excessive errors for small input + changes. Manipulating the input at both the text and token levels is + likely to produce interesting test cases. +
    +
  • + +
+ +

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.

+ +
+ + diff --git a/www/hacking.html b/www/hacking.html index 020d3cbfb2..db83861502 100644 --- a/www/hacking.html +++ b/www/hacking.html @@ -1,101 +1,101 @@ - - - - - - Hacking on clang - - - - - -
- -

Hacking on Clang

- - -

This document provides some hints for how to get started hacking - on Clang for developers who are new to the Clang and/or LLVM - codebases.

- - - -

Developer Documentation

- - -

Both Clang and LLVM use doxygen to provide API documentation. Their - respective web pages (generated nightly) are here:

- - -

For work on the LLVM IR generation, the LLVM assembly language - reference manual is - also useful.

- - -

Debugging

- - -

Inspecting data structures in a debugger:

-
    -
  • Many LLVM and Clang data structures provide - a dump() method which will print a description of the - data structure to stderr.
  • -
  • The QualType - structure is used pervasively. This is a simple value class for - wrapping types with qualifiers; you can use - the isConstQualified(), for example, to get one of the - qualifiers, and the getTypePtr() method to get the - wrapped Type* which you can then dump.
  • -
- - -

Testing

- - -

Clang includes a basic regression suite in the tree which can be - run with make test from the top-level clang directory, or - just make in the test sub-directory. make - report can be used after running the tests to summarize the - results, and make VERBOSE=1 can be used to show more detail - about what is being run.

- -

The regression suite can also be run with Valgrind by running - make test VG=1 in the top-level clang directory.

- -

For more intensive changes, running - the LLVM - Test Suite with clang is recommended. Currently the best way to - override LLVMGCC, as in: make LLVMGCC="ccc -std=gnu89" - TEST=nightly report (make sure ccc is in your PATH or use the - full path).

- - -

LLVM IR Generation

- - -

The LLVM IR generation part of clang handles conversion of the - AST nodes output by the Sema module to the LLVM Intermediate - Representation (IR). Historically, this was referred to as - "codegen", and the Clang code for this lives - in lib/CodeGen.

- -

The output is most easily inspected using the -emit-llvm - option to clang (possibly in conjunction with -o -). You - can also use -emit-llvm-bc to write an LLVM bitcode file - which can be processed by the suite of LLVM tools - like llvm-dis, llvm-nm, etc. See the LLVM - Command Guide - for more information.

- -
- - + + + + + + Hacking on clang + + + + + +
+ +

Hacking on Clang

+ + +

This document provides some hints for how to get started hacking + on Clang for developers who are new to the Clang and/or LLVM + codebases.

+ + + +

Developer Documentation

+ + +

Both Clang and LLVM use doxygen to provide API documentation. Their + respective web pages (generated nightly) are here:

+ + +

For work on the LLVM IR generation, the LLVM assembly language + reference manual is + also useful.

+ + +

Debugging

+ + +

Inspecting data structures in a debugger:

+
    +
  • Many LLVM and Clang data structures provide + a dump() method which will print a description of the + data structure to stderr.
  • +
  • The QualType + structure is used pervasively. This is a simple value class for + wrapping types with qualifiers; you can use + the isConstQualified(), for example, to get one of the + qualifiers, and the getTypePtr() method to get the + wrapped Type* which you can then dump.
  • +
+ + +

Testing

+ + +

Clang includes a basic regression suite in the tree which can be + run with make test from the top-level clang directory, or + just make in the test sub-directory. make + report can be used after running the tests to summarize the + results, and make VERBOSE=1 can be used to show more detail + about what is being run.

+ +

The regression suite can also be run with Valgrind by running + make test VG=1 in the top-level clang directory.

+ +

For more intensive changes, running + the LLVM + Test Suite with clang is recommended. Currently the best way to + override LLVMGCC, as in: make LLVMGCC="ccc -std=gnu89" + TEST=nightly report (make sure ccc is in your PATH or use the + full path).

+ + +

LLVM IR Generation

+ + +

The LLVM IR generation part of clang handles conversion of the + AST nodes output by the Sema module to the LLVM Intermediate + Representation (IR). Historically, this was referred to as + "codegen", and the Clang code for this lives + in lib/CodeGen.

+ +

The output is most easily inspected using the -emit-llvm + option to clang (possibly in conjunction with -o -). You + can also use -emit-llvm-bc to write an LLVM bitcode file + which can be processed by the suite of LLVM tools + like llvm-dis, llvm-nm, etc. See the LLVM + Command Guide + for more information.

+ +
+ + diff --git a/www/index.html b/www/index.html index a0408e0cea..32c268a740 100644 --- a/www/index.html +++ b/www/index.html @@ -1,120 +1,120 @@ - - - - - - "clang" C Language Family Frontend for LLVM - - - - - -
- -

clang: a C language family frontend for LLVM

- - -

The goal of the Clang project is to create a new C, C++, Objective C and - Objective C++ front-end for the LLVM - compiler. You can get and build the source - today.

- - -

Features and Goals

- - -

Some of the goals for the project include the following:

- -

End-User Features:

- -
    -
  • Fast compiles and low memory use
  • -
  • Expressive diagnostics
  • -
  • GCC compatibility
  • -
- -

Utility and - Applications:

- -
    -
  • Modular library based architecture
  • -
  • Support diverse clients (refactoring, static analysis, code generation, - etc)
  • -
  • Allow tight integration with IDEs
  • -
  • Use the LLVM 'BSD' License
  • -
- -

Internal Design and - Implementation:

- -
    -
  • A real-world, production quality compiler
  • -
  • A simple and hackable code base
  • -
  • A single unified parser for C, Objective C, C++, and Objective C++
  • -
  • Conformance with C/C++/ObjC and their variants
  • -
- -

Of course this is only a rough outline of the goals and features of - Clang. To get a true sense of what it is all about, see the Features section, which breaks - each of these down and explains them in more detail.

- - - -

Why?

- - -

The development of a new front-end was started out of a need -- a need - for a compiler that allows better diagnostics, better integration with - IDEs, a license that is compatible with commercial products, and a - nimble compiler that is easy to develop and maintain. All of these were - motivations for starting work on a new front-end that could - meet these needs.

- -

A good (but quite dated) introduction to Clang can be found in the - following video lectures:

- - - -

For a more detailed comparison between Clang and other compilers, please - see the clang comparison page.

- - -

Current Status

- - -

Clang is still in early development stages. If you are looking for - source analysis or source-to-source transformation tools, clang is probably - a great solution for you. If you want to use it as a drop in C compiler, it - is not yet ready.

- -

Clang currently has pretty good parsing and semantic analysis support for - C and Objective-C right now, and bugs are usually quickly fixed once - reported. C++ support is still very early, - and we don't expect to have respectable C++ support for another 2 years - or so.

- - -

Get it and get involved!

- - -

Start by getting the code, building it, and - playing with it. This will show you the sorts of things we can do - today and will let you have the "clang experience" first hand: hopefully - it will "resonate" with you. :)

- -

Once you've done that, please consider getting - involved in the clang community. The clang developers include numerous - volunteer contributors with a variety of backgrounds. If you're - interested in - following the development of clang, signing up for a mailing list is a good - way to learn about how the project works.

-
- - + + + + + + "clang" C Language Family Frontend for LLVM + + + + + +
+ +

clang: a C language family frontend for LLVM

+ + +

The goal of the Clang project is to create a new C, C++, Objective C and + Objective C++ front-end for the LLVM + compiler. You can get and build the source + today.

+ + +

Features and Goals

+ + +

Some of the goals for the project include the following:

+ +

End-User Features:

+ +
    +
  • Fast compiles and low memory use
  • +
  • Expressive diagnostics
  • +
  • GCC compatibility
  • +
+ +

Utility and + Applications:

+ +
    +
  • Modular library based architecture
  • +
  • Support diverse clients (refactoring, static analysis, code generation, + etc)
  • +
  • Allow tight integration with IDEs
  • +
  • Use the LLVM 'BSD' License
  • +
+ +

Internal Design and + Implementation:

+ +
    +
  • A real-world, production quality compiler
  • +
  • A simple and hackable code base
  • +
  • A single unified parser for C, Objective C, C++, and Objective C++
  • +
  • Conformance with C/C++/ObjC and their variants
  • +
+ +

Of course this is only a rough outline of the goals and features of + Clang. To get a true sense of what it is all about, see the Features section, which breaks + each of these down and explains them in more detail.

+ + + +

Why?

+ + +

The development of a new front-end was started out of a need -- a need + for a compiler that allows better diagnostics, better integration with + IDEs, a license that is compatible with commercial products, and a + nimble compiler that is easy to develop and maintain. All of these were + motivations for starting work on a new front-end that could + meet these needs.

+ +

A good (but quite dated) introduction to Clang can be found in the + following video lectures:

+ + + +

For a more detailed comparison between Clang and other compilers, please + see the clang comparison page.

+ + +

Current Status

+ + +

Clang is still in early development stages. If you are looking for + source analysis or source-to-source transformation tools, clang is probably + a great solution for you. If you want to use it as a drop in C compiler, it + is not yet ready.

+ +

Clang currently has pretty good parsing and semantic analysis support for + C and Objective-C right now, and bugs are usually quickly fixed once + reported. C++ support is still very early, + and we don't expect to have respectable C++ support for another 2 years + or so.

+ + +

Get it and get involved!

+ + +

Start by getting the code, building it, and + playing with it. This will show you the sorts of things we can do + today and will let you have the "clang experience" first hand: hopefully + it will "resonate" with you. :)

+ +

Once you've done that, please consider getting + involved in the clang community. The clang developers include numerous + volunteer contributors with a variety of backgrounds. If you're + interested in + following the development of clang, signing up for a mailing list is a good + way to learn about how the project works.

+
+ + diff --git a/www/menu.css b/www/menu.css index ba1a6d3a5c..6e96a457ab 100644 --- a/www/menu.css +++ b/www/menu.css @@ -1,39 +1,39 @@ -/***************/ -/* page layout */ -/***************/ - -[id=menu] { - position:fixed; - width:25ex; -} -[id=content] { - /* ***** EDIT THIS VALUE IF CONTENT OVERLAPS MENU ***** */ - position:absolute; - left:29ex; - padding-right:4ex; -} - -/**************/ -/* menu style */ -/**************/ - -#menu .submenu { - padding-top:1em; - display:block; -} - -#menu label { - display:block; - font-weight: bold; - text-align: center; - background-color: rgb(192,192,192); -} -#menu a { - padding:0 .2em; - display:block; - text-align: center; - background-color: rgb(235,235,235); -} -#menu a:visited { - color:rgb(100,50,100); +/***************/ +/* page layout */ +/***************/ + +[id=menu] { + position:fixed; + width:25ex; +} +[id=content] { + /* ***** EDIT THIS VALUE IF CONTENT OVERLAPS MENU ***** */ + position:absolute; + left:29ex; + padding-right:4ex; +} + +/**************/ +/* menu style */ +/**************/ + +#menu .submenu { + padding-top:1em; + display:block; +} + +#menu label { + display:block; + font-weight: bold; + text-align: center; + background-color: rgb(192,192,192); +} +#menu a { + padding:0 .2em; + display:block; + text-align: center; + background-color: rgb(235,235,235); +} +#menu a:visited { + color:rgb(100,50,100); } \ No newline at end of file diff --git a/www/menu.html.incl b/www/menu.html.incl index 3ba2551196..ca25e3aeb0 100644 --- a/www/menu.html.incl +++ b/www/menu.html.incl @@ -1,42 +1,42 @@ - +