summaryrefslogtreecommitdiffstats
path: root/docs/ReleaseNotes.html
blob: 58e7f97b2790d91d437540a6f39eeca9fe6ea0ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<html>
<head>
<title>Clang 3.0 Release Notes</title>
<link type="text/css" rel="stylesheet" href="../menu.css" />
<link type="text/css" rel="stylesheet" href="../content.css" />
<style type="text/css">
td {
	vertical-align: top;
}
</style>
</head>
<body>

<!--#include virtual="../menu.html.incl"-->

<div id="content">

<h1>Clang 3.0 Release Notes</h1>

<img align=right src="http://llvm.org/img/DragonSmall.png"
     width="136" height="136" alt="LLVM Dragon Logo">

<ul>
  <li><a href="#intro">Introduction</a></li>
  <li><a href="#whatsnew">What's New in Clang 3.0?</a>
    <ul>
      <li><a href="#majorfeatures">Major New Features</a></li>
      <li><a href="#cchanges">C Language Changes</a></li>
      <li><a href="#cxxhanges">C++ Language Changes</a></li>
      <li><a href="#objchanges">Objective-C Language Changes</a></li>
      <li><a href="#apichanges">Internal API Changes</a></li>
    </ul>
  </li>
  <li><a href="#knownproblems">Known Problems</a></li>
  <li><a href="#additionalinfo">Additional Information</a></li>
</ul>

<div class="doc_author">
  <p>Written by the <a href="http://llvm.org/">LLVM Team</a></p>
</div>

<!--
<h1 style="color:red">These are in-progress notes for the upcoming LLVM 3.0
release.<br>
You may prefer the
<a href="http://llvm.org/releases/2.9/docs/ReleaseNotes.html">LLVM 2.9
Release Notes</a>.</h1>
 -->

<!-- ======================================================================= -->
<h2 id="intro">Introduction</h2>
<!-- ======================================================================= -->

<p>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 <a href ="http;//llvm.org/docs/ReleaseNotes.html">the LLVM
 documentation</a>. All LLVM releases may be downloaded from the
<a href="http://llvm.org/releases/">LLVM releases web site</a>.</p>

<p>For more information about Clang or LLVM, including information about the
latest release, please check out the main please see the
<a href="http://clang.llvm.org">Clang Web Site</a> or the
<a href="http://llvm.org">LLVM Web Site</a>.

<p>Note that if you are reading this file from a Subversion checkout or the main
Clang web page, this document applies to the <i>next</i> release, not the
current one.  To see the release notes for a specific release, please see the
<a href="http://llvm.org/releases/">releases page</a>.</p>

<!-- ======================================================================= -->
<h2 id="whatsnew">What's New in Clang 3.0?</h2>
<!-- ======================================================================= -->

<p>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.</p>

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="majorfeatures">Major New Features</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

<h4 id="notes">Unorganized Notes</h4>
<p>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.</p>
<ul>
  <li>Building Clang on windows -- mingw, 32 and 64 bit, native windows builds,
  cygwin. get chapuni to flesh out details.</li>
  <li>Compiling C/C++ w/ MinGW (32/64) and Cygwin on Windows -- chapuni</li>
  <li>C++ -- Parsing and AST support for Windows Structured Exception
  Handling.</li>
  <li>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.</li>
  <li>Support for language specific address spaces</li>
  <li>Crash recovery handling for libclang clients -- Ted</li>
  <li>Driver support for automatic preparation of reproduction steps for
  compiler crashes -- Chad</li>
  <li>OS Availability attribute -- r128127</li>
  <li>GNU ObjectiveC Runtime support -- David Chisnall</li>
  <li>libclang improvements bucket
    <ul>
      <li>Better Python Bindings</li>
      <li>More AST coverage</li>
      <li>Improved cursor support within macros, especially function-style macro
      arguments.</li>
      <li>Improved code completion surrounding macros, macro arguments, and
      token pasting.</li>
      <li>Improved code completion for in-class member functions.</li>
    </ul>
  </li>
  <li>Basic C++ support in the static analyzer.</li>
  <li>Improved AST support for partially constructed nodes and incomplete
  information for LLDB and other clients which dynamically build AST nodes.</li>
  <li>Largely complete MSVC-compatible parsing mode -- fpichet</li>
  <li>C1X -- static asserts and generic selections</li>
  <li>Memory reduction -- initializers, macro expansions, source locations,
  etc.</li>
  <li>The Embarcadero
  <a href="http://docwiki.embarcadero.com/RADStudio/en/Is_lvalue_expr"><tt>__is_lvalue_expr</tt></a> and
  <a href="http://docwiki.embarcadero.com/RADStudio/en/Is_rvalue_expr"><tt>__is_rvalue_expr</tt></a> expression traits.</li>
  <li>CFI-based debug info -- nlewycky/espindola details</li>
  <li>ObjC ARC -- get a blurb from rjmccall</li>
  <li>ObjC related result type/instancetype</li>
  <li>Thread Safety attributes and correctness analysis added to Clang.</li>
  <li>NRVO for blocks.</li>
  <li>Major improvements to the interactions between serializing and
  deserializing the AST and the preprocessor -- argiris</li>
