summaryrefslogtreecommitdiffstats
path: root/clang/docs
Commit message (Collapse)AuthorAgeFilesLines
* [Modules] Add more language features to be used with requires-declarationBruno Cardoso Lopes2018-02-141-0/+15
| | | | | | | | | Features added: c99, c11, c17, cplusplus14 and cplusplus17. rdar://problem/36328787 rdar://problem/36668431 llvm-svn: 325154
* [Driver] Add option to manually control discarding value names in LLVM IR.Eric Fiselier2018-02-071-0/+21
| | | | | | | | | | | | | | | | | | | Summary: Currently, assertion-disabled Clang builds emit value names when generating LLVM IR. This is controlled by the `NDEBUG` macro, and is not easily overridable. In order to get IR output containing names from a release build of Clang, the user must manually construct the CC1 invocation w/o the `-discard-value-names` option. This is less than ideal. For example, Godbolt uses a release build of Clang, and so when asked to emit LLVM IR the result lacks names, making it harder to read. Manually invoking CC1 on Compiler Explorer is not feasible. This patch adds the driver options `-fdiscard-value-names` and `-fno-discard-value-names` which allow the user to override the default behavior. If neither is specified, the old behavior remains. Reviewers: erichkeane, aaron.ballman, lebedev.ri Reviewed By: aaron.ballman Subscribers: bogner, cfe-commits Differential Revision: https://reviews.llvm.org/D42887 llvm-svn: 324498
* Support `#pragma comment(lib, "name")` in the frontend for ELFSaleem Abdulrasool2018-02-071-0/+8
| | | | | | | | | | | | | This adds the frontend support required to support the use of the comment pragma to enable auto linking on ELFish targets. This is a generic ELF extension supported by LLVM. We need to change the handling for the "dependentlib" in order to accommodate the previously discussed encoding for the dependent library descriptor. Without the custom handling of the PCK_Lib directive, the -l prefixed option would be encoded into the resulting object (which is treated as a frontend error). llvm-svn: 324438
* [hwasan] Add a paragraph on stack instrumentation.Evgeniy Stepanov2018-02-031-3/+10
| | | | | | | | | | Reviewers: kcc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42874 llvm-svn: 324163
* Clarify that optimization levels -O2 and above are recommended for use of PGO.Eric Christopher2018-01-311-1/+2
| | | | llvm-svn: 323902
* [NFC] fix trivial typos in comments and documentsHiroshi Inoue2018-01-262-2/+2
| | | | | | "in in" -> "in", "on on" -> "on" etc. llvm-svn: 323509
* Fix typos of occurred and occurrenceMalcolm Parsons2018-01-241-1/+1
| | | | llvm-svn: 323316
* [Docs] Re-generate command line documentation.Craig Topper2018-01-231-0/+18
| | | | llvm-svn: 323235
* Add hasTrailingReturn AST matcherJulie Hockett2018-01-221-0/+9
| | | | | | | | Adds AST matcher for a FunctionDecl that has a trailing return type. Differential Revision: https://reviews.llvm.org/D42273 llvm-svn: 323158
* [ASTMatchers] [NFC] Fix code examplesFangrui Song2018-01-221-29/+31
| | | | | | | | Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42213 llvm-svn: 323157
* [DOCS] Mention OpenMP Tools Interface in runtime libraryJonas Hahnfeld2018-01-221-1/+1
| | | | | | | | | Also list supported configurations (architectures + operating systems). Differential Revision: https://reviews.llvm.org/D42349 llvm-svn: 323123
* [WebAssembly] Add target flags for sign-ext opcodes.Dan Gohman2018-01-191-0/+2
| | | | | | | Add -msign-ext and -mno-sign-ext to control the new sign-ext target feature. llvm-svn: 322967
* [clang-format] Adds a canonical delimiter to raw string formattingKrasimir Georgiev2018-01-191-0/+4
| | | | | | | | | | | | | | | | Summary: This patch adds canonical delimiter support to the raw string formatting. This allows matching delimiters to be updated to the canonical one. Reviewers: bkramer Reviewed By: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42187 llvm-svn: 322956
* [ASTMatcher] Add isScoped matcher for enumDecl.Haojian Wu2018-01-181-0/+9
| | | | | | | | | | | | Summary: Reviewers: bkramer, aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42185 llvm-svn: 322826
* [ASTMatchers] Support generating docs for single-line matchersBenjamin Kramer2018-01-171-1/+1
| | | | | | clang-format likes this format. PR35989. llvm-svn: 322783
* [ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarationsRoman Lebedev2018-01-171-0/+14
| | | | | | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: dblaikie, klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D41455 llvm-svn: 322746
* Update dump_ast_matchers for many recent changes.Benjamin Kramer2018-01-172-88/+258
| | | | | | | The html file hasn't been updated in a long time so there are quite a few changes in there. No matchers were removed though. llvm-svn: 322687
* [clang-format] adds enclosing function detection to raw string formattingKrasimir Georgiev2018-01-171-21/+36
| | | | | | | | | | | | | | Summary: This patch adds enclosing function detection to raw string formatting. Reviewers: bkramer Reviewed By: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42167 llvm-svn: 322678
* [DOCS] Updated current status of OpenMP support, NFC.Alexey Bataev2018-01-161-6/+6
| | | | llvm-svn: 322589
* [NFC] fix trivial typo in documentHiroshi Inoue2018-01-161-1/+1
| | | | | | "the the" -> "the" llvm-svn: 322551
* [OPENMP] Update status of OpenMP support, NFC.Alexey Bataev2018-01-151-2/+2
| | | | llvm-svn: 322516
* [OPENMP] Update docs for OpenMP status, NFC.Alexey Bataev2018-01-151-1/+1
| | | | llvm-svn: 322502
* [docs] Use monospace for PCH option flagsBrian Gesiak2018-01-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use monospace for option flags in the PCH section, instead of the italics that were being used previously. I believe these used to be links, for which single backticks would have been appropriate, but since they were un-link-ified in https://reviews.llvm.org/rL275560, I believe monospace is now more appropriate, and so two backticks are needed. Test Plan: Build the `docs-clang-html` target and confirm the options are rendered using monospace font. Reviewers: sepavloff, aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42005 llvm-svn: 322447
* [Docs] Fix typo in toolchain documentationCraig Topper2018-01-121-1/+1
| | | | llvm-svn: 322347
* Add `__reference_binds_to_temporary` trait for checking safe reference ↵Eric Fiselier2018-01-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: The STL types `std::pair` and `std::tuple` can both store reference types. However their constructors cannot adequately check if the initialization of reference types is safe. For example: ``` std::tuple<std::tuple<int> const&> t = 42; // The stored reference is already dangling. ``` Libc++ has a best effort attempts in tuple to diagnose this, but they're not able to handle all valid cases (If I'm not mistaken). For example initialization of a reference from the result of a class's conversion operator. Libc++ would benefit from having a builtin traits which can provide a much better implementation. This patch introduce the `__reference_binds_to_temporary(T, U)` trait that determines whether a reference of type `T` bound to an expression of type `U` would bind to a materialized temporary object. Note that the trait simply returns false if `T` is not a reference type instead of reporting it as an error. ``` static_assert(__is_constructible(int const&, long)); static_assert(__reference_binds_to_temporary(int const&, long)); ``` Reviewers: majnemer, rsmith Reviewed By: rsmith Subscribers: compnerd, cfe-commits Differential Revision: https://reviews.llvm.org/D29930 llvm-svn: 322334
* Document attribute target multiversioning.Erich Keane2018-01-081-0/+6
| | | | | | | | | | Add attribute target multiversioning to the release notes. Additionally adds multiversioning support to the attribute documentation for 'target'. Differential Revision: https://reviews.llvm.org/D41837 llvm-svn: 322043
* [OPENMP] Current status of OpenMP support.Alexey Bataev2018-01-082-0/+69
| | | | | | | | | | | | Summary: Some info about supported features of OpenMP 4.5-5.0. Reviewers: hfinkel, rsmith Subscribers: kkwli0, Hahnfeld, cfe-commits Differential Revision: https://reviews.llvm.org/D39457 llvm-svn: 322018
* [Docs] Re-generate command line documentation, primarily to get the icelake ↵Craig Topper2018-01-031-1/+21
| | | | | | feature command line options in, but there were a couple other changes too. llvm-svn: 321749
* Update docs version and clear release notes for 7.0.0Hans Wennborg2018-01-032-172/+16
| | | | llvm-svn: 321728
* UserManual: Update with the latest clang-cl flagsHans Wennborg2018-01-031-1/+8
| | | | llvm-svn: 321705
* Fixed markup formattingSerge Pavlov2018-01-011-1/+1
| | | | llvm-svn: 321623
* Enable configuration files in clangSerge Pavlov2018-01-011-0/+73
| | | | | | | | | | | | | | | | | | | | | Clang is inherently a cross compiler and can generate code for any target enabled during build. It however requires to specify many parameters in the invocation, which could be hardcoded during configuration process in the case of single-target compiler. The purpose of configuration files is to make specifying clang arguments easier. A configuration file is a collection of driver options, which are inserted into command line before other options specified in the clang invocation. It groups related options together and allows specifying them in simpler, more flexible and less error prone way than just listing the options somewhere in build scripts. Configuration file may be thought as a "macro" that names an option set and is expanded when the driver is called. Use of configuration files is described in `UserManual.rst`. Differential Revision: https://reviews.llvm.org/D24933 llvm-svn: 321621
* Reverted 321587: Enable configuration files in clangSerge Pavlov2017-12-301-71/+0
| | | | | | Need to check targets in tests more carefully. llvm-svn: 321588
* Enable configuration files in clangSerge Pavlov2017-12-301-0/+71
| | | | | | | | | | | | | | | | | | | | | Clang is inherently a cross compiler and can generate code for any target enabled during build. It however requires to specify many parameters in the invocation, which could be hardcoded during configuration process in the case of single-target compiler. The purpose of configuration files is to make specifying clang arguments easier. A configuration file is a collection of driver options, which are inserted into command line before other options specified in the clang invocation. It groups related options together and allows specifying them in simpler, more flexible and less error prone way than just listing the options somewhere in build scripts. Configuration file may be thought as a "macro" that names an option set and is expanded when the driver is called. Use of configuration files is described in `UserManual.rst`. Differential Revision: https://reviews.llvm.org/D24933 llvm-svn: 321587
* [docs] Added description of `-f[no]-openmp-simd` option to UsersManual.Alexey Bataev2017-12-291-0/+5
| | | | llvm-svn: 321562
* [docs] Updated ReleaseNotes for OpenMP part.Alexey Bataev2017-12-291-1/+12
| | | | llvm-svn: 321561
* [Modules] Change private modules rules and warningsBruno Cardoso Lopes2017-12-221-14/+15
| | | | | | | | | | | | | | | | We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 llvm-svn: 321337
* [ubsan] Diagnose noreturn functions which returnVedant Kumar2017-12-211-2/+2
| | | | | | | | | | | | | | | | | | Diagnose 'unreachable' UB when a noreturn function returns. 1. Insert a check at the end of functions marked noreturn. 2. A decl may be marked noreturn in the caller TU, but not marked in the TU where it's defined. To diagnose this scenario, strip away the noreturn attribute on the callee and insert check after calls to it. Testing: check-clang, check-ubsan, check-ubsan-minimal, D40700 rdar://33660464 Differential Revision: https://reviews.llvm.org/D40698 llvm-svn: 321231
* [hwasan] update the design docKostya Serebryany2017-12-181-9/+25
| | | | llvm-svn: 321027
* Harmonize GNU- and C++-style attribute spellings.Aaron Ballman2017-12-141-0/+6
| | | | | | | | Most attributes will now use the Clang<"name"> construct to provide both __attribute__((name)) and [[clang::name]] syntaxes for the attribute. Attributes deviating from this should be marked with a comment explaining why they are not supported under both spellings. Common reasons are: the attribute is provided by some other specification that controls the syntax or the attribute cannot be exposed under a particular spelling for some given reason. Because this is a mechanical change that only introduces new spellings, there are no test cases for the commit. llvm-svn: 320752
* [Preprocessor] Implement __is_target_{arch|vendor|os|environment} function-likeAlex Lorenz2017-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | builtin macros This patch implements the __is_target_arch, __is_target_vendor, __is_target_os, and __is_target_environment Clang preprocessor extensions that were proposed by @compnerd in Bob's cfe-dev post: http://lists.llvm.org/pipermail/cfe-dev/2017-November/056166.html. These macros can be used to examine the components of the target triple at compile time. A has_builtin(is_target_???) preprocessor check can be used to check for their availability. __is_target_arch allows you to check if an arch is specified without worring about a specific subarch, e.g. __is_target_arch(arm) returns 1 for the target arch "armv7" __is_target_arch(armv7) returns 1 for the target arch "armv7" __is_target_arch(armv6) returns 0 for the target arch "armv7" __is_target_vendor and __is_target_environment match the specific vendor or environment. __is_target_os matches the specific OS, but __is_target_os(darwin) will match any Darwin-based OS. "Unknown" can be used to test if the triple's component is specified. rdar://35753116 Differential Revision: https://reviews.llvm.org/D41087 llvm-svn: 320734
* [Driver][CodeGen] Add -mprefer-vector-width driver option and attribute ↵Craig Topper2017-12-111-0/+4
| | | | | | | | | | | | | | | | during CodeGen. This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend. Clang will take the value and add it as a new function attribute during CodeGen. This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values. Differential Revision: https://reviews.llvm.org/D40230 llvm-svn: 320419
* [Docs] Regenerate command line documentation.Craig Topper2017-12-111-8/+22
| | | | llvm-svn: 320418
* Switch to gnu++14 as the default dialect.Tim Northover2017-12-091-1/+4
| | | | | | This is C++14 with conforming GNU extensions. llvm-svn: 320250
* [hwasan] typo in docsKostya Serebryany2017-12-081-1/+1
| | | | llvm-svn: 320168
* Add new language mode flags for C17.Aaron Ballman2017-12-071-0/+6
| | | | | | This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is expected that we (and GCC) will add c18 flags as aliases once the ballot passes. llvm-svn: 320089
* Add support for the __has_c_attribute builtin preprocessor macro.Aaron Ballman2017-12-072-0/+34
| | | | | | This behaves similar to the __has_cpp_attribute builtin macro in that it allows users to detect whether an attribute is supported with the [[]] spelling syntax, which can be enabled in C with -fdouble-square-bracket-attributes. llvm-svn: 320088
* update hwasan docsKostya Serebryany2017-12-071-8/+24
| | | | | | | | | | | | | | | | Summary: * use more readable name * document the hwasan attribute Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D40938 llvm-svn: 320075
* [clang-format] Releasenotes for rL319024 : Add option to group multiple ↵Sylvestre Ledru2017-12-051-0/+13
| | | | | | | | | | | | | | | | | | #include blocks when sorting includes Summary: This change adds missing releasenotes for commit rL319024 https://reviews.llvm.org/rL319024 Patch by Krzysztof Kapusta Reviewers: sylvestre.ledru Reviewed By: sylvestre.ledru Differential Revision: https://reviews.llvm.org/D40827 llvm-svn: 319748
* design document for a hardware-assisted memory safety (HWAMS) tool, similar ↵Kostya Serebryany2017-12-042-0/+124
| | | | | | | | | | | | | | | | | | | | to AddressSanitizer Summary: preliminary design document for a hardware-assisted memory safety (HWAMS) tool, similar to AddressSanitizer The name TaggedAddressSanitizer and the rest of the document, are early draft, suggestions are welcome. The code will follow shortly. Reviewers: eugenis, alekseyshl Reviewed By: eugenis Subscribers: davidxl, cryptoad, fedor.sergeev, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D40568 llvm-svn: 319684
OpenPOWER on IntegriCloud