Clang 3.0 Release Notes

Introduction
This document contains the release notes for the Clang C/C++/Objective-C frontend, part of the LLVM Compiler Infrastructure, release 3.0. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the general LLVM release notes, see the LLVM documentation. All LLVM releases may be downloaded from the LLVM releases web site.
For more information about Clang or LLVM, including information about the latest release, please check out the main please see the Clang Web Site or the LLVM Web Site.
Note that if you are reading this file from a Subversion checkout or the main Clang web page, this document applies to the next release, not the current one. To see the release notes for a specific release, please see the releases page.
What's New in Clang 3.0?
Some of the major new features and improvements to Clang are listed here. Generic improvements to Clang as a whole or two its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang's support for those languages.
Major New Features
Unorganized Notes
These are completely random notes as I'm organizing my thoughts and reviewing the history. Anything still here needs to be distilled and turned into proper prose in a section of its own. When doing that, delete the notes.
- OpenCL support -- need details from Tanya and Peter -- separate language section?
- Building Clang on windows -- mingw, 32 and 64 bit, native windows builds, cygwin. get chapuni to flesh out details.
- Compiling C/C++ w/ MinGW (32/64) and Cygwin on Windows -- chapuni
- C++ -- Parsing and AST support for Windows Structured Exception Handling.
- Uninitialized values Clang warning rewrite -- more accurate, faster, able to differentiate between the possibility of an uninitialized use and the certainty of an uninitialized use.
- Support for language specific address spaces
- Support for compiling on NetBSD systems -- Joerg Sonnenberger to fill out
- Support for '--sysroot' based cross-compilation
- Crash recovery handling for libclang clients -- Ted
- Driver support for automatic preparation of reproduction steps for compiler crashes -- Chad
- OS Availability attribute -- r128127
- GNU ObjectiveC Runtime support -- David Chisnall
- Diagnostic improvements bucket?
- Emitting fewer include stacks
- Significantly better recovery when encountering misspelled type names in a declaration context. r130082
- Expanded typo correction, most especially namespace-aware typo correction in C++
- Significantly more rich diagnostics w.r.t. macro expansion backtraces, especially when macro arguments are involved.
- libclang improvements bucket
- Better Python Bindings
- More AST coverage
- Improved cursor support within macros, especially function-style macro arguments.
- Improved code completion surrounding macros, macro arguments, and token pasting.
- Improved code completion for in-class member functions.
- Basic C++ support in the static analyzer.
- Improved AST support for partially constructed nodes and incomplete information for LLDB and other clients which dynamically build AST nodes.
- Largely complete MSVC-compatible parsing mode -- fpichet
- C1X -- static asserts and generic selections
- Memory reduction -- initializers, macro expansions, source locations, etc.
- The Embarcadero __is_lvalue_expr and __is_rvalue_expr expression traits.
- CFI-based debug info -- nlewycky/espindola details
- ObjC ARC -- get a blurb from rjmccall
- ObjC related result type/instancetype
- Thread Safety attributes and correctness analysis added to Clang.
- NRVO for blocks.
- Major improvements to the interactions between serializing and deserializing the AST and the preprocessor -- argiris
- Major driver and system compatibility changes:
- Correct support for many more hardware architecture pre-defined macros (e.g., __i686__).
- Much more robust detection of library and header search paths on Linux distributions.
- Partial support for sysroot based cross compiling on Linux (like) systems.
- Improved support for locating and using libcxx, especially on Darwin.
- Initial steps of CUDA support -- Peter
- Atomic builtins and C1X specifiers using the new LLVM atomic instructions and memory model -- efriedma, jyasskin
Expanded support for instrumenting the preprocessor through callbacks
Several enhancements were made to thePPCallbacks
interface to expand the information available to tools and library users of Clang that wish to introspect the preprocessing.
- The exact text used between the
""
s or<>
s is reported. - The header search path used to locate the header is reported.
- Missing files during including headers reported.
- The exact source range for expanded macros can be retrieved.
C Language Changes in Clang
C++ Language Changes in Clang
C++11 Feature Support
Clang 3.0 adds support for more of the language features added in the latest ISO C++ standard, C++11. Use -std=c++11 or -std=gnu++11 to enable support for these features. The following are now considered to be of production quality:
- Range-based for loops
- Alias declarations (a new syntax for typedef declarations), including their template forms
- Specifying default values for class data members within a class definition
- Constructors delegating to other constructors of the same class
- The override context-sensitive keyword for virtual member function declarations
- Explicitly generating default function definitions with = default
- The nullptr keyword, and the corresponding type
- Raw string literals with arbitary delimiters (for instance, R"delim(str"ing)delim")
- Unicode string literals (for instance, U"\u1234") and the char16_t and char32_t built-in types
- noexcept expressions and the noexcept specifier on function declarations
- alignof expressions and the alignas specifier on variable declarations
- A full set of type traits, sufficient to support C++11 standard libraries
Objective-C Language Changes in Clang
Internal API Changes
These are major API changes that have happened since the 2.9 release of Clang. If upgrading an external codebase that uses Clang as a library, this section should help get you past the largest hurdles of upgrading.Switched terminology from "instantiation" to "expansion" for macros
A great deal of comments and code changes fell out of this, but also every API relating to macros with the word "instantiation" (or some variant thereof) was renamed. An incomplete list of the most note-worthy ones is here:MacroInstantiation
becameMacroExpansion
SourceManager::getInstantiationLoc
becameSourceManager::getExpansionLoc
SourceManager::getInstantiationRange
becameSourceManager::getExpansionRange
SourceManager::getImmediateInstantiationRange
becameSourceManager::getImmediateExpansionRange
SourceManager::getDecomposedInstantiationLoc
becameSourceManager::getDecomposedExpansionLoc
SourceManager::getInstantiationColumnNumber
becameSourceManager::getExpansionColumnNumber
SourceManager::getInstantiationLineNumber
becameSourceManager::getExpansionLineNumber
Diagnostic class names were shuffled
Diagnostic
becameDiagnosticEngine
DiagnosticClient
becameDiagnosticConsumer
DiagnosticInfo
becameDiagnostic
DiagnosticConsumer
were also then renamed to end with
Consumer
.
Significant Known Problems
Additional Information
A wide variety of additional information is available on the Clang web page. The web page contains versions of the API documentation which are up-to-date with the Subversion version of the source code. You can access versions of these documents specific to this release by going into the "clang/doc/" directory in the Clang tree.
If you have any questions or comments about Clang, please feel free to contact us via the mailing list.