</ul>

<h4 id="diagnostics">A multitude of improvements to Clang's diagnostics</h4>
Clang's diagnostics are constantly being improved to catch more issues, explain
them more clearly, and provide more accurate source information about them.
A few improvements since the 2.9 release that have a particularly high impact:
<ul>
  <li>Substantially shorter messages due to better recovery, fewer include
  stacks, and tuning verbose features such as 'a.k.a.' type printing.</li>
  <li>
    Able to recover and correct from misspelled type names at the begging of statements. For example, Clang now emits:
    <code>t.c:6:3: error: use of undeclared identifier 'integer'; did you mean
'Integer'?
  integer *i = 0;
  ^~~~~~~
  Integer
t.c:1:13: note: 'Integer' declared here
typedef int Integer;
            ^</code>
  </li>
  <li>Expanded typo correction to (among other improvements) look across
  namespaces and suggest namespace qualifiers in addition to misspellings of the
  identifier itself.</li>
  <li>More rich macro expansion backtraces and some (limited) fix-it hints when
  diagnostics stem from macro arguments.</li>
</ul>

<h4 id="driver">The Clang GCC-compatible command-line driver improved dramatically</h4>
A great deal of work went into the GCC-compatible driver for the 3.0 release
making it support more operating systems, emulate GCC behavior more accurately,
and support a much broader range of Linux distributions out of the box.
<ul>
  <li>More accurate support for hardware architecture pre-defined macros (e.g.,
  __i686__).</li>
  <li>Robust library and header search paths for the vast majority of x86 and
  x86-64 Linux distributions.</li>
  <li>Improved support for newer Darwin platforms.</li>
  <li>Partial support for <code>--sysroot=...</code> based cross-compiling on
  Linux (and similar) host systems.</li>
  <li>Improved support for locating and using libcxx when installed, especially
  on Darwin.</li>
  <!-- There are likely more Darwin-specific improvements to mention here? -->
  <!-- What support was added for FreeBSD? NetBSD? Anything noteworthy? -->
</ul>

<h4 id="ppcallbacks">Expanded support for instrumenting the preprocessor through
  callbacks</h4>
Several enhancements were made to the <code>PPCallbacks</code> interface to
expand the information available to tools and library users of Clang that wish
to introspect the preprocessing.
<ul>
  <li>The exact text used between the <code>""</code>s or <code>&lt;&gt;</code>s is reported.</li>
  <li>The header search path used to locate the header is reported.</li>
  <li>Missing files during including headers reported.</li>
  <li>The exact source range for expanded macros can be retrieved.</li>
</ul>

<!--
Need Peter and/or Tanya to flesh this out if we want it in 3.0's notes.. The
state isn't clear just from documentation or commit logs.

<h4 id="opencl">Initial work to support compiling OpenCL with Clang</h4>
Clang has some (limited) support for compiling OpenCL.
-->

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="cchanges">C Language Changes in Clang</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="cxxchanges">C++ Language Changes in Clang</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

