summaryrefslogtreecommitdiff
path: root/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA][HIP] Fix typo in `BestViableFunction`Michael Liao2019-09-191-7/+9
| | | | | | | | | | | | | | | | | | | Summary: - Should consider viable ones only when checking SameSide candidates. - Replace erasing with clearing viable flag to reduce data moving/copying. - Add one and revise another one as the diagnostic message are more relevant compared to previous one. Reviewers: tra Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D67730 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372318 91177308-0d34-0410-b5e6-96231b3b80d8
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-191-1/+11
| | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372294 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Suppress -Wformat diagnostics for bool types when printed using %hhdErik Pilkington2019-09-181-0/+16
| | | | | | | | | | | Also, add a diagnostic under -Wformat for printing a boolean value as a character. rdar://54579473 Differential revision: https://reviews.llvm.org/D66856 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372247 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] P1331R2: Allow transient use of uninitialized objects inRichard Smith2019-09-181-11/+30
| | | | | | constant evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372237 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Allow multiple context selectors in the context selectorAlexey Bataev2019-09-182-33/+42
| | | | | | | | | sets. According to OpenMP 5.0, context selector set might include several context selectors, separated with commas. Patch fixes this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372235 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Split of versions of -Wimplicit-{float,int}-conversion for ↵Erik Pilkington2019-09-171-28/+59
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372183 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore exception specifier mismatch when merging redeclarationsReid Kleckner2019-09-171-1/+6
| | | | | | | | | | | | | | | | | | Exception specifiers are now part of the function type in C++17. Normally, it is illegal to redeclare the same function or specialize a template with a different exception specifier, but under -fms-compatibility, we accept it with a warning. Without this change, the function types would not match due to the exception specifier, and clang would claim that the types were "incompatible". Now we emit the warning and merge the redeclaration as we would in C++14 and earlier. Fixes PR42842, which is about compiling _com_ptr_t in C++17. Based on a patch by Alex Fusco <alexfusco@google.com>! Differential Revision: https://reviews.llvm.org/D67590 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372178 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Introduce attribute for declare variant directive.Alexey Bataev2019-09-173-1/+87
| | | | | | | | Added attribute for declare variant directive. It will allow to handle declare variant directive at the codegen and will allow to add extra checks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372147 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SpellingNotCalculated to Attribute Enums to suppress UBSan warningsErich Keane2019-09-171-0/+2
| | | | | | | UBSan downstreams noticed that the assignment of SpellingNotCalculated to the spellings caused warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372124 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Tidy up some comments; NFCSven van Haastregt2019-09-171-10/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372119 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide implementation details in namespaces.Benjamin Kramer2019-09-171-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372113 91177308-0d34-0410-b5e6-96231b3b80d8
* Push lambda scope earlier when transforming lambda expressionNicholas Allegra2019-09-171-4/+4
| | | | | | | | Differential Revision: https://reviews.llvm.org/D66067 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372058 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules][Objective-C] Use complete decl from module when diagnosing missing ↵Bruno Cardoso Lopes2019-09-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | import Summary: Otherwise the definition (first found) for ObjCInterfaceDecl's might precede the module one, which will eventually lead to crash, since diagnoseMissingImport needs one coming from a module. This behavior changed after Richard's r342018, which started to look into the definition of ObjCInterfaceDecls. rdar://problem/49237144 Reviewers: rsmith, arphaman Subscribers: jkorous, dexonsmith, ributzka, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372039 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Fix parsing/sema for function templates with declare simd.Alexey Bataev2019-09-161-1/+1
| | | | | | | | Need to return original declaration group with FunctionTemplateDecl, not the inner FunctionDecl, to correctly handle parsing of directives with the templates parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372011 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some definitions from Sema to Basic to fix shared libs buildErich Keane2019-09-161-70/+0
| | | | | | | | r371875 moved some functionality around to a Basic header file, but didn't move its definitions as well. This patch moves some things around so that shared library building can work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371985 91177308-0d34-0410-b5e6-96231b3b80d8
* [Diagnostics] Added silence note for -Wsizeof-array-div; suggest extra parensDavid Bolvansky2019-09-141-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371924 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Add basic support for declare variant directive.Alexey Bataev2019-09-132-77/+296
| | | | | | | Added basic support for declare variant directive and its match clause with user context selector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371892 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.Erich Keane2019-09-1311-829/+529
| | | | | | | | | | | | In order to enable future improvements to our attribute diagnostics, this moves info from ParsedAttr into CommonAttributeInfo, then makes this type the base of the *Attr and ParsedAttr types. Quite a bit of refactoring took place, including removing a bunch of redundant Spelling Index propogation. Differential Revision: https://reviews.llvm.org/D67368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371875 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][Typo Correction] Fix potential infite loop on ambiguity checksDavid Goldman2019-09-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a bug introduced in D62648, where Clang could infinite loop if it became stuck on a single TypoCorrection when it was supposed to be testing ambiguous corrections. Although not a common case, it could happen if there are multiple possible corrections with the same edit distance. The fix is simply to wipe the TypoExpr from the `TransformCache` so that the call to `TransformTypoExpr` doesn't use the `CachedEntry`. Reviewers: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67515 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371859 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR17164: split -fno-lax-vector-conversion into three differentRichard Smith2019-09-131-1/+21
| | | | | | | | | | | | | | | | | | | | | levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. This reinstates r371805, reverted in r371813, with an additional fix for lldb. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371817 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "For PR17164: split -fno-lax-vector-conversion into three different"Jonas Devlieghere2019-09-131-21/+1
| | | | | | | This breaks the LLDB build. I tried reaching out to Richard, but haven't gotten a reply yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371813 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR17164: split -fno-lax-vector-conversion into three differentRichard Smith2019-09-131-1/+21
| | | | | | | | | | | | | | | | | | levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371805 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS] Warn when shadowing template parameters under -fms-compatibilityReid Kleckner2019-09-121-6/+5
| | | | | | | | | | | | | | | | | | | | Summary: C++ does not allow shadowing template parameters, but previously we allowed it under -fms-extensions. Now this behavior is controlled by -fms-compatibility, and we emit a -Wmicrosoft-template warning when it happens. Fixes PR43265 Reviewers: thakis, hans Subscribers: amccarth, rsmith, STL_MSFT, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371753 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't warn about selectany on implicitly inline variablesReid Kleckner2019-09-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This avoids a -Wignored-attribute warning on the code pattern Microsoft recommends for integral const static data members defined in headers here: https://docs.microsoft.com/en-us/cpp/build/reference/microsoft-extensions-to-c-and-cpp?view=vs-2019 The attribute is redundant, but it is necessary when compiling in C++14 modes with /Za, which disables MSVC's extension that treats such variables as implicitly inline. Fixes PR43270 Reviewers: epastor, thakis, hans Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67426 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371749 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed some questionable default arguments from settersDmitri Gribenko2019-09-121-4/+4
| | | | | | | | | | | | | | | | | Summary: They can be confusing -- what does it mean to call a setter without a value? Also, some setters, like `setPrintTemplateTree` had `false` as the default value! The callers are largely not using these default arguments anyway. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67491 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371731 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS] Consder constexpr globals to be inline, as in C++17Reid Kleckner2019-09-111-2/+5
| | | | | | | | | | | | | | | | Summary: Microsoft seems to do this regardless of the language mode, so we must also do it in order to be ABI compatible. Fixes PR36125 Reviewers: thakis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47956 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371642 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Update the diagnosis message for canonical loop form, by ChiAlexey Bataev2019-09-111-15/+16
| | | | | | | | | | | | | | | Chun Chen. The previous patch (https://reviews.llvm.org/D54441) support the relational-op != very well for openmp canonical loop form, however, it didn't update the diagnosis message. So this patch is simply update the diagnosis message by adding !=, update the test related to it, and update the section number for canonical loop form for OpenMP 5.0 in comment. Differential Revision: https://reviews.llvm.org/D66559 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371631 91177308-0d34-0410-b5e6-96231b3b80d8
* [Diagnostics] Add -Wsizeof-array-divDavid Bolvansky2019-09-111-10/+21
| | | | | | | | | | Summary: Clang version of https://www.viva64.com/en/examples/v706/ Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D67287 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371605 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit -Wmicrosoft-enum-value warning instead of error in MS ABIReid Kleckner2019-09-111-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The first NFC change is to replace a getCXXABI().isMicrosoft() check with getTriple().isWindowsMSVCEnvironment(). This code takes effect in non-C++ compilations, so it doesn't make sense to check the C++ ABI. In the MS ABI, enums are always considered to be "complete" because the underlying type of an unfixed enum will always be 'int'. This behavior was moved from -fms-compatibility to MS ABI back in r249656. The second change is functional, and it downgrades an error to a warning when the MS ABI is used rather than only under -fms-compatibility. The reasoning is that it's unreasonable for the following code to reject the following code for all MS ABI targets with -fno-ms-compatibility: enum Foo { Foo_Val = 0xDEADBEEF }; This is valid code for any other target, but in the MS ABI, Foo_Val just happens to be negative. With this change, clang emits a -Wmicrosoft-enum-value warning on this code, but compiles it without error. Fixes PR38478 Reviewers: hans, rsmith, STL_MSFT Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67304 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371581 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Allow teams directive outside of the target directives.Alexey Bataev2019-09-101-1/+4
| | | | | | | According to OpenMP 5.0, teams directives are allowed not only in the target context, but also in the implicit parallel regions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371553 91177308-0d34-0410-b5e6-96231b3b80d8
* PR43242: Fix crash when typo-correcting to an operator() that should notRichard Smith2019-09-091-10/+1
| | | | | | have been visible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371468 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Allow _MM_FROUND_CUR_DIRECTION and _MM_FROUND_NO_EXC to be used ↵Craig Topper2019-09-091-1/+3
| | | | | | | | | | together on instructions that only support SAE and not embedded rounding. Current for SAE instructions we only allow _MM_FROUND_CUR_DIRECTION(bit 2) or _MM_FROUND_NO_EXC(bit 3) to be used as the immediate passed to the inrinsics. But these instructions don't perform rounding so _MM_FROUND_CUR_DIRECTION is just sort of a default placeholder when you don't want to suppress exceptions. Using _MM_FROUND_NO_EXC by itself is really bit equivalent to (_MM_FROUND_NO_EXC | _MM_FROUND_TO_NEAREST_INT) since _MM_FROUND_TO_NEAREST_INT is 0. Since we aren't rounding on these instructions we should also accept (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC) as equivalent to (_MM_FROUND_NO_EXC). icc allows this, but gcc does not. Differential Revision: https://reviews.llvm.org/D67289 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371430 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge note_ovl_builtin_candidate diagnostics; NFCSven van Haastregt2019-09-091-2/+2
| | | | | | | There is no difference between the unary and binary case, so merge them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371403 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes an assertion while instantiating a template with an incomplete ↵Aaron Ballman2019-09-071-2/+6
| | | | | | | | | | typo-corrected type. Fixes PR35682. When a template in instantiated with an incomplete typo corrected type an assertion can trigger if the -ferror-limit is used to reduce the number of errors. Patch by Mark de Wever. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371320 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownershipAkira Hatanaka2019-09-073-52/+34
| | | | | | | | | | | | | | | | | qualifications as unavailable if the union is declared in a system header r365985 stopped marking those fields as unavailable, which caused the union's NonTrivialToPrimitive* bits to be set to true. This patch restores the behavior prior to r365985, except that users can explicitly specify the ownership qualification of the field to instruct the compiler not to mark it as unavailable. rdar://problem/53420753 Differential Revision: https://reviews.llvm.org/D65256 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371276 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Diagnose default-initialization, destruction, and copying ofAkira Hatanaka2019-09-074-34/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-trivial C union types This recommits r365985, which was reverted because it broke a few projects using unions containing non-trivial ObjC pointer fields in system headers. We now have a patch to fix the problem (see https://reviews.llvm.org/D65256). Original commit message: This patch diagnoses uses of non-trivial C unions and structs/unions containing non-trivial C unions in the following contexts, which require default-initialization, destruction, or copying of the union objects, instead of disallowing fields of non-trivial types in C unions, which is what we currently do: - function parameters. - function returns. - assignments. - compound literals. - block captures except capturing of `__block` variables by non-escaping blocks. - local and global variable definitions. - lvalue-to-rvalue conversions of volatile types. See the discussion in https://reviews.llvm.org/D62988 for more background. rdar://problem/50679094 Differential Revision: https://reviews.llvm.org/D63753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371275 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFCI] Unbreak buildbotsDavid Bolvansky2019-09-061-22/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371226 91177308-0d34-0410-b5e6-96231b3b80d8
* [Diagnostics] Refactor code for -Wsizeof-pointer-div, catch more cases; also ↵David Bolvansky2019-09-062-12/+25
| | | | | | | | | | | | | | | | | | add -Wsizeof-array-div Previously, -Wsizeof-pointer-div failed to catch: const int *r; sizeof(r) / sizeof(int); Now fixed. Also introduced -Wsizeof-array-div which catches bugs like: sizeof(r) / sizeof(short); (Array element type does not match type of sizeof operand). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371222 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland [LifetimeAnalysis] Support more STL idioms (template forward ↵Matthias Gehre2019-09-064-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration and DependentNameType) Reland after https://reviews.llvm.org/D66806 fixed the false-positive diagnostics. Summary: This fixes inference of gsl::Pointer on std::set::iterator with libstdc++ (the typedef for iterator on the template is a DependentNameType - we can only put the gsl::Pointer attribute on the underlaying record after instantiation) inference of gsl::Pointer on std::vector::iterator with libc++ (the class was forward-declared, we added the gsl::Pointer on the canonical decl (the forward decl), and later when the template was instantiated, there was no attribute on the definition so it was not instantiated). and a duplicate gsl::Pointer on some class with libstdc++ (we first added an attribute to a incomplete instantiation, and then another was copied from the template definition when the instantiation was completed). We now add the attributes to all redeclarations to fix thos issues and make their usage easier. Reviewers: gribozavr Subscribers: Szelethus, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66179 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371182 91177308-0d34-0410-b5e6-96231b3b80d8
* [Diagnostics] Minor improvements for -Wxor-used-as-powDavid Bolvansky2019-09-051-22/+35
| | | | | | | | Extracted from D66397; implemented suggestion for 2^64; tests revisited. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371122 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add image type handling for builtinsSven van Haastregt2019-09-051-43/+151
| | | | | | | | | | | | | | | | | | | Image types were previously available, but not working. This patch adds image type handling. Rename the image type definitions in the .td file to make them consistent with other type names. Use abstract types to represent the unqualified types. Instantiate access-qualified image types at the point of use using, e.g. `ImageType<Image2d, "RO">`. Add/update TableGen definitions for the read_image/write_image builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63480 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371046 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Refactor LookupVisibleDecls. NFCIlya Biryukov2019-09-051-272/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We accumulated some configuration parameters for LookupVisibleDecls that are being passed unchanged to recursive calls, e.g. LoadExternal and IncludeDependentBases. At the same time, there is a bunch of parameters that can change in the recursive invocations. It is hard to tell the difference between those groups, making the code hard to follow. This change introduces a helper struct and factors out the non-changing bits into fields, making recursive calls in the implementation code easier to read. Reviewers: sammccall Reviewed By: sammccall Subscribers: riccibruno, doug.gregor, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65752 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371032 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] Fix some ambiguities in our mangling of lambdas with explicitRichard Smith2019-09-051-2/+6
| | | | | | | | | | | | | template parameters. This finishes the implementation of the proposal described in https://github.com/itanium-cxx-abi/cxx-abi/issues/31. (We already implemented the <lambda-sig> extensions, but didn't take them into account when computing mangling numbers, and didn't deal properly with expanded parameter packs, and didn't disambiguate between different levels of template parameters in manglings.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371004 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR43213, track whether template parameters are implicit throughRichard Smith2019-09-041-0/+3
| | | | | | | template instantiation so we know whether to mangle them in lambda-expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370991 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] P1143R2: Add support for the C++20 'constinit' keyword.Richard Smith2019-09-044-40/+155
| | | | | | | | | | | | | This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a couple of additional syntactic and semantic restrictions. In passing, I added a warning for the attribute form being added after we have already seen the initialization of the variable (but before we see the definition); that case previously slipped between the cracks and the attribute was silently ignored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370972 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*Jinsong Ji2019-09-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is follow up of https://reviews.llvm.org/D66699. We might get ISEL ICE if we call vec_dss with non const 3rd arg. ``` Cannot select: intrinsic %llvm.ppc.altivec.dst ``` We should check the constraints in clang and generate better error messages. Reviewers: nemanjai, hfinkel, echristo, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66748 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370912 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC][Altivec] Fix constant argument for vec_dssJinsong Ji2019-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to vec_ct* in https://reviews.llvm.org/rL304205. The argument must be a constant, otherwise instruction selection will fail. always_inline is not enough for isel to always fold everything away at -O0. The fix is to turn the function into macros in altivec.h. Fixes https://bugs.llvm.org/show_bug.cgi?id=43072 Reviewers: nemanjai, hfinkel, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66699 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370902 91177308-0d34-0410-b5e6-96231b3b80d8
* [LifetimeAnalysis] Fix some false positivesGabor Horvath2019-09-031-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D66806 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370773 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixit for -Wfinal-dtor-non-final-classDavid Bolvansky2019-09-031-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370740 91177308-0d34-0410-b5e6-96231b3b80d8
* Added fixit notes for -Wfinal-dtor-non-final-classDavid Bolvansky2019-09-031-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370737 91177308-0d34-0410-b5e6-96231b3b80d8