summaryrefslogtreecommitdiffstats
path: root/clang/docs
Commit message (Collapse)AuthorAgeFilesLines
...
* Add objcCategoryImplDecl matcherDave Lee2017-10-261-0/+9
| | | | | | | | | | | | | | | | | Summary: Add `objcCategoryImplDecl` which matches ObjC category definitions (`@implementation`). This matcher complements `objcCategoryDecl` (`@interface`) which was added in D30854. Reviewers: aaron.ballman, malcolm.parsons, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39293 llvm-svn: 316670
* [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other ↵Roman Lebedev2017-10-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than NULL. Summary: The warning was initially introduced in D32914 by @thakis, and the concerns were raised there, and later in rL302247 and PR33771. I do believe that it makes sense to relax the diagnostic e.g. in this case, when the expression originates from the system header, which can not be modified. This prevents adoption for the diagnostic for codebases which use pthreads (`PTHREAD_MUTEX_INITIALIZER`), gtest, etc. As @malcolm.parsons suggests, it *may* make sense to also not warn for the template types, but it is not obvious to me how to do that in here. Though, it still makes sense to complain about `NULL` macro. While there, add more tests. Reviewers: dblaikie, thakis, rsmith, rjmccall, aaron.ballman Reviewed By: thakis Subscribers: Rakete1111, hans, cfe-commits, thakis, malcolm.parsons Tags: #clang Differential Revision: https://reviews.llvm.org/D38954 llvm-svn: 316662
* [Sema] Document+test the -Wsign-compare change for enums in C code [NFC]Roman Lebedev2017-10-241-0/+4
| | | | | | | | | | | | | | | | | | rL316268 / D39122 has fixed PR35009, and now when in C, these three(?) diagnostics properly use the enum's underlying datatype. While it was fixed, the test coverage was clearly insufficient, because the -Wsign-compare change didn't show up in any of the tests, until it was reported in the post-commit mail for rL316268. So add the test for the -Wsign-compare diagnostic for enum for C code, and while there, document this in the release notes. The fix itself was obviously correct, so unless we want to silence this new diagnosed case, i deem this commit to be NFC. llvm-svn: 316500
* Add release notes for the recent -fdouble-square-bracket-attributes and ↵Aaron Ballman2017-10-211-0/+7
| | | | | | -fno-double-square-bracket-attributes compiler flags. llvm-svn: 316269
* [Sema] Re-land: Diagnose tautological comparison with type's min/max valuesRoman Lebedev2017-10-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The first attempt, rL315614 was reverted because one libcxx test broke, and i did not know at the time how to deal with it. Summary: Currently, clang only diagnoses completely out-of-range comparisons (e.g. `char` and constant `300`), and comparisons of unsigned and `0`. But gcc also does diagnose the comparisons with the `std::numeric_limits<>::max()` / `std::numeric_limits<>::min()` so to speak Finally Fixes https://bugs.llvm.org/show_bug.cgi?id=34147 Continuation of https://reviews.llvm.org/D37565 Reviewers: rjmccall, rsmith, aaron.ballman Reviewed By: rsmith Subscribers: rtrieu, jroelofs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38101 llvm-svn: 315875
* Revert "[Sema] Diagnose tautological comparison with type's min/max values"Roman Lebedev2017-10-121-4/+0
| | | | | | | | | | | | | | | | | | | | | This reverts r315614,r315615,r315621,r315622 Breaks http://bb9.pgr.jp/#/builders/20/builds/59 /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:95:17: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare] if (max_sec > Lim::max()) return false; ~~~~~~~ ^ ~~~~~~~~~~ /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:13: error: comparison 'long long' < -9223372036854775808 is always false [-Werror,-Wtautological-constant-compare] if (sec < Lim::min() || sec > Lim::max()) return false; ~~~ ^ ~~~~~~~~~~ /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:33: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare] if (sec < Lim::min() || sec > Lim::max()) return false; ~~~ ^ ~~~~~~~~~~ 3 errors generated. -- I'm not yet sure what is the proper fix. llvm-svn: 315631
* [Sema] Diagnose tautological comparison with type's min/max valuesRoman Lebedev2017-10-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, clang only diagnoses completely out-of-range comparisons (e.g. `char` and constant `300`), and comparisons of unsigned and `0`. But gcc also does diagnose the comparisons with the `std::numeric_limits<>::max()` / `std::numeric_limits<>::min()` so to speak Finally Fixes https://bugs.llvm.org/show_bug.cgi?id=34147 Continuation of https://reviews.llvm.org/D37565 Reviewers: rjmccall, rsmith, aaron.ballman Reviewed By: rsmith Subscribers: rtrieu, jroelofs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38101 llvm-svn: 315614
* Split the AlignTrailingComments on several lines. The comments were applied ↵Sylvestre Ledru2017-10-121-3/+7
| | | | | | to the right columns llvm-svn: 315568
* Fix small nits in clang-refactor doc.Haojian Wu2017-10-101-2/+2
| | | | llvm-svn: 315286
* Fix typos in documentationJan Korous2017-10-091-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D38711 llvm-svn: 315252
* [MS] Raise the default value of _MSC_VER to 1911, which is VS 2017Reid Kleckner2017-10-061-0/+5
| | | | | | | | | | | | | | | | Summary: This raises our default past 1900, which controls whether char16_t is a builtin type or not. Implements PR34243 Reviewers: hans Subscribers: STL_MSFT, rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D38646 llvm-svn: 315107
* [docs][refactor] Add refactoring engine design documentationAlex Lorenz2017-09-292-0/+254
| | | | | | | | | This commit adds a refactoring engine design document that talks about the design and provides several example of how the engine can be used. Differential Revision: https://reviews.llvm.org/D37976 llvm-svn: 314509
* Add the new -Wnull-pointer-arithmetic warnings to the release notesSylvestre Ledru2017-09-281-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D38186 llvm-svn: 314387
* [analyzer] Keep track of design discusions as part of analyzer documentation.Artem Dergachev2017-09-261-0/+321
| | | | | | | | | | | | Create a directory to store discussions on potentially useful features that are not yet implemented in the analyzer. Fill it with a discussion on representing checker-specific parts of the program state for C++ object modeling, that occured in D35216. Differential Revision: https://reviews.llvm.org/D36737 llvm-svn: 314218
* Allow specifying sanitizers in blacklistsVlad Tsyrklevich2017-09-252-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the follow-up patch to D37924. This change refactors clang to use the the newly added section headers in SpecialCaseList to specify which sanitizers blacklists entries should apply to, like so: [cfi-vcall] fun:*bad_vcall* [cfi-derived-cast|cfi-unrelated-cast] fun:*bad_cast* The SanitizerSpecialCaseList class has been added to allow querying by SanitizerMask, and SanitizerBlacklist and its downstream users have been updated to provide that information. Old blacklists not using sections will continue to function identically since the blacklist entries will be placed into a '[*]' section by default matching against all sanitizers. Reviewers: pcc, kcc, eugenis, vsk Reviewed By: eugenis Subscribers: dberris, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37925 llvm-svn: 314171
* [docs] Fix typos in Clang's User's Manual.Reka Kovacs2017-09-231-2/+2
| | | | llvm-svn: 314061
* [clang] Fix isExternC matcher docsAlexander Shaposhnikov2017-09-221-8/+14
| | | | | | | | | | | The wording in the documentation for the matcher isExternC appears to be misleading since this matcher is applicable to functions and variables as well. This diff changes the comment and regenerates the html file. Differential revision: https://reviews.llvm.org/D38151 llvm-svn: 314022
* [Docs] Document cache pruning support for goldYi Kong2017-09-181-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D37995 llvm-svn: 313591
* [docs] add Windows examples to ThinLTO.rstBob Haarman2017-09-161-5/+21
| | | | | | | | | | | | Reviewers: pcc, ruiu Reviewed By: ruiu Subscribers: mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D37943 llvm-svn: 313425
* [clang-format] New flag - BraceWrapping.AfterExternBlockKrasimir Georgiev2017-09-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Bug: https://bugs.llvm.org/show_bug.cgi?id=34016 - **"extern C part"** **Problem:** Due to the lack of "brace wrapping extern" flag, clang format does parse the block after **extern** keyword moving the opening bracket to the header line always! **Patch description:** A new style added, new configuration flag - **BraceWrapping.AfterExternBlock** that allows us to decide whether we want a break before brace or not. Reviewers: djasper, krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37845 Contributed by @PriMee! llvm-svn: 313354
* Fix reStructuredText warning.Douglas Gregor2017-09-141-1/+1
| | | | llvm-svn: 313320
* Minor cleanups to address feedback from Bruno. NFCDouglas Gregor2017-09-141-8/+7
| | | | llvm-svn: 313318
* [Module map] Introduce a private module re-export directive.Douglas Gregor2017-09-141-1/+28
| | | | | | | | | | | | | Introduce a new "export_as" directive for top-level modules, which indicates that the current module is a "private" module whose symbols will eventually be exported through the named "public" module. This is in support of a common pattern in the Darwin ecosystem where a single public framework is constructed of several private frameworks, with (currently) header duplication and some support from the linker. Addresses rdar://problem/34438420. llvm-svn: 313316
* [NFC] [Analyzer] Fix RST markup in documentation.George Karpenkov2017-09-141-9/+9
| | | | llvm-svn: 313219
* [docs] Update LeakSanitizer documentation to reflect OS X supportFrancis Ricci2017-09-132-3/+4
| | | | | | | | | | Reviewers: kcc, alekseyshl, kubamracek, glider Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37811 llvm-svn: 313179
* [ubsan] Enable -fsanitize=function on DarwinVedant Kumar2017-09-131-1/+2
| | | | | | https://reviews.llvm.org/D37598 llvm-svn: 313099
* Fix broken links to the Itanium CXX ABIVlad Tsyrklevich2017-09-122-4/+4
| | | | llvm-svn: 312986
* [ubsan-minimal] Document the new runtimeVedant Kumar2017-09-112-1/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D37647 llvm-svn: 312957
* Add objcImplementationDecl matcherDave Lee2017-09-101-0/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Add the `objcImplementationDecl` matcher. See related: D30854 Tested with: ``` ./tools/clang/unittests/ASTMatchers/ASTMatchersTests ``` Reviewers: aaron.ballman, compnerd, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37643 llvm-svn: 312889
* COFF: Implement ThinLTO cache and cache pruning support.Peter Collingbourne2017-09-081-6/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D37607 llvm-svn: 312770
* [Sema] -Wtautological-compare: handle comparison of unsigned with 0S.Roman Lebedev2017-09-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a first half(?) of a fix for the following bug: https://bugs.llvm.org/show_bug.cgi?id=34147 (gcc -Wtype-limits) GCC's -Wtype-limits does warn on comparison of unsigned value with signed zero (as in, with 0), but clang only warns if the zero is unsigned (i.e. 0U). Also, be careful not to double-warn, or falsely warn on comparison of signed/fp variable and signed 0. Yes, all these testcases are needed. Testing: $ ninja check-clang-sema check-clang-semacxx Also, no new warnings for clang stage-2 build. Reviewers: rjmccall, rsmith, aaron.ballman Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37565 llvm-svn: 312750
* [clang-format] Fix documentation for AllowAllParametersOfDeclarationOnNextLineDaniel Jasper2017-09-071-5/+12
| | | | | | | | | | | | The current description of AllowAllParametersOfDeclarationOnNextLine in the Clang-Format Style Options guide suggests that it is possible to format function declaration, which fits in a single line (what is not supported in current clang-format version). Also the example was not reproducible and mades no sense. Patch by Lucja Mazur, thank you! llvm-svn: 312721
* Add an usage example of BreakBeforeBracesSylvestre Ledru2017-09-071-0/+9
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37531 llvm-svn: 312717
* Refresh the clang format options doc with the recent changesSylvestre Ledru2017-09-071-13/+41
| | | | | | | | | | | | | | | | Summary: Looks like we are out of sync between the doc and the code. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37558 llvm-svn: 312716
* add the option IndentPPDirectives to the release notes. Landed in r312125Sylvestre Ledru2017-09-051-2/+15
| | | | llvm-svn: 312535
* docs: don't say that data flow tracing interface is unstableDmitry Vyukov2017-08-311-2/+0
| | | | | | | | | We are starting to use data flow tracing in kernel. The interface is not subject to change anymore. Reviewed in https://reviews.llvm.org/D37303 llvm-svn: 312232
* [modules] Add ability to specify module name to module file mapping (reapply)Boris Kolpackov2017-08-311-3/+8
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
* docs: typo fixHans Wennborg2017-08-301-4/+3
| | | | llvm-svn: 312149
* clang-format: Add preprocessor directive indentationKrasimir Georgiev2017-08-301-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an implementation for [bug 17362](https://bugs.llvm.org/attachment.cgi?bugid=17362) which adds support for indenting preprocessor statements inside if/ifdef/endif. This takes previous work from fmauch (https://github.com/fmauch/clang/tree/preprocessor_indent) and makes it into a full feature. The context of this patch is that I'm a VMware intern, and I implemented this because VMware needs the feature. As such, some decisions were made based on what VMware wants, and I would appreciate suggestions on expanding this if necessary to use-cases other people may want. This adds a new enum config option, `IndentPPDirectives`. Values are: * `PPDIS_None` (in config: `None`): ``` #if FOO #if BAR #include <foo> #endif #endif ``` * `PPDIS_AfterHash` (in config: `AfterHash`): ``` #if FOO # if BAR # include <foo> # endif #endif ``` This is meant to work whether spaces or tabs are used for indentation. Preprocessor indentation is independent of indentation for non-preprocessor lines. Preprocessor indentation also attempts to ignore include guards with the checks: 1. Include guards cover the entire file 2. Include guards don't have `#else` 3. Include guards begin with ``` #ifndef <var> #define <var> ``` This patch allows `UnwrappedLineParser::PPBranchLevel` to be decremented to -1 (the initial value is -1) so the variable can be used for indent tracking. Defects: * This patch does not handle the case where there's code between the `#ifndef` and `#define` but all other conditions hold. This is because when the #define line is parsed, `UnwrappedLineParser::Lines` doesn't hold the previous code line yet, so we can't detect it. This is out of the scope of this patch. * This patch does not handle cases where legitimate lines may be outside an include guard. Examples are `#pragma once` and `#pragma GCC diagnostic`, or anything else that does not change the meaning of the file if it's included multiple times. * This does not detect when there is a single non-preprocessor line in front of an include-guard-like structure where other conditions hold because `ScopedLineState` hides the line. * Preprocessor indentation throws off `TokenAnnotator::setCommentLineLevels` so the indentation of comments immediately before indented preprocessor lines is toggled on each run. Fixing this issue appears to be a major change and too much complexity for this patch. Contributed by @euhlmann! Reviewers: djasper, klimek, krasimir Reviewed By: djasper, krasimir Subscribers: krasimir, mzeren-vmw, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D35955 llvm-svn: 312125
* Revert r312105 [modules] Add ability to specify module name to module file ↵Victor Leschuk2017-08-301-8/+3
| | | | | | | | mapping Looks like it breaks win10 builder. llvm-svn: 312112
* [docs] Regenerate command line options referenceBoris Kolpackov2017-08-301-4/+53
| | | | llvm-svn: 312106
* [modules] Add ability to specify module name to module file mappingBoris Kolpackov2017-08-301-3/+8
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312105
* Fix two typos in the doc. Patch by kamleshbhalui on githubSylvestre Ledru2017-08-271-2/+2
| | | | llvm-svn: 311854
* [sanitizer-coverage] extend fsanitize-coverage=pc-table with flags for every PCKostya Serebryany2017-08-251-7/+9
| | | | llvm-svn: 311794
* [ObjC] Add a -Wobjc-messaging-id warningAlex Lorenz2017-08-251-0/+6
| | | | | | | | | | | | -Wobjc-messaging-id is a new, non-default warning that warns about message sends to unqualified id in Objective-C. This warning is useful for projects that would like to avoid any potential future compiler errors/warnings, as the system frameworks might add a method with the same selector which could make the message send to id ambiguous. rdar://33303354 llvm-svn: 311779
* [sanitizer-coverage] document -fsanitize-coverage=pc-table and ↵Kostya Serebryany2017-08-241-1/+45
| | | | | | -fsanitize-coverage=inline-8bit-counters llvm-svn: 311719
* clang-format: add an option -verbose to list the files being processedSylvestre Ledru2017-08-122-0/+4
| | | | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D34824 llvm-svn: 310778
* [Bash-autocompletion] Add --autocomplete flag to 5.0 release notesYuka Takahashi2017-08-111-1/+1
| | | | | | | | | | | | | | Summary: I thought we should add this information to release notes, because we added a new flag to clang driver. Reviewers: v.g.vassilev, teemperor, ruiu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36567 llvm-svn: 310700
* [sanitizer-coverage] Change cmp instrumentation to distinguish const operandsAlexander Potapenko2017-08-101-1/+8
| | | | | | | | | | | | | | | | | | | | | This implementation of SanitizerCoverage instrumentation inserts different callbacks depending on constantness of operands: 1. If both operands are non-const, then a usual __sanitizer_cov_trace_cmp[1248] call is inserted. 2. If exactly one operand is const, then a __sanitizer_cov_trace_const_cmp[1248] call is inserted. The first argument of the call is always the constant one. 3. If both operands are const, then no callback is inserted. This separation comes useful in fuzzing when tasks like "find one operand of the comparison in input arguments and replace it with the other one" have to be done. The new instrumentation allows us to not waste time on searching the constant operands in the input. Patch by Victor Chibotaru. llvm-svn: 310600
* [Availability] Don't make an availability attribute imply default visibility ↵Erik Pilkington2017-08-081-0/+3
| | | | | | | | | | on macOS Fixes PR33796, rdar://33655115 Differential revision: https://reviews.llvm.org/D36191 llvm-svn: 310382
OpenPOWER on IntegriCloud