summaryrefslogtreecommitdiffstats
path: root/clang/docs
Commit message (Collapse)AuthorAgeFilesLines
...
* [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.Yitzhak Mandelbaum2019-02-081-32/+79
| | | | | | | | | | | | | | | | Specifically: * fixes the comments on `hasObjectExpression`, * clarifies comments on `thisPointerType` and `on`, * adds comments to `onImplicitObjectArgument`. It also updates associated reference docs (using the doc tool). Reviewers: alexfh, steveire, aaron.ballman Differential Revision: https://reviews.llvm.org/D56849 llvm-svn: 353532
* [DOCS]Support for emission of the debug info for the Cuda devices, NFC.Alexey Bataev2019-02-052-3/+7
| | | | llvm-svn: 353214
* Fix the sphinx buildbot after D54429Kristof Umann2019-02-051-1/+1
| | | | llvm-svn: 353150
* [analyzer] Creating standard Sphinx documentationKristof Umann2019-02-0519-244/+2653
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lack of documentation has been a long standing issue in the Static Analyzer, and one of the leading reasons behind this was a lack of good documentation infrastucture. This lead serious drawbacks, such as * Not having proper release notes for years * Not being able to have a sensible auto-generated checker documentations (which lead to most of them not having any) * The HTML website that has to updated manually is a chore, and has been outdated for a long while * Many design discussions are now hidden in phabricator revisions This patch implements a new documentation infrastucture using Sphinx, like most of the other subprojects in LLVM. It transformed some pages as a proof-of- concept, with many others to follow in later patches. The eventual goal is to preserve the original website's (https://clang-analyzer.llvm.org/) frontpage, but move everything else to the new format. Some other ideas, like creating a unipage for each checker (similar to how clang-tidy works now), are also being discussed. Patch by Dániel Krupp! Differential Revision: https://reviews.llvm.org/D54429 llvm-svn: 353126
* Update SanitizerCoverage doc regarding the issue with pc-table and gc-sections.Max Moroz2019-02-011-0/+5
| | | | | | | | | | | | | | | | | | | Summary: There is a bug for this: https://bugs.llvm.org/show_bug.cgi?id=34636 But it would be also helpful to leave a note in the docs to prevent users from running into issues, e.g. https://crbug.com/926588. Reviewers: morehouse Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits, kcc Tags: #clang Differential Revision: https://reviews.llvm.org/D57474 llvm-svn: 352890
* Fix some sphinx doc errors.James Y Knight2019-02-011-2/+2
| | | | llvm-svn: 352887
* [sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions ↵Kostya Serebryany2019-01-311-0/+3
| | | | | | that feed into the backedge branch. Instrumenting these CMP instructions is almost always useless (and harmful) for fuzzing llvm-svn: 352818
* Add a new builtin: __builtin_dynamic_object_sizeErik Pilkington2019-01-301-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | This builtin has the same UI as __builtin_object_size, but has the potential to be evaluated dynamically. It is meant to be used as a drop-in replacement for libraries that use __builtin_object_size when a dynamic checking mode is enabled. For instance, __builtin_object_size fails to provide any extra checking in the following function: void f(size_t alloc) { char* p = malloc(alloc); strcpy(p, "foobar"); // expands to __builtin___strcpy_chk(p, "foobar", __builtin_object_size(p, 0)) } This is an overflow if alloc < 7, but because LLVM can't fold the object size intrinsic statically, it folds __builtin_object_size to -1. With __builtin_dynamic_object_size, alloc is passed through to __builtin___strcpy_chk. rdar://32212419 Differential revision: https://reviews.llvm.org/D56760 llvm-svn: 352665
* Adjust documentation for git migration.James Y Knight2019-01-297-57/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes most references to the paths: llvm.org/svn/ llvm.org/git/ llvm.org/viewvc/ github.com/llvm-mirror/ github.com/llvm-project/ reviews.llvm.org/diffusion/ to instead point to https://github.com/llvm/llvm-project. This is *not* a trivial substitution, because additionally, all the checkout instructions had to be migrated to instruct users on how to use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of checking out various projects into various subdirectories. I've attempted to not change any scripts here, only documentation. The scripts will have to be addressed separately. Additionally, I've deleted one document which appeared to be outdated and unneeded: lldb/docs/building-with-debug-llvm.txt Differential Revision: https://reviews.llvm.org/D57330 llvm-svn: 352514
* Fix incorrect indent from r352221Erich Keane2019-01-251-2/+2
| | | | | Change-Id: I0a7b1443eb6912ef7bea1a4cf2f696fc01726557 llvm-svn: 352222
* Disable _Float16 for non ARM/SPIR TargetsErich Keane2019-01-251-38/+52
| | | | | | | | | | | | | | As Discussed here: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129543.html There are problems exposing the _Float16 type on architectures that haven't defined the ABI/ISel for the type yet, so we're temporarily disabling the type and making it opt-in. Differential Revision: https://reviews.llvm.org/D57188 Change-Id: I5db7366dedf1deb9485adb8948b1deb7e612a736 llvm-svn: 352221
* [Sema] Fix Modified Type in address_space AttributedTypeLeonard Chan2019-01-241-1/+5
| | | | | | | | | | | This is a fix for https://reviews.llvm.org/D51229 where we pass the address_space qualified type as the modified type of an AttributedType. This change now instead wraps the AttributedType with either the address_space qualifier or a DependentAddressSpaceType. Differential Revision: https://reviews.llvm.org/D55447 llvm-svn: 351997
* [Documentation] Fix problem in docs/SafeStack.rst introduced in r351976.Eugene Zelenko2019-01-231-3/+3
| | | | llvm-svn: 351977
* [Documentation] Use HTTPS whenever possibleEugene Zelenko2019-01-2319-60/+60
| | | | | | Differential revision: https://reviews.llvm.org/D56946 llvm-svn: 351976
* ReleaseNotes: remove openmp notes from r351580Hans Wennborg2019-01-221-30/+1
| | | | | | They were for the 8.0 branch, and have been committed there in r351839. llvm-svn: 351841
* [OPENMP][DOCS] Release notes/OpenMP support updates, NFC.Kelvin Li2019-01-182-44/+63
| | | | | | Differential Revision: https://reviews.llvm.org/D56733 llvm-svn: 351580
* Bump the trunk version to 9.0.0svnHans Wennborg2019-01-162-200/+15
| | | | llvm-svn: 351320
* UsersManual.rst: Update the clang-cl flags sectionHans Wennborg2019-01-161-7/+37
| | | | llvm-svn: 351312
* [clang][UBSan] Sanitization for alignment assumptions.Roman Lebedev2019-01-152-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: UB isn't nice. It's cool and powerful, but not nice. Having a way to detect it is nice though. [[ https://wg21.link/p1007r3 | P1007R3: std::assume_aligned ]] / http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r2.pdf says: ``` We propose to add this functionality via a library function instead of a core language attribute. ... If the pointer passed in is not aligned to at least N bytes, calling assume_aligned results in undefined behaviour. ``` This differential teaches clang to sanitize all the various variants of this assume-aligned attribute. Requires D54588 for LLVM IRBuilder changes. The compiler-rt part is D54590. This is a second commit, the original one was r351105, which was mass-reverted in r351159 because 2 compiler-rt tests were failing. Reviewers: ABataev, craig.topper, vsk, rsmith, rnk, #sanitizers, erichkeane, filcab, rjmccall Reviewed By: rjmccall Subscribers: chandlerc, ldionne, EricWF, mclow.lists, cfe-commits, bkramer Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54589 llvm-svn: 351177
* Revert alignment assumptions changesVlad Tsyrklevich2019-01-152-44/+1
| | | | | | | Revert r351104-6, r351109, r351110, r351119, r351134, and r351153. These changes fail on the sanitizer bots. llvm-svn: 351159
* [clang][UBSan] Sanitization for alignment assumptions.Roman Lebedev2019-01-142-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: UB isn't nice. It's cool and powerful, but not nice. Having a way to detect it is nice though. [[ https://wg21.link/p1007r3 | P1007R3: std::assume_aligned ]] / http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r2.pdf says: ``` We propose to add this functionality via a library function instead of a core language attribute. ... If the pointer passed in is not aligned to at least N bytes, calling assume_aligned results in undefined behaviour. ``` This differential teaches clang to sanitize all the various variants of this assume-aligned attribute. Requires D54588 for LLVM IRBuilder changes. The compiler-rt part is D54590. Reviewers: ABataev, craig.topper, vsk, rsmith, rnk, #sanitizers, erichkeane, filcab, rjmccall Reviewed By: rjmccall Subscribers: chandlerc, ldionne, EricWF, mclow.lists, cfe-commits, bkramer Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54589 llvm-svn: 351105
* fixup: sphinx warningNick Desaulniers2019-01-101-1/+1
| | | | | | | | | | Fixes the sphinx warning: tools/clang/docs/DiagnosticsReference.rst:7889: WARNING: Title underline too short. That I just introduced in r350877. llvm-svn: 350878
* [SemaCXX] add -Woverride-init alias to -Winitializer-overridesNick Desaulniers2019-01-101-0/+4
| | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=40251 https://github.com/ClangBuiltLinux/linux/issues/307 Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, nathanchance, srhines Differential Revision: https://reviews.llvm.org/D56522 llvm-svn: 350877
* [OpenMP] Add flag for preventing the extension to 64 bits for the collapse ↵Gheorghe-Teodor Bercea2019-01-091-0/+10
| | | | | | | | | | | | | | | | loop counter Summary: Introduce a compiler flag for cases when the user knows that the collapsed loop counter can be safely represented using at most 32 bits. This will prevent the emission of expensive mathematical operations (such as the div operation) on the iteration variable using 64 bits where 32 bit operations are sufficient. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: hfinkel, kkwli0, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D55928 llvm-svn: 350758
* [OPENMP][DOCS]Release notes/OpenMP support updates, NFC.Alexey Bataev2019-01-092-4/+19
| | | | llvm-svn: 350757
* __has_feature(pragma_clang_attribute_namespaces) should be __has_extensionErik Pilkington2019-01-081-1/+1
| | | | | | Thanks to Richard Smith for pointing this out. llvm-svn: 350642
* Add a __has_feature check for namespaces on #pragma clang attribute.Erik Pilkington2019-01-071-1/+3
| | | | | | Support for this was added in r349845. llvm-svn: 350572
* [clang] Add AST matcher for initializer list membersHyrum Wright2019-01-071-1/+10
| | | | | | | | | | | | | Summary: Much like hasArg for various call expressions, this allows LibTooling users to match against a member of an initializer list. This is currently being used as part of the abseil-duration-scale clang-tidy check. Differential Revision: https://reviews.llvm.org/D56090 llvm-svn: 350523
* [ObjCARC] Add an new attribute, objc_externally_retainedErik Pilkington2019-01-041-14/+73
| | | | | | | | | | | | | | | | | | | | This attribute, called "objc_externally_retained", exposes clang's notion of pseudo-__strong variables in ARC. Pseudo-strong variables "borrow" their initializer, meaning that they don't retain/release it, instead assuming that someone else is keeping their value alive. If a function is annotated with this attribute, implicitly strong parameters of that function aren't implicitly retained/released in the function body, and are implicitly const. This is useful to expose for performance reasons, most functions don't need the extra safety of the retain/release, so programmers can opt out as needed. This attribute can also apply to declarations of local variables, with similar effect. Differential revision: https://reviews.llvm.org/D55865 llvm-svn: 350422
* Fix some typos in the clang doc.Sylvestre Ledru2019-01-014-6/+6
| | | | | | | Fixed with: $ codespell -w ClangFormatStyleOptions.rst Toolchain.rst LanguageExtensions.rst ClangCommandLineReference.rst llvm-svn: 350192
* clang-format-diff: add an example with hgSylvestre Ledru2019-01-011-0/+6
| | | | llvm-svn: 350191
* Add support for namespaces on #pragma clang attributeErik Pilkington2018-12-201-0/+30
| | | | | | | | | | | | | | | | Namespaces are introduced by adding an "identifier." before a push/pop directive. Pop directives with namespaces can only pop a attribute group that was pushed with the same namespace. Push and pop directives that don't opt into namespaces have the same semantics. This is necessary to prevent a pitfall of using multiple #pragma clang attribute directives spread out in a large file, particularly when macros are involved. It isn't easy to see which pop corripsonds to which push, so its easy to inadvertently pop the wrong group. Differential revision: https://reviews.llvm.org/D55628 llvm-svn: 349845
* Portable Python script across Python versionSerge Guelton2018-12-192-3/+5
| | | | | | | | | urllib2 as been renamed into urllib and the library layout has changed. Workaround that in a consistent manner. Differential Revision: https://reviews.llvm.org/D55199 llvm-svn: 349627
* Portable Python script across Python versionSerge Guelton2018-12-181-1/+1
| | | | | | | | Make scripts more future-proof by importing most __future__ stuff. Differential Revision: https://reviews.llvm.org/D55208 llvm-svn: 349504
* Portable Python script across Python versionSerge Guelton2018-12-182-8/+9
| | | | | | | | Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version. Differential Revision: https://reviews.llvm.org/D55213 llvm-svn: 349454
* Portable Python script across Python versionSerge Guelton2018-12-181-2/+2
| | | | | | | dict no longer have the `has_key` method in Python3. Instead, one can use the `in` keyword which already works in Python2. llvm-svn: 349447
* [ASTImporter] Fix redecl chain of classes and class templatesGabor Marton2018-12-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The crux of the issue that is being fixed is that lookup could not find previous decls of a friend class. The solution involves making the friend declarations visible in their decl context (i.e. adding them to the lookup table). Also, we simplify `VisitRecordDecl` greatly. This fix involves two other repairs (without these the unittests fail): (1) We could not handle the addition of injected class types properly when a redecl chain was involved, now this is fixed. (2) DeclContext::removeDecl failed if the lookup table in Vector form did not contain the to be removed element. This caused troubles in ASTImporter::ImportDeclContext. This is also fixed. Reviewers: a_sidorin, balazske, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53655 llvm-svn: 349349
* [analyzer] Fix some expressions staying live too long. Add a debug checker.Artem Dergachev2018-12-161-1/+4
| | | | | | | | | | | | | | | | | | | | | StaticAnalyzer uses the CFG-based RelaxedLiveVariables analysis in order to, in particular, figure out values of which expressions are still needed. When the expression becomes "dead", it is garbage-collected during the dead binding scan. Expressions that constitute branches/bodies of control flow statements, eg. `E1' in `if (C1) E1;' but not `E2' in `if (C2) { E2; }', were kept alive for too long. This caused false positives in MoveChecker because it relies on cleaning up loop-local variables when they go out of scope, but some of those live-for-too-long expressions were keeping a reference to those variables. Fix liveness analysis to correctly mark these expressions as dead. Add a debug checker, debug.DumpLiveStmts, in order to test expressions liveness. Differential Revision: https://reviews.llvm.org/D55566 llvm-svn: 349320
* Implement -frecord-command-line (-frecord-gcc-switches)Scott Linder2018-12-141-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Implement options in clang to enable recording the driver command-line in an ELF section. Implement a new special named metadata, llvm.commandline, to support frontends embedding their command-line options in IR/ASM/ELF. This differs from the GCC implementation in some key ways: * In GCC there is only one command-line possible per compilation-unit, in LLVM it mirrors llvm.ident and multiple are allowed. * In GCC individual options are separated by NULL bytes, in LLVM entire command-lines are separated by NULL bytes. The advantage of the GCC approach is to clearly delineate options in the face of embedded spaces. The advantage of the LLVM approach is to support merging multiple command-lines unambiguously, while handling embedded spaces with escaping. Differential Revision: https://reviews.llvm.org/D54487 Clang Differential Revision: https://reviews.llvm.org/D54489 llvm-svn: 349155
* [clang] Add AST matcher for block expressions 🔍Stephane Moore2018-12-131-0/+8
| | | | | | | | | | | | | | | | | | Summary: This change adds a new AST matcher for block expressions. Test Notes: Ran the clang unit tests. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55546 llvm-svn: 349004
* [AST] Store "UsesADL" information in CallExpr.Eric Fiselier2018-12-121-0/+22
| | | | | | | | | | | | | | | | | | | | | Summary: Currently the Clang AST doesn't store information about how the callee of a CallExpr was found. Specifically if it was found using ADL. However, this information is invaluable to tooling. Consider a tool which renames usages of a function. If the originally CallExpr was formed using ADL, then the tooling may need to additionally qualify the replacement. Without information about how the callee was found, the tooling is left scratching it's head. Additionally, we want to be able to match ADL calls as quickly as possible, which means avoiding computing the answer on the fly. This patch changes `CallExpr` to store whether it's callee was found using ADL. It does not change the size of any AST nodes. Reviewers: fowles, rsmith, klimek, shafik Reviewed By: rsmith Subscribers: aaron.ballman, riccibruno, calabrese, titus, cfe-commits Differential Revision: https://reviews.llvm.org/D55534 llvm-svn: 348977
* Stop stripping comments from AST matcher example code.Aaron Ballman2018-12-112-72/+71
| | | | | | The AST matcher documentation dumping script was being a bit over-zealous about stripping comment markers, which ended up causing comments in example code to stop being comments. Fix that by only stripping comments at the start of a line, rather than removing any forward slash (which also impacts prose text). llvm-svn: 348891
* [ASan] Minor documentation fix: clarify static linking limitation.Max Moroz2018-12-111-1/+1
| | | | | | | | | | | | | | | | Summary: ASan does not support statically linked binaries, but ASan runtime itself can be statically linked into a target binary executable. Reviewers: eugenis, kcc Reviewed By: eugenis Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55066 llvm-svn: 348863
* Fix title underlines being too short after r348429Pete Cooper2018-12-061-1/+1
| | | | llvm-svn: 348431
* Update ARC docs as objc_storeStrong returns void not idPete Cooper2018-12-051-1/+1
| | | | llvm-svn: 348429
* Mention changes to libc++ include dir lookup in release notes.Ilya Biryukov2018-12-051-0/+7
| | | | | | | | | | | | | | Summary: The change itself landed as r348365, see the comment for more details. Reviewers: arphaman, EricWF Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55322 llvm-svn: 348394
* [asan] Add clang flag -fsanitize-address-use-odr-indicatorVitaly Buka2018-12-052-0/+6
| | | | | | | | | | Reviewers: eugenis, m.ostapenko, ygribov Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D55157 llvm-svn: 348327
* Remove reference to recently removed PTH Documentation.Erich Keane2018-12-041-1/+0
| | | | | | | Removed in r348266 Change-Id: Icff0212f57c42ca84ec174ddd4366ae63a7923fa llvm-svn: 348268
* PTH-- Remove feature entirely-Erich Keane2018-12-043-169/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging a boost build with a modified version of Clang, I discovered that the PTH implementation stores TokenKind in 8 bits. However, we currently have 368 TokenKinds. The result is that the value gets truncated and the wrong token gets picked up when including PTH files. It seems that this will go wrong every time someone uses a token that uses the 9th bit. Upon asking on IRC, it was brought up that this was a highly experimental features that was considered a failure. I discovered via googling that BoostBuild (mostly Boost.Math) is the only user of this feature, using the CC1 flag directly. I believe that this can be transferred over to normal PCH with minimal effort: https://github.com/boostorg/build/issues/367 Based on advice on IRC and research showing that this is a nearly completely unused feature, this patch removes it entirely. Note: I considered leaving the build-flags in place and making them emit an error/warning, however since I've basically identified and warned the only user, it seemed better to just remove them. Differential Revision: https://reviews.llvm.org/D54547 Change-Id: If32744275ef1f585357bd6c1c813d96973c4d8d9 llvm-svn: 348266
* Portable Python script across versionSerge Guelton2018-12-031-6/+6
| | | | | | | | | Have all classes derive from object: that's implicitly the default in Python3, it needs to be done explicilty in Python2. Differential Revision: https://reviews.llvm.org/D55121 llvm-svn: 348127
OpenPOWER on IntegriCloud