summaryrefslogtreecommitdiffstats
path: root/clang/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-251-8/+0
| | | | | | | Decl::printQualifiedName Reason: causes a test failure, will investigate and re-land with a fix. llvm-svn: 372880
* [libTooling] Introduce the MatchConsumer abstractionYitzhak Mandelbaum2019-09-253-12/+62
| | | | | | | | | | | | | | | | | Summary: This revision introduces a separate (small) library for the `MatchConsumer` abstraction: computations over AST match results. This abstraction is central to the Transformer framework, and there deserves being defined explicitly. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67961 llvm-svn: 372870
* [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-251-0/+8
| | | | | | | | | | | | | | | | | | | | | Decl::printQualifiedName Summary: To be used in clangd, e.g. in D66647. Currently the alternative to this function is doing string manipulation on results of `printQualifiedName`, which is hard-to-impossible to get right in presence of template arguments. Reviewers: kadircet, aaron.ballman Reviewed By: kadircet, aaron.ballman Subscribers: aaron.ballman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67825 llvm-svn: 372863
* [HIP] Support new kernel launching APIYaxun Liu2019-09-242-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D67947 llvm-svn: 372773
* [Diagnostics] Handle tautological left shifts in boolean context David Bolvansky2019-09-241-0/+4
| | | | llvm-svn: 372749
* [Diagnostics] Do not diagnose unsigned shifts in boolean context ↵David Bolvansky2019-09-241-2/+2
| | | | | | | | (-Wint-in-bool-context) I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts. llvm-svn: 372708
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-241-2/+5
| | | | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 Reapplies r372663 after adapting a failing test in the LLDB testsuite. llvm-svn: 372681
* [static analyzer] Remove --analyze-autoJan Korous2019-09-241-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D67934 llvm-svn: 372680
* Revert "Support for DWARF-5 C++ language tags."Jonas Devlieghere2019-09-231-5/+2
| | | | | | This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007. llvm-svn: 372672
* [Diagnostics] Warn for enum constants in bool context ↵David Bolvansky2019-09-231-0/+7
| | | | | | | | (-Wint-in-bool-context; GCC compatibility) Extracted from D63082. llvm-svn: 372664
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-231-2/+5
| | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 llvm-svn: 372663
* [Sema] Fix the atomic expr rebuilding order.Michael Liao2019-09-231-3/+6
| | | | | | | | | | | | | | | | Summary: - Rearrange the atomic expr order to the API order when rebuilding atomic expr during template instantiation. Reviewers: erichkeane Subscribers: jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67924 llvm-svn: 372640
* [OPENMP]Use standard parsing for 'match' clause, NFC.Alexey Bataev2019-09-233-0/+9
| | | | | | | Reused standard clauses parsing scheme for parsing/matching 'match' clause in 'declare variant' directive. llvm-svn: 372635
* Fix __is_fundamental to accept nullptr_tZoe Carver2019-09-231-0/+1
| | | | | | | | | | | | | | Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t. Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67899 llvm-svn: 372624
* [Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC ↵David Bolvansky2019-09-232-0/+5
| | | | | | | | compatibility) Extracted from D63082, addressed review comments related to a warning message. llvm-svn: 372612
* [libTooling] Add `access` and `ifBound` combinators to Stencil library.Yitzhak Mandelbaum2019-09-231-0/+22
| | | | | | | | | | | | | | | | | | | | Summary: This revision add the `access` and `ifBound` combinators to the Stencil library: * `access` -- constructs an idiomatic expression for accessing a member (a `MemberExpr`). * `ifBound` -- chooses between two `StencilParts` based on the whether an id is bound in the match (corresponds to the combinator of the same name in RangeSelector). Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67633 llvm-svn: 372605
* [libTooling] Introduce new library of source-code builders.Yitzhak Mandelbaum2019-09-231-0/+86
| | | | | | | | | | | | | | | | | Summary: Introduces facilities for easily building source-code strings, including idiomatic use of parentheses and the address-of, dereference and member-access operators (dot and arrow) and queries about need for parentheses. Reviewers: gribozavr Subscribers: mgorny, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D67632 llvm-svn: 372595
* Removed dead code from Stencil.hDmitri Gribenko2019-09-231-10/+0
| | | | llvm-svn: 372594
* For P0784R7: add support for constexpr destructors, and call them asRichard Smith2019-09-233-8/+33
| | | | | | | | | | | appropriate during constant evaluation. Note that the evaluator is sometimes invoked on incomplete expressions. In such cases, if an object is constructed but we never reach the point where it would be destroyed (and it has non-trivial destruction), we treat the expression as having an unmodeled side-effect. llvm-svn: 372538
* [X86] Require last argument to LWPINS/LWPVAL builtins to be an ICE. Add ↵Craig Topper2019-09-222-4/+4
| | | | | | | | ImmArg to the llvm intrinsics. Update the isel patterns to use timm instead of imm. llvm-svn: 372534
* [Diagnostics] Warn if ?: with integer constants always evaluates to trueDavid Bolvansky2019-09-221-0/+4
| | | | | | Extracted from D63082. GCC has this warning under -Wint-in-bool-context, but as noted in the D63082's review, we should put it under TautologicalConstantCompare. llvm-svn: 372531
* [clang] fixing conditional explicit for out-of-line definition PR42980Gauthier Harnisch2019-09-221-4/+4
| | | | | | | | | | | | | | | | Summary: not every read in CXXConstructorDecl::getExplicitSpecifierInternal() was made on the canonical declaration. Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67889 llvm-svn: 372530
* [clang] [Basic] Enable __has_feature(leak_sanitizer)Michal Gorny2019-09-221-0/+2
| | | | | | | | | | Add a 'leak_sanitizer' feature akin to existing '*_sanitizer' features to let programmers switch code paths accounting for leak sanitizers being enabled. Differential Revision: https://reviews.llvm.org/D67719 llvm-svn: 372527
* [CLANG][BPF] permit any argument type for __builtin_preserve_access_index()Yonghong Song2019-09-221-3/+0
| | | | | | | | | | | | | | | | | | | | Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index() signature") changed the builtin function signature to PointerT __builtin_preserve_access_index(PointerT ptr) with a pointer type as the argument/return type, where argument and return types must be the same. There is really no reason for this constraint. The builtin just presented a code region so that IR builtins __builtin_{array, struct, union}_preserve_access_index can be applied. This patch removed the pointer type restriction to permit any argument type as long as it is permitted by the compiler. Differential Revision: https://reviews.llvm.org/D67883 llvm-svn: 372516
* Clang-format: Add Whitesmiths indentation stylePaul Hoad2019-09-221-0/+26
| | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for the Whitesmiths indentation style to clang-format. It’s an update to a patch submitted in 2015 (D6833), but reworks it to use the newer API. There are still some issues with this patch, primarily around `switch` and `case` support. The added unit test won’t currently pass because of the remaining issues. Reviewers: mboehme, MyDeveloperDay, djasper Reviewed By: MyDeveloperDay Subscribers: krasimir, MyDeveloperDay, echristo, cfe-commits Patch By: @timwoj (Tim Wojtulewicz) Tags: #clang Differential Revision: https://reviews.llvm.org/D67627 llvm-svn: 372497
* NFC: Change ObjCQualified*TypesAreCompatible to takeJames Y Knight2019-09-211-2/+4
| | | | | | | | | ObjCObjectPointerType arguments. All callers already had one, just creating a QualType to pass, after which the function cast it right back. llvm-svn: 372492
* Merge and improve code that detects same value in comparisons.Richard Trieu2019-09-211-0/+5
| | | | | | | | | | | | -Wtautological-overlap-compare and self-comparison from -Wtautological-compare relay on detecting the same operand in different locations. Previously, each warning had it's own operand checker. Now, both are merged together into one function that each can call. The function also now looks through member access and array accesses. Differential Revision: https://reviews.llvm.org/D66045 llvm-svn: 372453
* [clang-scan-deps] strip the --serialize-diagnostics argumentAlex Lorenz2019-09-211-0/+4
| | | | | | | This ensures that clang-scan-deps won't write out diagnostics when scanning dependencies. llvm-svn: 372444
* Ensure AtomicExpr goes through SEMA checking after TreeTransformErich Keane2019-09-201-0/+3
| | | | | | | | | | | RebuildAtomicExpr was skipping doing semantic analysis which broke in the cases where the expressions were not dependent. This resulted in the ImplicitCastExpr from an array to a pointer being lost, causing a crash in IR CodeGen. Differential Revision: https://reviews.llvm.org/D67854 llvm-svn: 372422
* [libTooling] Add `ifBound`, `elseBranch` RangeSelector combinators.Yitzhak Mandelbaum2019-09-201-0/+9
| | | | | | | | | | | | | | | | | | Summary: Adds two new combinators and corresponding tests to the RangeSelector library. * `ifBound` -- conditional evaluation of range-selectors, based on whether a given node id is bound in the match. * `elseBranch` -- selects the source range of the else and its statement. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67621 llvm-svn: 372410
* [SystemZ] Add SystemZ as supporting target in help text for -mfentry.Jonas Paulsson2019-09-201-1/+1
| | | | | | | => "Insert calls to fentry at function entry (x86/SystemZ only)" Review: Ulrich Weigand llvm-svn: 372387
* [StaticAnalyzer] Use llvm::StringLiteral instead of StringRef in few placesBenjamin Kramer2019-09-201-6/+7
| | | | | | | | StringRef's constexpr constructor seems to be extremely slow in MSVC 2017, so don't use it for generated tables. Should make PR43369 a bit better, no functionality change. llvm-svn: 372386
* [NFCI] Always initialize const members of AttributeCommonInfoAlex Langford2019-09-201-2/+2
| | | | | | | | Some compilers require that const fields of an object must be explicitly initialized by the constructor. I ran into this issue building with clang 3.8 on Ubuntu 16.04. llvm-svn: 372363
* Revert r372325 - Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-2/+0
| | | | | | This corrects the testing issues. llvm-svn: 372334
* Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-0/+2
| | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/17919 llvm-svn: 372325
* Remove an unsafe member variable that wasn't needed; NFC.Aaron Ballman2019-09-191-2/+0
| | | | | | People use the AST dumping interface while debugging, so it's not safe to assume that a declaration will be dumped before a constant expression is dumped. This means the Context member may not get set properly and problems would happen. Rather than rely on the interface that requires the ASTContext, call the generic dump() interface instead; this allows us to remove the Context member variable. llvm-svn: 372323
* Clean out unused diagnostics. NFC.Benjamin Kramer2019-09-195-21/+0
| | | | llvm-svn: 372319
* [Builtins] Delete setjmp_syscall and qsetjmpFangrui Song2019-09-191-2/+0
| | | | | | | | Similar to the resolution of gcc PR71876. Nobody uses them or needs the [-Wincomplete-setjmp-declaration] diagnostic. llvm-svn: 372299
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-192-1/+4
| | | | | | | | | | | | | | | | | | | | | | | The clang intrinsic __builtin_preserve_access_index() currently has signature: const void * __builtin_preserve_access_index(const void * ptr) This may cause compiler warning when: - parameter type is "volatile void *" or "const volatile void *", or - the assign-to type of the intrinsic does not have "const" qualifier. Further, this signature does not allow dereference of the builtin result pointer as it is a "const void *" type, which adds extra step for the user to do type casting. Let us change the signature to: PointerT __builtin_preserve_access_index(PointerT ptr) such that the result and argument types are the same. With this, directly dereferencing the builtin return value becomes possible. Differential Revision: https://reviews.llvm.org/D67734 llvm-svn: 372294
* Initialize all fields in ABIArgInfo.Serge Guelton2019-09-191-6/+4
| | | | | | | | | | | Due to usage of an uninitialized fields, we end up with a Conditional jump or move depends on uninitialised value Fixes https://bugs.llvm.org/show_bug.cgi?id=40547 Commited on behalf of Martin Liska <mliska@suse.cz> llvm-svn: 372281
* [Sema] Suppress -Wformat diagnostics for bool types when printed using %hhdErik Pilkington2019-09-181-0/+3
| | | | | | | | | | | Also, add a diagnostic under -Wformat for printing a boolean value as a character. rdar://54579473 Differential revision: https://reviews.llvm.org/D66856 llvm-svn: 372247
* [c++20] P1331R2: Allow transient use of uninitialized objects inRichard Smith2019-09-183-29/+48
| | | | | | constant evaluation. llvm-svn: 372237
* [OPENMP5.0]Allow multiple context selectors in the context selectorAlexey Bataev2019-09-182-7/+23
| | | | | | | | | sets. According to OpenMP 5.0, context selector set might include several context selectors, separated with commas. Patch fixes this problem. llvm-svn: 372235
* [AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling.Simon Pilgrim2019-09-181-2/+1
| | | | | | The static analyzer noticed that we were dereferencing it even when the default null value was being used. Further investigation showed that we never explicitly set the parameter so I've just removed it entirely. llvm-svn: 372217
* [lldb] Print better diagnostics for user expressions and modulesRaphael Isemann2019-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions. For example, in the expression below the user made a type error, but it's not clear from the diagnostic what went wrong: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: invalid operands to binary expression ('int' and 'double') ``` This patch enables full Clang diagnostics in our expression evaluator. After this patch the diagnostics for the expression look like this: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: <user expression 1>:1:54: invalid operands to binary expression ('int' and 'float') printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) ~~~~~~^~~~ ``` To make this possible, we now emulate a user expression file within our diagnostics. This prevents that the user is exposed to our internal wrapper code we inject. Note that the diagnostics that refer to declarations from the debug information (e.g. 'note' diagnostics pointing to a called function) will not be improved by this as they don't have any source locations associated with them, so caret or line printing isn't possible. We instead just suppress these diagnostics as we already do with warnings as they would otherwise just be a context message without any context (and the original diagnostic in the user expression should be enough to explain the issue). Fixes rdar://24306342 Reviewers: JDevlieghere, aprantl, shafik, #lldb Reviewed By: JDevlieghere, #lldb Subscribers: usaxena95, davide, jingham, aprantl, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65646 llvm-svn: 372203
* [Sema] Split of versions of -Wimplicit-{float,int}-conversion for ↵Erik Pilkington2019-09-172-3/+22
| | | | | | | | | | | | | Objective-C BOOL Also, add a diagnostic group, -Wobjc-signed-char-bool, to control all these related diagnostics. rdar://51954400 Differential revision: https://reviews.llvm.org/D67559 llvm-svn: 372183
* Use 'BOOL' instead of BOOL in diagnostic messagesErik Pilkington2019-09-171-4/+4
| | | | | | Type names should be enclosed in single quotes. llvm-svn: 372152
* [OPENMP5.0]Introduce attribute for declare variant directive.Alexey Bataev2019-09-174-0/+61
| | | | | | | | Added attribute for declare variant directive. It will allow to handle declare variant directive at the codegen and will allow to add extra checks. llvm-svn: 372147
* [RISCV] Add option aliases: -mcmodel=medany and -mcmodel=medlowKito Cheng2019-09-171-0/+6
| | | | | | | | | | | | | | RISC-V GCC use -mcmodel=medany and -mcmodel=medlow, but LLVM use -mcmodel=small and -mcmodel=medium. Add those two option aliases for provide same user interface between GCC and LLVM. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67066 llvm-svn: 372080
* [clangd] Fix a crash when renaming operator.Haojian Wu2019-09-161-2/+1
| | | | | | | | | | | | | | | | | | | | Summary: The renamelib uses a tricky way to calculate the end location by relying on decl name, this is incorrect for the overloaded operator (the name is "operator++" instead of "++"), which will cause out-of-file offset. We also disable renaming operator symbol, this case is tricky, and renamelib doesnt handle it properly. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67607 llvm-svn: 371971
OpenPOWER on IntegriCloud