Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 3 | <html> |
| 4 | <head> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 5 | <title>Clang 3.2 Release Notes</title> |
Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 6 | <link type="text/css" rel="stylesheet" href="../menu.css"> |
| 7 | <link type="text/css" rel="stylesheet" href="../content.css"> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 8 | <style type="text/css"> |
| 9 | td { |
| 10 | vertical-align: top; |
| 11 | } |
| 12 | </style> |
| 13 | </head> |
| 14 | <body> |
| 15 | |
| 16 | <!--#include virtual="../menu.html.incl"--> |
| 17 | |
| 18 | <div id="content"> |
| 19 | |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 20 | <h1>Clang 3.2 Release Notes</h1> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 21 | |
Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 22 | <img style="float:right" src="http://llvm.org/img/DragonSmall.png" |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 23 | width="136" height="136" alt="LLVM Dragon Logo"> |
| 24 | |
| 25 | <ul> |
| 26 | <li><a href="#intro">Introduction</a></li> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 27 | <li><a href="#whatsnew">What's New in Clang 3.2?</a> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 28 | <ul> |
| 29 | <li><a href="#majorfeatures">Major New Features</a></li> |
Alexey Samsonov | f7a4c35 | 2012-06-22 11:18:10 +0000 | [diff] [blame] | 30 | <li><a href="#newflags">New Compiler Flags</a></li> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 31 | <li><a href="#cchanges">C Language Changes</a></li> |
Richard Smith | 45fb995 | 2012-02-16 00:32:27 +0000 | [diff] [blame] | 32 | <li><a href="#cxxchanges">C++ Language Changes</a></li> |
Jean-Daniel Dupas | 3fd8087 | 2012-03-03 13:37:22 +0000 | [diff] [blame] | 33 | <li><a href="#objcchanges">Objective-C Language Changes</a></li> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 34 | <li><a href="#apichanges">Internal API Changes</a></li> |
Gregory Szorc | 6341900 | 2012-05-12 20:45:56 +0000 | [diff] [blame] | 35 | <li><a href="#pythonchanges">Python Binding Changes</a></li> |
Richard Smith | 855746b | 2011-11-28 20:02:05 +0000 | [diff] [blame] | 36 | </ul> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 37 | </li> |
| 38 | <li><a href="#knownproblems">Known Problems</a></li> |
| 39 | <li><a href="#additionalinfo">Additional Information</a></li> |
| 40 | </ul> |
| 41 | |
| 42 | <div class="doc_author"> |
| 43 | <p>Written by the <a href="http://llvm.org/">LLVM Team</a></p> |
| 44 | </div> |
| 45 | |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 46 | <h1 style="color:red">These are in-progress notes for the upcoming Clang 3.2 |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 47 | release.<br> |
| 48 | You may prefer the |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 49 | <a href="http://llvm.org/releases/3.1/docs/ClangReleaseNotes.html">Clang 3.1 |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 50 | Release Notes</a>.</h1> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 51 | |
| 52 | <!-- ======================================================================= --> |
| 53 | <h2 id="intro">Introduction</h2> |
| 54 | <!-- ======================================================================= --> |
| 55 | |
| 56 | <p>This document contains the release notes for the Clang C/C++/Objective-C |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 57 | frontend, part of the LLVM Compiler Infrastructure, release 3.2. Here we |
| 58 | describe the status of Clang in some detail, including major improvements |
| 59 | from the previous release and new feature work. For the general LLVM release |
| 60 | notes, see <a href="http://llvm.org/docs/ReleaseNotes.html">the LLVM |
| 61 | documentation</a>. All LLVM releases may be downloaded from the |
| 62 | <a href="http://llvm.org/releases/">LLVM releases web site</a>.</p> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 63 | |
| 64 | <p>For more information about Clang or LLVM, including information about the |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 65 | latest release, please check out the main please see the |
| 66 | <a href="http://clang.llvm.org">Clang Web Site</a> or the |
| 67 | <a href="http://llvm.org">LLVM Web Site</a>. |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 68 | |
| 69 | <p>Note that if you are reading this file from a Subversion checkout or the main |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 70 | Clang web page, this document applies to the <i>next</i> release, not the |
| 71 | current one. To see the release notes for a specific release, please see the |
| 72 | <a href="http://llvm.org/releases/">releases page</a>.</p> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 73 | |
| 74 | <!-- ======================================================================= --> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 75 | <h2 id="whatsnew">What's New in Clang 3.2?</h2> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 76 | <!-- ======================================================================= --> |
| 77 | |
| 78 | <p>Some of the major new features and improvements to Clang are listed here. |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 79 | Generic improvements to Clang as a whole or to its underlying infrastructure |
| 80 | are described first, followed by language-specific sections with improvements |
| 81 | to Clang's support for those languages.</p> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 82 | |
| 83 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 84 | <h3 id="majorfeatures">Major New Features</h3> |
| 85 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 86 | |
Richard Smith | b264702 | 2012-05-25 02:35:34 +0000 | [diff] [blame] | 87 | <h4 id="diagnostics">Improvements to Clang's diagnostics</h4> |
Chandler Carruth | a0df07d | 2011-11-28 22:17:58 +0000 | [diff] [blame] | 88 | |
Richard Smith | b264702 | 2012-05-25 02:35:34 +0000 | [diff] [blame] | 89 | <p>Clang's diagnostics are constantly being improved to catch more issues, |
| 90 | explain them more clearly, and provide more accurate source information about |
| 91 | them. The improvements since the 3.1 release include:</p> |
| 92 | |
| 93 | <ul> |
| 94 | <li><tt>-Wuninitialized</tt> has been taught to recognise uninitialized uses |
| 95 | which always occur when an explicitly-written non-constant condition is either |
| 96 | <tt>true</tt> or <tt>false</tt>. For example: |
| 97 | |
| 98 | <pre> |
| 99 | int f(bool b) { |
| 100 | int n; |
| 101 | if (b) |
| 102 | n = 1; |
| 103 | return n; |
| 104 | } |
| 105 | |
Richard Smith | bdb97ff | 2012-05-26 06:20:46 +0000 | [diff] [blame] | 106 | <b>sometimes-uninit.cpp:3:7: <span class="warning">warning:</span> variable 'n' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]</b> |
Richard Smith | b264702 | 2012-05-25 02:35:34 +0000 | [diff] [blame] | 107 | if (b) |
| 108 | <span class="caret">^</span> |
Richard Smith | bdb97ff | 2012-05-26 06:20:46 +0000 | [diff] [blame] | 109 | <b>sometimes-uninit.cpp:5:10: <span class="note">note:</span></b> uninitialized use occurs here |
| 110 | return n; |
| 111 | <span class="caret">^</span> |
| 112 | <b>sometimes-uninit.cpp:3:3: <span class="note">note:</span></b> remove the 'if' if its condition is always true |
| 113 | if (b) |
| 114 | <span class="caret">^~~~~~</span> |
Richard Smith | b264702 | 2012-05-25 02:35:34 +0000 | [diff] [blame] | 115 | <b>sometimes-uninit.cpp:2:8: <span class="note">note:</span></b> initialize the variable 'n' to silence this warning |
| 116 | int n; |
| 117 | <span class="caret">^</span> |
| 118 | <span class="caret"> = 0</span> |
| 119 | </pre> |
| 120 | |
| 121 | This functionality can be enabled or disabled separately from |
| 122 | <tt>-Wuninitialized</tt> with the <tt>-Wsometimes-uninitialized</tt> warning |
| 123 | flag.</li> |
Richard Trieu | e59331a | 2012-06-27 02:00:20 +0000 | [diff] [blame] | 124 | |
| 125 | <li>Template type diffing improves the display of diagnostics with templated |
| 126 | types in them. |
| 127 | |
| 128 | <pre> |
| 129 | int f(vector<map<int, double>>); |
| 130 | int x = f(vector<map<int, float>>()); |
| 131 | </pre> |
| 132 | The error message is the same, but the note is different based on the options selected. |
| 133 | <pre> |
| 134 | <b>template-diff.cpp:5:9: <span class="error">error:</span> no matching function for call to 'f'</b> |
| 135 | int x = f(vector<map<int, float>>()); |
| 136 | <span class="caret">^</span> |
| 137 | </pre> |
| 138 | Templated type diffing with type elision (default): |
| 139 | <pre> |
| 140 | <b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector<map<[...], <span class="template-highlight">float</span>>>' to 'vector<map<[...], <span class="template-highlight">double</span>>>' for 1st argument; |
| 141 | int f(vector<map<int, double>>); |
| 142 | <span class="caret">^</span> |
| 143 | </pre> |
| 144 | Templated type diffing without type elision (-fno-elide-type): |
| 145 | <pre> |
| 146 | <b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector<map<int, <span class="template-highlight">float</span>>>' to 'vector<map<int, <span class="template-highlight">double</span>>>' for 1st argument; |
| 147 | int f(vector<map<int, double>>); |
| 148 | <span class="caret">^</span> |
| 149 | </pre> |
| 150 | Templated tree printing with type elision (-fdiagnostics-show-template-tree): |
| 151 | <pre> |
| 152 | <b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument; |
| 153 | vector< |
| 154 | map< |
| 155 | [...], |
| 156 | [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]>> |
| 157 | int f(vector<map<int, double>>); |
| 158 | <span class="caret">^</span> |
| 159 | </pre> |
| 160 | Templated tree printing without type elision (-fdiagnostics-show-template-tree -fno-elide-type): |
| 161 | <pre> |
| 162 | <b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument; |
| 163 | vector< |
| 164 | map< |
| 165 | int, |
| 166 | [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]>> |
| 167 | int f(vector<map<int, double>>); |
| 168 | <span class="caret">^</span> |
| 169 | </pre> |
| 170 | |
| 171 | </li> |
| 172 | |
Richard Smith | b264702 | 2012-05-25 02:35:34 +0000 | [diff] [blame] | 173 | </ul> |
| 174 | |
Hans Wennborg | 5e2d5de | 2012-06-23 11:51:46 +0000 | [diff] [blame] | 175 | <h4 id="tlsmodel">Support for <code>tls_model</code> attribute</h4> |
| 176 | |
| 177 | <p>Clang now supports the <code>tls_model</code> attribute, allowing code that |
| 178 | uses thread-local storage to explicitly select which model to use. The available |
| 179 | models are <code>"global-dynamic"</code>, <code>"local-dynamic"</code>, |
| 180 | <code>"initial-exec"</code> and <code>"local-exec"</code>. See |
| 181 | <a href="http://www.akkadia.org/drepper/tls.pdf">ELF Handling For Thread-Local |
| 182 | Storage</a> for more information.</p> |
| 183 | |
| 184 | <p>The compiler is free to choose a different model if the specified model is not |
| 185 | supported by the target, or if the compiler determines that a more specific |
| 186 | model can be used. |
| 187 | </p> |
| 188 | |
Alexey Samsonov | f7a4c35 | 2012-06-22 11:18:10 +0000 | [diff] [blame] | 189 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 190 | <h3 id="newflags">New Compiler Flags</h3> |
| 191 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 192 | <ul> |
| 193 | <li><tt>-gline-tables-only</tt> controls the |
| 194 | <a href="http://clang.llvm.org/docs/UsersManual.html#debuginfosize">size of debug information</a>. |
| 195 | This flag tells Clang to emit debug info which is just enough to obtain stack traces with |
| 196 | function names, file names and line numbers (by such tools as gdb or addr2line). |
| 197 | Debug info for variables or function parameters is not produced, which reduces |
| 198 | the size of the resulting binary. |
| 199 | </ul> |
Manuel Klimek | 92f7409 | 2012-04-04 12:53:16 +0000 | [diff] [blame] | 200 | |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 201 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 202 | <h3 id="cchanges">C Language Changes in Clang</h3> |
| 203 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 204 | |
Richard Smith | 45fb995 | 2012-02-16 00:32:27 +0000 | [diff] [blame] | 205 | <h4 id="c11changes">C11 Feature Support</h4> |
Richard Smith | 62d730f | 2011-11-28 22:48:25 +0000 | [diff] [blame] | 206 | |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 207 | <p>...</p> |
Richard Smith | 45fb995 | 2012-02-16 00:32:27 +0000 | [diff] [blame] | 208 | |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 209 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 210 | <h3 id="cxxchanges">C++ Language Changes in Clang</h3> |
| 211 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 212 | |
Richard Smith | 855746b | 2011-11-28 20:02:05 +0000 | [diff] [blame] | 213 | <h4 id="cxx11changes">C++11 Feature Support</h4> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 214 | |
| 215 | <p>...</p> |
Richard Smith | 855746b | 2011-11-28 20:02:05 +0000 | [diff] [blame] | 216 | |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 217 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 218 | <h3 id="objcchanges">Objective-C Language Changes in Clang</h3> |
| 219 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
Chandler Carruth | 4d58212 | 2011-11-29 00:15:23 +0000 | [diff] [blame] | 220 | |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 221 | <p>...</p> |
Chandler Carruth | 52e375e | 2011-11-29 00:15:25 +0000 | [diff] [blame] | 222 | |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 223 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 224 | <h3 id="apichanges">Internal API Changes</h3> |
| 225 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 226 | |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 227 | <p>These are major API changes that have happened since the 3.1 release of |
| 228 | Clang. If upgrading an external codebase that uses Clang as a library, this |
| 229 | section should help get you past the largest hurdles of upgrading.</p> |
Chandler Carruth | c4dbffa | 2011-11-28 18:55:47 +0000 | [diff] [blame] | 230 | |
Richard Smith | 45fb995 | 2012-02-16 00:32:27 +0000 | [diff] [blame] | 231 | <h4 id="api1">API change 1</h4> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 232 | |
| 233 | <p>...</p> |
Chandler Carruth | c4dbffa | 2011-11-28 18:55:47 +0000 | [diff] [blame] | 234 | |
Gregory Szorc | 6341900 | 2012-05-12 20:45:56 +0000 | [diff] [blame] | 235 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 236 | <h3 id="pythonchanges">Python Binding Changes</h3> |
| 237 | <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |
| 238 | |
| 239 | The following methods have been added: |
| 240 | <ul> |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 241 | <li>...</li> |
Gregory Szorc | 6341900 | 2012-05-12 20:45:56 +0000 | [diff] [blame] | 242 | </ul> |
| 243 | |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 244 | <!-- ======================================================================= --> |
| 245 | <h2 id="knownproblems">Significant Known Problems</h2> |
| 246 | <!-- ======================================================================= --> |
| 247 | |
| 248 | <!-- ======================================================================= --> |
| 249 | <h2 id="additionalinfo">Additional Information</h2> |
| 250 | <!-- ======================================================================= --> |
| 251 | |
| 252 | <p>A wide variety of additional information is available on the |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 253 | <a href="http://clang.llvm.org/">Clang web page</a>. The web page contains |
| 254 | versions of the API documentation which are up-to-date with the Subversion |
| 255 | version of the source code. You can access versions of these documents |
| 256 | specific to this release by going into the "<tt>clang/doc/</tt>" directory in |
| 257 | the Clang tree.</p> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 258 | |
| 259 | <p>If you have any questions or comments about Clang, please feel free to |
Bill Wendling | c0bb312 | 2012-05-24 06:42:56 +0000 | [diff] [blame] | 260 | contact us via |
| 261 | the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"> mailing |
| 262 | list</a>.</p> |
Chandler Carruth | 59abf06 | 2011-11-28 22:12:44 +0000 | [diff] [blame] | 263 | |
| 264 | <!-- ======================================================================= --> |
| 265 | <!-- Likely 3.1 release notes --> |
| 266 | <!-- ======================================================================= --> |
| 267 | <!-- |
| 268 | This is just a section to hold things that have already gotten started and |
| 269 | should likely pick up proper release notes in 3.1. |
| 270 | |
| 271 | - C1X and C++11 atomics infrastructure and support |
| 272 | - CUDA support? |
| 273 | |
| 274 | --> |
| 275 | |
Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 276 | </div> |
Chandler Carruth | c00c0c3 | 2011-11-28 07:16:19 +0000 | [diff] [blame] | 277 | </body> |
| 278 | </html> |