<h4 id="cxx11changes">C++11 Feature Support</h4>
<p>Clang 3.0 adds support for
<a href="http://clang.llvm.org/cxx_status.html#cxx11">more of the language
features</a> added in the latest ISO C++ standard, C++11. Use
<code>-std=c++11</code> or <code>-std=gnu++11</code> to enable support for these
features. The following are now considered to be of production quality:
<ul>
  <li>Range-based <code>for</code> loops</li>
  <li>Alias declarations (a new syntax for <code>typedef</code> declarations),
  including their <code>template</code> forms</li>
  <li>Specifying default values for class data members within a class
  definition</li>
  <li>Constructors delegating to other constructors of the same class</li>
  <li>The <code>override</code> context-sensitive keyword for virtual member
  function declarations</li>
  <li>Explicitly generating default function definitions with
  <code>= default</code></li>
  <li>The <code>nullptr</code> keyword, and the corresponding type</li>
  <li>Raw string literals with arbitary delimiters (for instance,
  <code>R"delim(str"ing)delim"</code>)</li>
  <li>Unicode string literals (for instance, <code>U"\u1234"</code>) and the
  <code>char16_t</code> and <code>char32_t</code> built-in types
  <li><code>noexcept</code> expressions and the <code>noexcept</code> specifier
  on function declarations</li>
  <li><code>alignof</code> expressions and the <code>alignas</code> specifier on
  variable declarations</li>
  <li>A full set of <a href="http://clang.llvm.org/docs/LanguageExtensions.html#checking_type_traits">type traits</a>,
  sufficient to support C++11 standard libraries</li>
</ul>
All warning and language selection flags which previously accepted
<code>c++0x</code> now accept <code>c++11</code>. The old <code>c++0x</code>
form remains as an alias.

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="objcchanges">Objective-C Language Changes in Clang</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="apichanges">Internal API Changes</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

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.

<h4 id="macroexpansion">Switched terminology from "instantiation" to "expansion"
  for macros</h4>
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:
<ul>
  <li><code>MacroInstantiation</code> became <code>MacroExpansion</code></li>
  <li><code>SourceManager::getInstantiationLoc</code> became
  <code>SourceManager::getExpansionLoc</code></li>
  <li><code>SourceManager::getInstantiationRange</code> became
  <code>SourceManager::getExpansionRange</code></li>
  <li><code>SourceManager::getImmediateInstantiationRange</code> became
  <code>SourceManager::getImmediateExpansionRange</code></li>
  <li><code>SourceManager::getDecomposedInstantiationLoc</code> became
  <code>SourceManager::getDecomposedExpansionLoc</code></li>
  <li><code>SourceManager::getInstantiationColumnNumber</code> became
  <code>SourceManager::getExpansionColumnNumber</code></li>
  <li><code>SourceManager::getInstantiationLineNumber</code> became
  <code>SourceManager::getExpansionLineNumber</code></li>
  <!-- TODO: Make this more complete! -->
</ul>

<h4 id="diagnosticrename">Diagnostic class names were shuffled</h4>
<ul>
  <li><code>Diagnostic</code> became <code>DiagnosticEngine</code></li>
  <li><code>DiagnosticClient</code> became <code>DiagnosticConsumer</code></li>
  <li><code>DiagnosticInfo</code> became <code>Diagnostic</code></li>
</ul>
Subclasses of <code>DiagnosticConsumer</code> were also then renamed to end with
<code>Consumer</code>.

<!-- ======================================================================= -->
<h2 id="knownproblems">Significant Known Problems</h2>
<!-- ======================================================================= -->

<!-- ======================================================================= -->
<h2 id="additionalinfo">Additional Information</h2>
<!-- ======================================================================= -->

<p>A wide variety of additional information is available on the
<a href="http://clang.llvm.org/">Clang web page</a>.  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 "<tt>clang/doc/</tt>" directory in the Clang
tree.</p>

<p>If you have any questions or comments about Clang, please feel free to
contact us via the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">
mailing list</a>.</p>


<!-- ======================================================================= -->
<!-- Likely 3.1 release notes -->
<!-- ======================================================================= -->
<!--
This is just a section to hold things that have already gotten started and
should likely pick up proper release notes in 3.1.

- C1X and C++11 atomics infrastructure and support
- CUDA support?

-->

</body>
</html>