summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed c-index testDávid Bolvanský2019-11-091-1/+1
|
* Fixed more -Wreturn-type testsDávid Bolvanský2019-11-094-4/+4
|
* [Diagnostics] Try to improve warning message for -Wreturn-typeDávid Bolvanský2019-11-0920-75/+76
| | | | | | | | | | | | | | Summary: I agree with https://easyaspi314.github.io/gcc-vs-clang.html?fbclid=IwAR1VA0qxiWVUusOQUv5z7JESS7ZpeJy-UqAI5mnJscofGLqXcqeErIUB2gU, current warning message is not very good. We should try to improve it.. Reviewers: rsmith, aaron.ballman, easyaspi314 Reviewed By: aaron.ballman Subscribers: arphaman, Quuxplusone, mehdi_amini, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69762
* Revert "[BPF] Add preserve_access_index attribute for record definition"Yonghong Song2019-11-0914-448/+8
| | | | | | This reverts commit 4a5aa1a7bf8b1714b817ede8e09cd28c0784228a. There are some other test failures. Investigate them first.
* [BPF] Add preserve_access_index attribute for record definitionYonghong Song2019-11-0914-8/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduced a new bpf specific attribute which can be added to struct or union definition. For example, struct s { ... } __attribute__((preserve_access_index)); union u { ... } __attribute__((preserve_access_index)); The goal is to simplify user codes for cases where preserve access index happens for certain struct/union, so user does not need to use clang __builtin_preserve_access_index for every members. The attribute has no effect if -g is not specified. When the attribute is specified and -g is specified, any member access defined by that structure or union, including array subscript access and inner records, will be preserved through __builtin_preserve_{array,struct,union}_access_index() IR intrinsics, which will enable relocation generation in bpf backend. The following is an example to illustrate the usage: -bash-4.4$ cat t.c #define __reloc__ __attribute__((preserve_access_index)) struct s1 { int c; } __reloc__; struct s2 { union { struct s1 b[3]; }; } __reloc__; struct s3 { struct s2 a; } __reloc__; int test(struct s3 *arg) { return arg->a.b[2].c; } -bash-4.4$ clang -target bpf -g -S -O2 t.c A relocation with access string "0:0:0:0:2:0" will be generated representing access offset of arg->a.b[2].c. forward declaration with attribute is also handled properly such that the attribute is copied and populated in real record definition. Differential Revision: https://reviews.llvm.org/D69759
* [Parser] Warn when ScopeDepthOrObjCQuals overflowsMark de Wever2019-11-096-1/+140
| | | | | | | | | Before when the overflow occured an assertion was triggered. Now check whether the maximum has been reached and warn properly. This patch fixes the original submission of PR19607. Differential Revision: https://reviews.llvm.org/D63975
* [NFC] Supress GCC "Bitfield too small to hold all values of enum" warning.Richard Smith2019-11-092-9/+15
| | | | | | Patch by Wang Tianqing! Differential Revision: https://reviews.llvm.org/D69792
* [cxx_status] Update with Belfast motions.Richard Smith2019-11-091-11/+40
|
* [Diagnostics] Fixed crash with non pointer type (PR43950)Dávid Bolvanský2019-11-091-1/+2
|
* [analyzer] Fix skipping the call during inlined defensive check suppression.Artem Dergachev2019-11-082-11/+25
| | | | | | | | | | | | | | | | | | | | | When bugreporter::trackExpressionValue() is invoked on a DeclRefExpr, it tries to do most of its computations over the node in which this DeclRefExpr is computed, rather than on the error node (or whatever node is stuffed into it). One reason why we can't simply use the error node is that the binding to that variable might have already disappeared from the state by the time the bug is found. In case of the inlined defensive checks visitor, the DeclRefExpr node is in fact sometimes too *early*: the call in which the inlined defensive check has happened might have not been entered yet. Change the visitor to be fine with tracking dead symbols (which it is totally capable of - the collapse point for the symbol is still well-defined), and fire it up directly on the error node. Keep using "LVState" to find out which value should we be tracking, so that there weren't any problems with accidentally loading an ill-formed value from a dead variable. Differential Revision: https://reviews.llvm.org/D67932
* [analyzer] Nullability: Don't infer nullable when passing as nullable parameter.Artem Dergachev2019-11-082-5/+12
| | | | You can't really infer anything from that.
* [clang][IFS][test] Fixing buildbot test fails for clang-ifs.Puyan Lotfi2019-11-088-16/+16
| | | | | Checking for the exact triple fails on many bots. Leaving the triple check blank.
* [clang][IFS] Adds support for more decl types in clang interface stubs.Puyan Lotfi2019-11-0811-6/+157
| | | | | | | | | | | | | Adding support for processing the following Decls: NonTypeTemplateParmDecl, CXXConversionDecl, UnresolvedUsingValueDecl, UsingDecl, UsingShadowDecl, TypeAliasTemplateDecl, TypeAliasDecl, VarTemplateDecl, VarTemplateSpecializationDecl, UsingDirectiveDecl, TemplateTemplateParmDecl, ClassTemplatePartialSpecializationDecl, IndirectFieldDecl. Also, this allows for processing NamedDecls that don't have an identifier and skips over VarDecls that are dependent on template types. Differential Revision: https://reviews.llvm.org/D69995
* Debug Info: Nest Objective-C property function decls inside their container.Adrian Prantl2019-11-083-25/+82
| | | | | | | | | | | | | | | | | | This has the nice side-effect of also fixing a crash in Clang. Starting with DWARF 5 we are emitting ObjC method declarations as children of their containing entity. This worked for interfaces, but didn't consider the case of synthessized properties. When a property of a protocol is synthesized in an interface implementation the ObjCMethodDecl that was passed to CGF::StartFunction was the property *declaration* which obviously couldn't have a containing interface. This patch passes the containing interface all the way through to CGDebugInfo, so the function declaration can be created with the correct parent (= the class implementing the protocol). rdar://problem/53782400 Differential Revision: https://reviews.llvm.org/D66121
* [www] More HTTPS and outdated link fixes.Stephan T. Lavavej2019-11-082-3/+3
| | | | Resolves D69981.
* clang-format: refresh the list of optionsSylvestre Ledru2019-11-081-45/+52
|
* Revert "Reland "[clang] Report sanitizer blacklist as a dependency in cc1""Jan Korous2019-11-086-21/+62
| | | | This reverts commit cae4a28864f4e8a55920e2b94e2cd43617902dec.
* clang-format: Add to the release notes the new --dry-run/-n optionSylvestre Ledru2019-11-081-0/+3
|
* Revert "Reapply "Fix crash on switch conditions of non-integer types in ↵Melanie Blower2019-11-087-29/+7
| | | | | | | templates"" This reverts commit 759948467ea3181615d44d80f74ffeb260180fd0. There were build bot failures in clang-tidy
* Basic: fix FileManager invalidation issue for file redirectAlex Suhan2019-11-081-7/+11
| | | | | Insertion into SeenFileEntries can invalidate iterators, we need to do another lookup on the re-intern path.
* [clang] Fix -fsanitize-system-blacklist processing in cc1Jan Korous2019-11-081-0/+5
|
* Reland "[clang] Report sanitizer blacklist as a dependency in cc1"Jan Korous2019-11-086-62/+21
| | | | This reverts commit 3182027282c59c51d5080d83365917fccd695854.
* Reland "[clang] Report sanitizer blacklist as a dependency in cc1"Jan Korous2019-11-086-21/+62
| | | | This reverts commit 9b8413ac6e56e7a6e0ba884773d13bcf9414bd43.
* [clang-format] NFC allow Format.h to be clang-formatted but still maintain ↵paul_hoad2019-11-082-7/+14
| | | | | | | | | | | | | | | | | | | | | the same doc layout in ClangFormatStyleOptions.rst Summary: Format.h is used to generate ClangFormatStyleOptions.rst, the layout of the comments is critical to the rst file. Accidentally clang-formatting Format.h can lead to the .rst changing. This revision simply add // clang-format off/on statement around the areas who formatting needs to be maintained, mainly around the options that are related to what happens when the line breaks due to `ColumnLimit` (which is what is happening to the comment) This allows Format.h to be clang-formatted without causing a change in the documentation when dump_format_style.py is rerun, which is also part of the revision. Reviewers: mitchell-stellar, klimek, sammccall, owenpan Reviewed By: mitchell-stellar Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D69951
* [clang] Add VFS support for sanitizers' blacklistsJan Korous2019-11-085-6/+64
| | | | Differential Revision: https://reviews.llvm.org/D69648
* Reapply "Fix crash on switch conditions of non-integer types in templates"Melanie Blower2019-11-087-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reapplies commit 76945821b9cad3. The first version broke buildbots due to clang-tidy test fails. The fails are because some errors in templates are now diagnosed earlier (does not wait till instantiation). I have modified the tests to add checks for these diagnostics/prevent these diagnostics. There are no additional code changes. Summary of code changes: Clang currently crashes for switch statements inside a template when the condition is a non-integer field member because contextual implicit conversion is skipped when parsing the condition. This conversion is however later checked in an assert when the case statement is handled. The conversion is skipped when parsing the condition because the field member is set as type-dependent based on its containing class. This patch sets the type dependency based on the field's type instead. This patch fixes Bug 40982. Reviewers: rnk, gribozavr2 Patch by: Elizabeth Andrews (eandrews) Differential revision: https://reviews.llvm.org/D69950
* remove redundant LLVM version from version string when setting CLANG_VENDORNick Desaulniers2019-11-081-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When downstream LLVM distributions (like AOSP) set the CLANG_VENDOR cmake variable, the version string printed by the clang driver looks like: $ clang --version [CLANG_VENDOR] clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) (based on LLVM X.X.X) Rather than the more standard: $ clang --version clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) Based on feedback the the version string is a little long, the trailing "(based on LLVM X.X.X)" is redundant and makes less sense after moving LLVM to the monorepo. And it is only added should vendors set the cmake variable CLANG_VENDOR. Let's remove it. Reviewers: jyknight, eli.friedman, rsmith, rjmccall, efriedma Reviewed By: efriedma Subscribers: arphaman, efriedma, cfe-commits, srhines Tags: #clang Differential Revision: https://reviews.llvm.org/D69925
* Fix two typos in one test name, three days before its 10th birthday! (NFC)Adrian Prantl2019-11-081-0/+0
|
* Redeclare Objective-C property accessors inside the ObjCImplDecl in which ↵Adrian Prantl2019-11-0829-197/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are synthesized. This patch is motivated by (and factored out from) https://reviews.llvm.org/D66121 which is a debug info bugfix. Starting with DWARF 5 all Objective-C methods are nested inside their containing type, and that patch implements this for synthesized Objective-C properties. 1. SemaObjCProperty populates a list of synthesized accessors that may need to inserted into an ObjCImplDecl. 2. SemaDeclObjC::ActOnEnd inserts forward-declarations for all accessors for which no override was provided into their ObjCImplDecl. This patch does *not* synthesize AST function *bodies*. Moving that code from the static analyzer into Sema may be a good idea though. 3. Places that expect all methods to have bodies have been updated. I did not update the static analyzer's inliner for synthesized properties to point back to the property declaration (see test/Analysis/Inputs/expected-plists/nullability-notes.m.plist), which I believed to be more bug than a feature. Differential Revision: https://reviews.llvm.org/D68108 rdar://problem/53782400
* [clang-format] Ensure dump_format_style.py can generate ↵paul_hoad2019-11-082-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | ClangFormatStyleOptions.rst without manual intervention Summary: This revision is the last in a series of revisions to return `clang/doc/tools/dump_format_style.py` to be being able to parse Format.h without needing to manually merge the ClangFormatStyleOptions.rst file. The final modification to dump_format_style.py is needed following the addition of a nested enumeration inside a nested structure following the introduction of {D68296} Prior related revisions will allow for a fully clang-formatted `clang/include/clang/Format/Format.h` to once again be used at the source. {D69951} {D69433} {D69404} Reviewers: mitchell-stellar, klimek, sammccall, owenpan Reviewed By: mitchell-stellar Subscribers: cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D70003
* [clang-format] update comments in clang-format.py for python3 compatibilitypaulhoad2019-11-081-5/+17
| | | | | | | | | | | | | | | | | | | Summary: D23319 introduced python3 compatibility to clang-format.py, this is however not reflected by the documentation in the comments at the beginning of the file, which show how to use the script with python2 in .vimrc. While the actual mapping a user might want to use may well differ from my suggestion, I think it's nice to show the python2 and python3 version, such that a user can pick from the suggestions instead of googeling the python3 replacement for `:pyf` which they might not be familiar with. EDIT: picking reviewers according to https://llvm.org/docs/Phabricator.html#finding-potential-reviewers Reviewers: klimek, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: ilya-biryukov, cfe-commits, llvm-commits, ychen Patch By: pseyfert Tags: #clang-tools-extra, #llvm, #clang Differential Revision: https://reviews.llvm.org/D38446
* Revert "test commit"Abel Kocsis2019-11-081-1/+0
| | | | This reverts commit b0a03f29d9a2d316d6be99e6a4825114f240c0b2.
* Revert "test commit"Abel Kocsis2019-11-081-1/+0
| | | | This reverts commit 3ffce13f8c7ecb21c5729aa358f1f9fc008bbea2.
* Revert "Revert "Revert "[clang] Report sanitizer blacklist as a dependency ↵Abel Kocsis2019-11-086-62/+21
| | | | | | in cc1""" This reverts commit 3182027282c59c51d5080d83365917fccd695854.
* Revert "Revert "[clang] Report sanitizer blacklist as a dependency in cc1""Abel Kocsis2019-11-086-21/+62
| | | | This reverts commit 6b45e1bc11e91ea7b57a6ab1c19461a86dba33f8.
* test commitAbel Kocsis2019-11-081-0/+1
|
* test commitAbel Kocsis2019-11-081-0/+1
|
* Revert "[clang] Report sanitizer blacklist as a dependency in cc1"Jeremy Morse2019-11-086-62/+21
| | | | | | | | | | This reverts commit 03b84e4f6d0e1c04f22d69cc445f36e1f713beb4. This breaks dfsan tests with a linking failure, in for example this build: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24312 Reverting this patch locally makes those tests succeed.
* [Analyzer] Checker for Debugging Iterator CheckersAdam Balogh2019-11-083-2/+221
| | | | | | | | | For white-box testing correct container and iterator modelling it is essential to access the internal data structures stored for container and iterators. This patch introduces a simple debug checkers called debug.IteratorDebugging to achieve this. Differential Revision: https://reviews.llvm.org/D67156
* [PowerPC][Altivec] Fix offsets for vec_xl and vec_xstNemanja Ivanovic2019-11-072-20/+530
| | | | | | | | As we currently have it implemented in altivec.h, the offsets for these two intrinsics are element offsets. The documentation in the ABI (as well as the implementation in both XL and GCC) states that these should be byte offsets. Differential revision: https://reviews.llvm.org/D63636
* [PowerPC][Altivec] Emit correct builtin for single precision vec_all_neNemanja Ivanovic2019-11-072-1/+58
| | | | | | | We currently emit a double precision comparison instruction for this, whereas we need to emit the single precision version. Differential revision: https://reviews.llvm.org/D64024
* [creduce] Fixed a typo in the error message we're looking for.Artem Belevich2019-11-071-1/+1
|
* [analyzer] Add test cases for the unsupported C++ constructor modeling.Artem Dergachev2019-11-073-3/+242
| | | | | | | | | | | | | Namely, for the following items: - Handle constructors within new[]; - Handle constructors for default arguments. Update the open projects page with a link to the newly added tests and more hints for potential contributors. Patch by Daniel Krupp! Differential Revision: https://reviews.llvm.org/D69308
* [analyzer] PR41729: CStringChecker: Improve strlcat and strlcpy modeling.Artem Dergachev2019-11-072-138/+252
| | | | | | | | | | | - Fix false positive reports of strlcat. - The return value of strlcat and strlcpy is now correctly calculated. - The resulting string length of strlcat and strlcpy is now correctly calculated. Patch by Daniel Krupp! Differential Revision: https://reviews.llvm.org/D66049
* [SEH] Defer checking filter expression types until instantiatonReid Kleckner2019-11-074-13/+24
| | | | | | | | | | | While here, wordsmith the error a bit. Now clang says: error: filter expression has non-integral type 'Foo' Fixes PR43779 Reviewers: amccarth Differential Revision: https://reviews.llvm.org/D69969
* [clang] Report sanitizer blacklist as a dependency in cc1Jan Korous2019-11-076-21/+62
| | | | | | | | Previously these were reported from the driver which blocked clang-scan-deps from getting the full set of dependencies from cc1 commands. Also the default sanitizer blacklist that is added in driver was never reported as a dependency. I introduced -fsanitize-system-blacklist cc1 option to keep track of which blacklists were user-specified and which were added by driver and clang -MD now also reports system blacklists as dependencies. Differential Revision: https://reviews.llvm.org/D69290
* [Diagnostics] Teach -Wnull-dereference about address_space attributeDávid Bolvanský2019-11-072-14/+29
| | | | | | | | | | | | | | | | | | | | | | Summary: Clang should not warn for: > test.c:2:12: warning: indirection of non-volatile null pointer will be deleted, > not trap [-Wnull-dereference] > return *(int __attribute__((address_space(256))) *) 0; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Solves PR42292. Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69664
* [CodeGenModule] Group blocks runtime globals together, NFCVedant Kumar2019-11-071-4/+4
|
* [Sema] Fixes a crash with a templated destructorMark de Wever2019-11-072-4/+13
| | | | | | | | The issue was introduced by D33189 which fixed PR33189. Fixes PR38671: "destructor cannot be declared as a template" leads to segfault in Sema::LookupSpecialMember Differential Revision: https://reviews.llvm.org/D69225
* [clang] Add -fdebug-default-version for specifying the default DWARF versionDavid Blaikie2019-11-075-1/+76
| | | | | | | | | | This flag decouples specifying the DWARF version from enabling/disabling DWARF in general (or the gN level - gmlt/limited/standalone, etc) while still allowing existing -gdwarf-N flags to override this default. Patch by Caroline Tice! Differential Revision: https://reviews.llvm.org/D69822
OpenPOWER on IntegriCloud