Hans Wennborg | 60d06bf | 2016-07-18 18:05:19 +0000 | [diff] [blame] | 1 | ======================================= |
Hans Wennborg | 3d0d25d | 2018-08-01 14:01:27 +0000 | [diff] [blame] | 2 | Clang 8.0.0 (In-Progress) Release Notes |
Hans Wennborg | 60d06bf | 2016-07-18 18:05:19 +0000 | [diff] [blame] | 3 | ======================================= |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 4 | |
| 5 | .. contents:: |
| 6 | :local: |
| 7 | :depth: 2 |
| 8 | |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 9 | Written by the `LLVM Team <https://llvm.org/>`_ |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 10 | |
| 11 | .. warning:: |
| 12 | |
Hans Wennborg | 3d0d25d | 2018-08-01 14:01:27 +0000 | [diff] [blame] | 13 | These are in-progress notes for the upcoming Clang 8 release. |
Hans Wennborg | 189f1f3 | 2017-02-09 23:26:34 +0000 | [diff] [blame] | 14 | Release notes for previous releases can be found on |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 15 | `the Download Page <https://releases.llvm.org/download.html>`_. |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 16 | |
| 17 | Introduction |
| 18 | ============ |
| 19 | |
| 20 | This document contains the release notes for the Clang C/C++/Objective-C |
Hans Wennborg | 3d0d25d | 2018-08-01 14:01:27 +0000 | [diff] [blame] | 21 | frontend, part of the LLVM Compiler Infrastructure, release 8.0.0. Here we |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 22 | describe the status of Clang in some detail, including major |
| 23 | improvements from the previous release and new feature work. For the |
| 24 | general LLVM release notes, see `the LLVM |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 25 | documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 26 | releases may be downloaded from the `LLVM releases web |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 27 | site <https://llvm.org/releases/>`_. |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 28 | |
Hans Wennborg | d878ca8 | 2017-08-30 18:35:44 +0000 | [diff] [blame] | 29 | For more information about Clang or LLVM, including information about the |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 30 | latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the |
| 31 | `LLVM Web Site <https://llvm.org>`_. |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 32 | |
| 33 | Note that if you are reading this file from a Subversion checkout or the |
| 34 | main Clang web page, this document applies to the *next* release, not |
| 35 | the current one. To see the release notes for a specific release, please |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 36 | see the `releases page <https://llvm.org/releases/>`_. |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 37 | |
Hans Wennborg | 3d0d25d | 2018-08-01 14:01:27 +0000 | [diff] [blame] | 38 | What's New in Clang 8.0.0? |
Hans Wennborg | 60d06bf | 2016-07-18 18:05:19 +0000 | [diff] [blame] | 39 | ========================== |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 40 | |
| 41 | Some of the major new features and improvements to Clang are listed |
| 42 | here. Generic improvements to Clang as a whole or to its underlying |
| 43 | infrastructure are described first, followed by language-specific |
| 44 | sections with improvements to Clang's support for those languages. |
| 45 | |
| 46 | Major New Features |
| 47 | ------------------ |
| 48 | |
Richard Smith | 8654ae5 | 2018-10-10 23:13:35 +0000 | [diff] [blame] | 49 | - Clang supports use of a profile remapping file, which permits |
| 50 | profile data captured for one version of a program to be applied |
| 51 | when building another version where symbols have changed (for |
| 52 | example, due to renaming a class or namespace). |
| 53 | See the :doc:`UsersManual` for details. |
Rafael Espindola | 3497069 | 2013-12-12 16:07:11 +0000 | [diff] [blame] | 54 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 55 | Improvements to Clang's diagnostics |
| 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 57 | |
Roman Lebedev | 377748f | 2018-11-20 18:59:05 +0000 | [diff] [blame] | 58 | - ``-Wextra-semi-stmt`` is a new diagnostic that diagnoses extra semicolons, |
| 59 | much like ``-Wextra-semi``. This new diagnostic diagnoses all *unnecessary* |
| 60 | null statements (expression statements without an expression), unless: the |
| 61 | semicolon directly follows a macro that was expanded to nothing or if the |
| 62 | semicolon is within the macro itself. This applies to macros defined in system |
| 63 | headers as well as user-defined macros. |
| 64 | |
| 65 | .. code-block:: c++ |
| 66 | |
| 67 | #define MACRO(x) int x; |
| 68 | #define NULLMACRO(varname) |
| 69 | |
| 70 | void test() { |
| 71 | ; // <- warning: ';' with no preceding expression is a null statement |
| 72 | |
| 73 | while (true) |
| 74 | ; // OK, it is needed. |
| 75 | |
| 76 | switch (my_enum) { |
| 77 | case E1: |
| 78 | // stuff |
| 79 | break; |
| 80 | case E2: |
| 81 | ; // OK, it is needed. |
| 82 | } |
| 83 | |
| 84 | MACRO(v0;) // Extra semicolon, but within macro, so ignored. |
| 85 | |
| 86 | MACRO(v1); // <- warning: ';' with no preceding expression is a null statement |
| 87 | |
| 88 | NULLMACRO(v2); // ignored, NULLMACRO expanded to nothing. |
| 89 | } |
| 90 | |
| 91 | - ``-Wempty-init-stmt`` is a new diagnostic that diagnoses empty init-statements |
| 92 | of ``if``, ``switch``, ``range-based for``, unless: the semicolon directly |
| 93 | follows a macro that was expanded to nothing or if the semicolon is within the |
| 94 | macro itself (both macros from system headers, and normal macros). This |
| 95 | diagnostic is in the ``-Wextra-semi-stmt`` group and is enabled in |
| 96 | ``-Wextra``. |
| 97 | |
| 98 | .. code-block:: c++ |
| 99 | |
| 100 | void test() { |
| 101 | if(; // <- warning: init-statement of 'if' is a null statement |
| 102 | true) |
| 103 | ; |
| 104 | |
| 105 | switch (; // <- warning: init-statement of 'switch' is a null statement |
| 106 | x) { |
| 107 | ... |
| 108 | } |
| 109 | |
| 110 | for (; // <- warning: init-statement of 'range-based for' is a null statement |
| 111 | int y : S()) |
| 112 | ; |
| 113 | } |
| 114 | |
Roman Lebedev | 61061d6 | 2018-04-07 10:39:21 +0000 | [diff] [blame] | 115 | |
Erich Keane | b0c7809 | 2017-07-26 18:04:45 +0000 | [diff] [blame] | 116 | Non-comprehensive list of changes in this release |
| 117 | ------------------------------------------------- |
| 118 | |
Erich Keane | 0a6b5b6 | 2018-12-04 14:34:09 +0000 | [diff] [blame] | 119 | - The experimental feature Pretokenized Headers (PTH) was removed in its |
| 120 | entirely from Clang. The feature did not properly work with about 1/3 of the |
| 121 | possible tokens available and was unmaintained. |
Alex Lorenz | d8ec431 | 2017-12-14 19:22:02 +0000 | [diff] [blame] | 122 | |
Ilya Biryukov | 88aef52 | 2018-12-05 18:32:05 +0000 | [diff] [blame] | 123 | - The internals of libc++ include directory detection on MacOS have changed. |
| 124 | Instead of running a search based on the ``-resource-dir`` flag, the search |
| 125 | is now based on the path of the compiler in the filesystem. The default |
| 126 | behaviour should not change. However, if you override ``-resource-dir`` |
| 127 | manually and rely on the old behaviour you will need to add appropriate |
| 128 | compiler flags for finding the corresponding libc++ include directory. |
| 129 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 130 | New Compiler Flags |
| 131 | ------------------ |
| 132 | |
Calixte Denizet | f4bf671 | 2018-11-17 19:41:39 +0000 | [diff] [blame] | 133 | - ``-fprofile-filter-files=[regexes]`` and ``-fprofile-exclude-files=[regexes]``. |
| 134 | |
| 135 | Clang has now options to filter or exclude some files when |
| 136 | instrumenting for gcov-based profiling. |
| 137 | See the :doc:`UsersManual` for details. |
| 138 | |
Hans Wennborg | 7b852ea | 2018-01-03 15:49:39 +0000 | [diff] [blame] | 139 | - ... |
Aaron Ballman | 2b3bc4c | 2017-10-21 16:45:08 +0000 | [diff] [blame] | 140 | |
Joerg Sonnenberger | c919968 | 2017-07-01 21:36:21 +0000 | [diff] [blame] | 141 | Deprecated Compiler Flags |
| 142 | ------------------------- |
| 143 | |
| 144 | The following options are deprecated and ignored. They will be removed in |
| 145 | future versions of Clang. |
| 146 | |
Hans Wennborg | fbb21e0 | 2017-07-19 14:14:07 +0000 | [diff] [blame] | 147 | - ... |
Joerg Sonnenberger | c919968 | 2017-07-01 21:36:21 +0000 | [diff] [blame] | 148 | |
Yuka Takahashi | ba900ab | 2018-03-07 11:34:02 +0000 | [diff] [blame] | 149 | Modified Compiler Flags |
| 150 | ----------------------- |
| 151 | |
Richard Smith | 6822bd7 | 2018-10-26 19:26:45 +0000 | [diff] [blame] | 152 | - As of clang 8, `alignof` and `_Alignof` return the ABI alignment of a type, |
| 153 | as opposed to the preferred alignment. `__alignof` still returns the |
| 154 | preferred alignment. `-fclang-abi-compat=7` (and previous) will make |
| 155 | `alignof` and `_Alignof` return preferred alignment again. |
| 156 | |
Yuka Takahashi | ba900ab | 2018-03-07 11:34:02 +0000 | [diff] [blame] | 157 | |
Tyler Nowicki | db2668a | 2014-06-18 00:51:32 +0000 | [diff] [blame] | 158 | New Pragmas in Clang |
Eugene Zelenko | ad5684a | 2018-05-15 21:45:01 +0000 | [diff] [blame] | 159 | -------------------- |
Tyler Nowicki | db2668a | 2014-06-18 00:51:32 +0000 | [diff] [blame] | 160 | |
Erik Pilkington | 7d18094 | 2018-10-29 17:38:42 +0000 | [diff] [blame] | 161 | - Clang now supports adding multiple `#pragma clang attribute` attributes into |
| 162 | a scope of pushed attributes. |
Paul Robinson | f9ede1c | 2016-07-18 17:19:12 +0000 | [diff] [blame] | 163 | |
| 164 | Attribute Changes in Clang |
| 165 | -------------------------- |
| 166 | |
Hans Wennborg | fbb21e0 | 2017-07-19 14:14:07 +0000 | [diff] [blame] | 167 | - ... |
Paul Robinson | f9ede1c | 2016-07-18 17:19:12 +0000 | [diff] [blame] | 168 | |
Hans Wennborg | 02dc000 | 2014-08-05 00:21:23 +0000 | [diff] [blame] | 169 | Windows Support |
| 170 | --------------- |
| 171 | |
Mike Rice | 58df1af | 2018-09-11 17:10:44 +0000 | [diff] [blame] | 172 | - clang-cl now supports the use of the precompiled header options /Yc and /Yu |
| 173 | without the filename argument. When these options are used without the |
| 174 | filename, a `#pragma hdrstop` inside the source marks the end of the |
| 175 | precompiled code. |
| 176 | |
Hans Wennborg | a97c4e3 | 2018-11-12 08:42:21 +0000 | [diff] [blame] | 177 | - clang-cl has a new command-line option, ``/Zc:dllexportInlines-``, similar to |
| 178 | ``-fvisibility-inlines-hidden`` on non-Windows, that makes class-level |
| 179 | `dllexport` and `dllimport` attributes not apply to inline member functions. |
| 180 | This can significantly reduce compile and link times. See the `User's Manual |
| 181 | <UsersManual.html#the-zc-dllexportinlines-option>`_ for more info. |
Nico Weber | 1dbff9a | 2018-07-18 11:55:03 +0000 | [diff] [blame] | 182 | - ... |
Hans Wennborg | 02dc000 | 2014-08-05 00:21:23 +0000 | [diff] [blame] | 183 | |
| 184 | |
Renato Golin | f2fcddb | 2013-12-13 09:27:34 +0000 | [diff] [blame] | 185 | C Language Changes in Clang |
| 186 | --------------------------- |
| 187 | |
Hans Wennborg | 60d06bf | 2016-07-18 18:05:19 +0000 | [diff] [blame] | 188 | - ... |
Pirama Arumuga Nainar | c85c853 | 2016-06-21 16:09:30 +0000 | [diff] [blame] | 189 | |
Renato Golin | f2fcddb | 2013-12-13 09:27:34 +0000 | [diff] [blame] | 190 | ... |
| 191 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 192 | C11 Feature Support |
| 193 | ^^^^^^^^^^^^^^^^^^^ |
| 194 | |
| 195 | ... |
| 196 | |
| 197 | C++ Language Changes in Clang |
| 198 | ----------------------------- |
| 199 | |
Hans Wennborg | 7b852ea | 2018-01-03 15:49:39 +0000 | [diff] [blame] | 200 | - ... |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 201 | |
| 202 | C++1z Feature Support |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 203 | ^^^^^^^^^^^^^^^^^^^^^ |
| 204 | |
| 205 | ... |
| 206 | |
| 207 | Objective-C Language Changes in Clang |
| 208 | ------------------------------------- |
| 209 | |
| 210 | ... |
| 211 | |
Erik Schnetter | 489700d | 2013-11-11 06:36:33 +0000 | [diff] [blame] | 212 | OpenCL C Language Changes in Clang |
| 213 | ---------------------------------- |
| 214 | |
Bill Wendling | 0a794a4b | 2013-11-20 10:13:37 +0000 | [diff] [blame] | 215 | ... |
Erik Schnetter | 489700d | 2013-11-11 06:36:33 +0000 | [diff] [blame] | 216 | |
Richard Smith | 6822bd7 | 2018-10-26 19:26:45 +0000 | [diff] [blame] | 217 | ABI Changes in Clang |
| 218 | -------------------- |
| 219 | |
| 220 | - `_Alignof` and `alignof` now return the ABI alignment of a type, as opposed |
| 221 | to the preferred alignment. |
Jonas Toth | aa51ef1 | 2018-10-31 17:00:50 +0000 | [diff] [blame] | 222 | |
Richard Smith | 6822bd7 | 2018-10-26 19:26:45 +0000 | [diff] [blame] | 223 | - This is more in keeping with the language of the standards, as well as |
| 224 | being compatible with gcc |
| 225 | - `__alignof` and `__alignof__` still return the preferred alignment of |
| 226 | a type |
| 227 | - This shouldn't break any ABI except for things that explicitly ask for |
| 228 | `alignas(alignof(T))`. |
| 229 | - If you have interfaces that break with this change, you may wish to switch |
| 230 | to `alignas(__alignof(T))`, instead of using the `-fclang-abi-compat` |
| 231 | switch. |
| 232 | |
Alexey Bataev | 44b6750 | 2016-05-31 11:17:08 +0000 | [diff] [blame] | 233 | OpenMP Support in Clang |
| 234 | ---------------------------------- |
| 235 | |
Alexey Bataev | 2819d4d | 2019-01-09 20:32:56 +0000 | [diff] [blame] | 236 | - Support relational-op != (not-equal) as one of the canonical forms of random |
| 237 | access iterator. |
| 238 | |
| 239 | - Added support for mapping of the lambdas in target regions. |
| 240 | |
| 241 | - Added parsing/sema analysis for OpenMP 5.0 requires directive. |
| 242 | |
| 243 | - Various bugfixes and improvements. |
| 244 | |
| 245 | New features supported for Cuda devices: |
| 246 | |
| 247 | - Added support for the reductions across the teams. |
| 248 | |
| 249 | - Extended number of constructs that can be executed in SPMD mode. |
| 250 | |
| 251 | - Fixed support for lastprivate/reduction variables in SPMD constructs. |
| 252 | |
| 253 | - General performance improvement. |
Alexey Bataev | 44b6750 | 2016-05-31 11:17:08 +0000 | [diff] [blame] | 254 | |
Jonas Hahnfeld | 8da9c2a | 2018-04-20 13:04:54 +0000 | [diff] [blame] | 255 | CUDA Support in Clang |
| 256 | --------------------- |
| 257 | |
Jonas Hahnfeld | 8da9c2a | 2018-04-20 13:04:54 +0000 | [diff] [blame] | 258 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 259 | Internal API Changes |
| 260 | -------------------- |
| 261 | |
Hans Wennborg | 3d0d25d | 2018-08-01 14:01:27 +0000 | [diff] [blame] | 262 | These are major API changes that have happened since the 7.0.0 release of |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 263 | Clang. If upgrading an external codebase that uses Clang as a library, |
| 264 | this section should help get you past the largest hurdles of upgrading. |
| 265 | |
Vedant Kumar | 5fb00e4 | 2016-07-27 23:01:55 +0000 | [diff] [blame] | 266 | - ... |
Richard Smith | a0334a9 | 2015-05-14 00:22:12 +0000 | [diff] [blame] | 267 | |
Aaron Ballman | cdc43af | 2015-09-17 13:47:22 +0000 | [diff] [blame] | 268 | AST Matchers |
| 269 | ------------ |
Aaron Ballman | cdc43af | 2015-09-17 13:47:22 +0000 | [diff] [blame] | 270 | |
Hans Wennborg | 7b852ea | 2018-01-03 15:49:39 +0000 | [diff] [blame] | 271 | - ... |
Sylvestre Ledru | 72e3fa7 | 2017-03-14 09:43:55 +0000 | [diff] [blame] | 272 | |
| 273 | clang-format |
| 274 | ------------ |
| 275 | |
Krasimir Georgiev | f2ca41d | 2018-05-08 09:25:12 +0000 | [diff] [blame] | 276 | |
Hans Wennborg | 7b852ea | 2018-01-03 15:49:39 +0000 | [diff] [blame] | 277 | - ... |
Sylvestre Ledru | c941039 | 2017-12-05 09:23:47 +0000 | [diff] [blame] | 278 | |
Ted Kremenek | 3a2291b | 2013-04-24 07:33:52 +0000 | [diff] [blame] | 279 | libclang |
| 280 | -------- |
| 281 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 282 | ... |
Ted Kremenek | 3a2291b | 2013-04-24 07:33:52 +0000 | [diff] [blame] | 283 | |
Sylvestre Ledru | ea49d3a | 2016-08-06 20:23:54 +0000 | [diff] [blame] | 284 | |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 285 | Static Analyzer |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 286 | --------------- |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 287 | |
Hans Wennborg | 7b852ea | 2018-01-03 15:49:39 +0000 | [diff] [blame] | 288 | - ... |
Roman Lebedev | 88b56ca | 2017-11-30 09:18:35 +0000 | [diff] [blame] | 289 | |
Bill Wendling | 0a794a4b | 2013-11-20 10:13:37 +0000 | [diff] [blame] | 290 | ... |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 291 | |
Roman Lebedev | b69ba22 | 2018-07-30 18:58:30 +0000 | [diff] [blame] | 292 | .. _release-notes-ubsan: |
| 293 | |
Vedant Kumar | 840c2c7 | 2017-06-13 02:52:31 +0000 | [diff] [blame] | 294 | Undefined Behavior Sanitizer (UBSan) |
| 295 | ------------------------------------ |
| 296 | |
Roman Lebedev | 62debd80 | 2018-10-30 21:58:56 +0000 | [diff] [blame] | 297 | * The Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) group |
| 298 | was extended. One more type of issues is caught - implicit integer sign change. |
| 299 | (``-fsanitize=implicit-integer-sign-change``). |
| 300 | This makes the Implicit Conversion Sanitizer feature-complete, |
| 301 | with only missing piece being bitfield handling. |
| 302 | While there is a ``-Wsign-conversion`` diagnostic group that catches this kind |
| 303 | of issues, it is both noisy, and does not catch **all** the cases. |
| 304 | |
| 305 | .. code-block:: c++ |
| 306 | |
| 307 | bool consume(unsigned int val); |
| 308 | |
| 309 | void test(int val) { |
| 310 | (void)consume(val); // If the value was negative, it is now large positive. |
| 311 | (void)consume((unsigned int)val); // OK, the conversion is explicit. |
| 312 | } |
| 313 | |
| 314 | Like some other ``-fsanitize=integer`` checks, these issues are **not** |
| 315 | undefined behaviour. But they are not *always* intentional, and are somewhat |
| 316 | hard to track down. This group is **not** enabled by ``-fsanitize=undefined``, |
| 317 | but the ``-fsanitize=implicit-integer-sign-change`` check |
| 318 | is enabled by ``-fsanitize=integer``. |
| 319 | (as is ``-fsanitize=implicit-integer-truncation`` check) |
Vedant Kumar | 840c2c7 | 2017-06-13 02:52:31 +0000 | [diff] [blame] | 320 | |
Roman Lebedev | d677c3f | 2018-11-19 19:56:43 +0000 | [diff] [blame] | 321 | * The Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) has |
| 322 | learned to sanitize compound assignment operators. |
| 323 | |
Roman Lebedev | bd1c087 | 2019-01-15 09:44:25 +0000 | [diff] [blame^] | 324 | * ``alignment`` check has learned to sanitize the assume_aligned-like attributes: |
| 325 | |
| 326 | .. code-block:: c++ |
| 327 | |
| 328 | typedef char **__attribute__((align_value(1024))) aligned_char; |
| 329 | struct ac_struct { |
| 330 | aligned_char a; |
| 331 | }; |
| 332 | char **load_from_ac_struct(struct ac_struct *x) { |
| 333 | return x->a; // <- check that loaded 'a' is aligned |
| 334 | } |
| 335 | |
| 336 | char **passthrough(__attribute__((align_value(1024))) char **x) { |
| 337 | return x; // <- check the pointer passed as function argument |
| 338 | } |
| 339 | |
| 340 | char **__attribute__((alloc_align(2))) |
| 341 | alloc_align(int size, unsigned long alignment); |
| 342 | |
| 343 | char **caller(int size) { |
| 344 | return alloc_align(size, 1024); // <- check returned pointer |
| 345 | } |
| 346 | |
| 347 | char **__attribute__((assume_aligned(1024))) get_ptr(); |
| 348 | |
| 349 | char **caller2() { |
| 350 | return get_ptr(); // <- check returned pointer |
| 351 | } |
| 352 | |
| 353 | void *caller3(char **x) { |
| 354 | return __builtin_assume_aligned(x, 1024); // <- check returned pointer |
| 355 | } |
| 356 | |
| 357 | void *caller4(char **x, unsigned long offset) { |
| 358 | return __builtin_assume_aligned(x, 1024, offset); // <- check returned pointer accounting for the offest |
| 359 | } |
| 360 | |
| 361 | void process(char *data, int width) { |
| 362 | #pragma omp for simd aligned(data : 1024) // <- aligned clause will be checked. |
| 363 | for (int x = 0; x < width; x++) |
| 364 | data[x] *= data[x]; |
| 365 | } |
| 366 | |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 367 | Core Analysis Improvements |
| 368 | ========================== |
| 369 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 370 | - ... |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 371 | |
| 372 | New Issues Found |
| 373 | ================ |
| 374 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 375 | - ... |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 376 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 377 | Python Binding Changes |
| 378 | ---------------------- |
| 379 | |
| 380 | The following methods have been added: |
| 381 | |
| 382 | - ... |
| 383 | |
| 384 | Significant Known Problems |
| 385 | ========================== |
| 386 | |
| 387 | Additional Information |
| 388 | ====================== |
| 389 | |
| 390 | A wide variety of additional information is available on the `Clang web |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 391 | page <https://clang.llvm.org/>`_. The web page contains versions of the |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 392 | API documentation which are up-to-date with the Subversion version of |
| 393 | the source code. You can access versions of these documents specific to |
| 394 | this release by going into the "``clang/docs/``" directory in the Clang |
| 395 | tree. |
| 396 | |
| 397 | If you have any questions or comments about Clang, please feel free to |
| 398 | contact us via the `mailing |
Hans Wennborg | 0aa0d91 | 2018-09-10 08:51:25 +0000 | [diff] [blame] | 399 | list <https://lists.llvm.org/mailman/listinfo/cfe-dev>`_. |