summaryrefslogtreecommitdiffstats
path: root/docs/ReleaseNotes.html
blob: 8a195f0b83e5ac0c20408cfc431afe881f834a19 (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
          "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Clang 3.2 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.2 Release Notes</h1>

<img style="float: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.2?</a>
    <ul>
      <li><a href="#majorfeatures">Major New Features</a></li>
      <li><a href="#newflags">New Compiler Flags</a></li>
      <li><a href="#cchanges">C Language Changes</a></li>
      <li><a href="#cxxchanges">C++ Language Changes</a></li>
      <li><a href="#objcchanges">Objective-C Language Changes</a></li>
      <li><a href="#apichanges">Internal API Changes</a></li>
      <li><a href="#pythonchanges">Python Binding 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 Clang 3.2
release.<br>
You may prefer the
<a href="http://llvm.org/releases/3.1/docs/ClangReleaseNotes.html">Clang 3.1
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.2.  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.2?</h2>
<!-- ======================================================================= -->

<p>Some of the major new features and improvements to Clang are listed here.
  Generic improvements to Clang as a whole or to 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="diagnostics">Improvements to Clang's diagnostics</h4>

<p>Clang's diagnostics are constantly being improved to catch more issues,
explain them more clearly, and provide more accurate source information about
them. The improvements since the 3.1 release include:</p>

<ul>
  <li><tt>-Wuninitialized</tt> has been taught to recognise uninitialized uses
  which always occur when an explicitly-written non-constant condition is either
  <tt>true</tt> or <tt>false</tt>. For example:

<pre>
int f(bool b) {
  int n;
  if (b)
    n = 1;
  return n;
}

<b>sometimes-uninit.cpp:3:7: <span class="warning">warning:</span> variable 'n' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]</b>
  if (b)
      <span class="caret">^</span>
<b>sometimes-uninit.cpp:5:10: <span class="note">note:</span></b> uninitialized use occurs here
  return n;
         <span class="caret">^</span>
<b>sometimes-uninit.cpp:3:3: <span class="note">note:</span></b> remove the 'if' if its condition is always true
  if (b)
  <span class="caret">^~~~~~</span>
<b>sometimes-uninit.cpp:2:8: <span class="note">note:</span></b> initialize the variable 'n' to silence this warning
  int n;
       <span class="caret">^</span>
       <span class="caret"> = 0</span>
</pre>

  This functionality can be enabled or disabled separately from
  <tt>-Wuninitialized</tt> with the <tt>-Wsometimes-uninitialized</tt> warning
  flag.</li>

  <li>Template type diffing improves the display of diagnostics with templated
  types in them.

<pre>
int f(vector&lt;map&lt;int, double&gt;&gt;);
int x = f(vector&lt;map&lt;int, float&gt;&gt;());
</pre>
  The error message is the same, but the note is different based on the options selected.
<pre>
<b>template-diff.cpp:5:9: <span class="error">error:</span> no matching function for call to 'f'</b>
int x = f(vector&lt;map&lt;int, float&gt;&gt;());
        <span class="caret">^</span>
</pre>
  Templated type diffing with type elision (default):
<pre>
<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector&lt;map&lt;[...], <span class="template-highlight">float</span>&gt;&gt;' to 'vector&lt;map&lt;[...], <span class="template-highlight">double</span>&gt;&gt;' for 1st argument;
int f(vector&lt;map&lt;int, double&gt;&gt;);
    <span class="caret">^</span>
</pre>
  Templated type diffing without type elision (-fno-elide-type):
<pre>
<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector&lt;map&lt;int, <span class="template-highlight">float</span>&gt;&gt;' to 'vector&lt;map&lt;int, <span class="template-highlight">double</span>&gt;&gt;' for 1st argument;
int f(vector&lt;map&lt;int, double&gt;&gt;);
    <span class="caret">^</span>
</pre>
  Templated tree printing with type elision (-fdiagnostics-show-template-tree):
<pre>
<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument;
  vector&lt;
    map&lt;
      [...],
      [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]&gt;&gt;
int f(vector&lt;map&lt;int, double&gt;&gt;);
    <span class="caret">^</span>
</pre>
  Templated tree printing without type elision (-fdiagnostics-show-template-tree -fno-elide-type):
<pre>
<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument;
  vector&lt;
    map&lt;
      int,
      [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]&gt;&gt;
int f(vector&lt;map&lt;int, double&gt;&gt;);
    <span class="caret">^</span>
</pre>

  </li>

  <li>Clang's <tt>-fcatch-undefined-behavior</tt> option has been renamed to
  <tt>-fsanitize=undefined</tt> and has grown the ability to check for several
  new types of undefined behavior. See the Users Manual for more information.

  <!-- Flesh this out prior to release. -->

  <!-- Document renaming of -faddress-sanitizer and -fthread-sanitizer. -->

  </li>

</ul>

<h4 id="tlsmodel">Support for <code>tls_model</code> attribute</h4>

<p>Clang now supports the <code>tls_model</code> attribute, allowing code that
uses thread-local storage to explicitly select which model to use. The available
models are <code>"global-dynamic"</code>, <code>"local-dynamic"</code>,
<code>"initial-exec"</code> and <code>"local-exec"</code>. See
<a href="http://www.akkadia.org/drepper/tls.pdf">ELF Handling For Thread-Local
 Storage</a> for more information.</p>

<p>The compiler is free to choose a different model if the specified model is not
supported by the target, or if the compiler determines that a more specific
model can be used.
</p>

<h4>Type safety attributes</h4>
<p>Clang now supports type safety attributes that allow checking during compile
time that 'void *' function arguments and arguments for variadic functions are
of a particular type which is determined by some other argument to the same
function call.</p>

<p>Usecases include:</p>
<ul>
<li>MPI library implementations, where these attributes enable checking that
  buffer type matches the passed <code>MPI_Datatype</code>;</li>
<li> HDF5 library -- similar usecase as for MPI;</li>
<li> checking types of variadic functions' arguments for functions like
<code>fcntl()</code> and <code>ioctl()</code>.</li>
</ul>

<p>See entries for <code>argument_with_type_tag</code>,
<code>pointer_with_type_tag</code> and <code>type_tag_for_datatype</code>
attributes in Clang language extensions documentation.</p>

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="newflags">New Compiler Flags</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<ul>
  <li><tt>-gline-tables-only</tt> controls the
  <a href="http://clang.llvm.org/docs/UsersManual.html#debuginfosize">size of debug information</a>.
  This flag tells Clang to emit debug info which is just enough to obtain stack traces with
  function names, file names and line numbers (by such tools as gdb or addr2line).
  Debug info for variables or function parameters is not produced, which reduces
  the size of the resulting binary.

  <li><tt>-ftls-model</tt> controls which TLS model to use for thread-local
  variables. This can be overridden per variable using the
  <a href="#tlsmodel"><tt>tls_model</tt> attribute</a> mentioned above.
  For more details, see the <a href="UsersManual.html#opt_ftls-model">User's
  Manual</a>.</li>
</ul>

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

<h4 id="c11changes">C11 Feature Support</h4>

<p>...</p>

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

<h4 id="cxx11changes">C++11 Feature Support</h4>

<p>...</p>

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

<p>...</p>

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

<p>These are major API changes that have happened since the 3.1 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.</p>

<h4 id="api1">API change 1</h4>

<p>...</p>

<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="pythonchanges">Python Binding Changes</h3>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

The following methods have been added:
<ul>
  <li>...</li>
</ul>

<!-- ======================================================================= -->
<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?

-->

</div>
</body>
</html>