summaryrefslogtreecommitdiffstats
path: root/clang/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Reland [NFC-I] Remove hack for fp-classification builtinsErich Keane2019-12-171-7/+7
| | | | | | | | | | | | | | | | | | The FP-classification builtins (__builtin_isfinite, etc) use variadic packs in the definition file to mean an overload set. Because of that, floats were converted to doubles, which is incorrect. There WAS a patch to remove the cast after the fact. THis patch switches these builtins to just be custom type checking, calls the implicit conversions for the integer members, and makes sure the correct L->R casts are put into place, then does type checking like normal. A future direction (that wouldn't be NFC) would consider making conversions for the floating point parameter legal. Note: The initial patch for this missed that certain systems need to still convert half to float, since they dont' support that type.
* Check whether the destination is a complete type in a static_cast (orRichard Smith2019-12-161-1/+1
| | | | | | | | | C-style cast) to an enumeration type. We previously forgot to check this, and happened to get away with it (with bad diagnostics) only because we misclassified incomplete enumeration types as not being unscoped enumeration types. This also fixes the misclassification.
* [c++20] P1959R0: Remove support for std::*_equality.Richard Smith2019-12-163-31/+19
|
* If constant evaluation fails due to an unspecified pointer comparison,Richard Smith2019-12-161-0/+2
| | | | | produce a note saying that rather than the default "evaluation failed" note.
* [c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.Richard Smith2019-12-164-18/+95
| | | | | | | | | | | | | | | | | | | This covers: * usual arithmetic conversions (comparisons, arithmetic, conditionals) between different enumeration types * usual arithmetic conversions between enums and floating-point types * comparisons between two operands of array type The deprecation warnings are on-by-default (in C++20 compilations); it seems likely that these forms will become ill-formed in C++23, so warning on them now by default seems wise. For the first two bullets, off-by-default warnings were also added for all the cases where we didn't already have warnings (covering language modes prior to C++20). These warnings are in subgroups of the existing -Wenum-conversion (except that the first case is not warned on if either enumeration type is anonymous, consistent with our existing -Wenum-conversion warnings).
* Revert "[NFC-I] Remove hack for fp-classification builtins"Erich Keane2019-12-161-7/+7
| | | | | | | | | | | This reverts commit b1e542f302c1ed796ad9f703d4d36e010afcb914. The original 'hack' didn't chop out fp-16 to double conversions, so systems that use FP16ConversionIntrinsics end up in IR-CodeGen with an i16 type isntead of a float type (like PPC64-BE). The bots noticed this. Reverting until I figure out how to fix this
* Fix a bug in the property-based serialization ofJohn McCall2019-12-161-1/+1
| | | | | | | | | dependent template names. Apparently we didn't test this in the test suite because we have a lot of redundant ways of representing this situation that kick in in the more common situations. For example, DependentTST stores a qualifier + identifier pair rather than a TemplateName.
* [NFC-I] Remove hack for fp-classification builtinsErich Keane2019-12-161-7/+7
| | | | | | | | | | | | | | | The FP-classification builtins (__builtin_isfinite, etc) use variadic packs in the definition file to mean an overload set. Because of that, floats were converted to doubles, which is incorrect. There WAS a patch to remove the cast after the fact. THis patch switches these builtins to just be custom type checking, calls the implicit conversions for the integer members, and makes sure the correct L->R casts are put into place, then does type checking like normal. A future direction (that wouldn't be NFC) would consider making conversions for the floating point parameter legal.
* [WebAssembly] Replace SIMD int min/max builtins with patternsThomas Lively2019-12-161-15/+0
| | | | | | | | | | | | | | | | | | Summary: The instructions were originally implemented via builtins and intrinsics so users would have to explicitly opt-in to using them. This was useful while were validating whether these instructions should have been merged into the spec proposal. Now that they have been, we can use normal codegen patterns, so the intrinsics and builtins are no longer useful. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71500
* Forward {read,write}SomeEnumType to {read,write}Enum instead ofJohn McCall2019-12-162-0/+24
| | | | | | directly to {read,write}UInt32. This will be useful for textual formats. NFC.
* Use property-based serialization for TemplateArgument.John McCall2019-12-164-90/+101
|
* Use property-based serialization for TemplateName.John McCall2019-12-164-115/+109
|
* Add the ability for properties to be conditional on other properties.John McCall2019-12-162-3/+15
| | | | This will be required by TemplateName.
* Add the ability to declare helper variables when readingJohn McCall2019-12-161-1/+15
| | | | | | | properties from a value. This is useful when the properties of a case are actually read out of a specific structure, as with TemplateName.
* Use property-based serialization for DeclarationName.John McCall2019-12-163-80/+61
|
* Add the ability to use property-based serialization for "cased" types.John McCall2019-12-168-10/+115
| | | | | | This patch doesn't actually use this serialization for anything, but follow-ups will move the current handling of various standard types over to this.
* Replace tabs with spaces.John McCall2019-12-162-130/+130
|
* Always -I clang/include when tblgen'ing in Clang.John McCall2019-12-162-7/+2
|
* Fixing a -Wcovered-switch diagnostic and changing tabs to spaces; NFC.Aaron Ballman2019-12-161-7/+7
|
* Fix floating point builtins to not promote float->doubleErich Keane2019-12-161-6/+6
| | | | | | | | | | | As brought up in D71467, a group of floating point builtins automatically promoted floats to doubles because they used the variadic builtin tag to support an overload set. The result is that the parameters were treated as a variadic pack, which always promots float->double. This resulted in the wrong answer being given in cases with certain values of NaN.
* Silence an MSVC "not all control paths" diagnostic; NFC.Aaron Ballman2019-12-161-0/+1
|
* [NFC] Fix typos in Clangd and ClangKirill Bobyrev2019-12-161-9/+9
| | | | | | Reviewed by: Jim Differential Revision: https://reviews.llvm.org/D71455
* [c++20] Compute exception specifications for defaulted comparisons.Richard Smith2019-12-151-2/+5
| | | | | | | | This requires us to essentially fully form the body of the defaulted comparison, but from an unevaluated context. Naively this would require generating the function definition twice; instead, we ensure that the function body is implicitly defined before performing the check, and walk the actual body where possible.
* Properly compute whether statement expressions can throw, rather thanRichard Smith2019-12-152-1/+5
| | | | | | | | | conservatively assuming they always can. Also fix cases where we would not consider the computation of a VLA type when determining whether an expression can throw. We don't yet properly determine whether a VLA can throw, but no longer incorrectly claim it can never throw.
* [clang] Improve LLVM-style RTTI support in ExternalASTSource/ExternalSemaSourceRaphael Isemann2019-12-153-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have some very basic LLVM-style RTTI support in the ExternalASTSource class hierarchy based on the `SemaSource` bool( to discriminate it form the ExternalSemaSource). As ExternalASTSource is supposed to be subclassed we should have extendable LLVM-style RTTI in this class hierarchy to make life easier for projects building on top of Clang. Most notably the current RTTI implementation forces LLDB to implement RTTI for its own ExternalASTSource class (ClangExternalASTSourceCommon) by keeping a global set of ExternalASTSources that are known to be ClangExternalASTSourceCommon. Projects using Clang currently have to dosimilar workarounds to get RTTI support for their subclasses. This patch turns this into full-fledged LLVM-style RTTI based on a static `ID` variable similar to other LLVM class hierarchies. Also removes the friend declaration from ExternalASTSource to its child class that was only used to grant access to the `SemaSource` member. Reviewers: aprantl, dblaikie, rjmccall Reviewed By: aprantl Subscribers: riccibruno, labath, lhames, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71397
* [clang] Fix modules build after addition of TypeBitCodes.defRaphael Isemann2019-12-141-1/+9
| | | | | | | | | In revision 139006ceb641f038a2b19cac1174316e57004ed6 the Serialization folder got its first def file 'TypeBitCodes.def'. This broke the modules build as this .def file was not textually included but implicitly converted into a module due to our umbrella directive. This patch fixes this by explicitly marking the .def file as textual.
* Move ASTRecordWriter into its own header; NFC.John McCall2019-12-142-286/+295
| | | | | | | | | | Similar motivations to the movement of ASTRecordReader: AbstractBasicWriter.h already has quite a few dependencies, and it's going to get pretty large as we generate more and more into it. Meanwhile, most clients don't depend on this detail of the implementation and shouldn't need to be recompiled. I've also made OMPClauseWriter private, like it belongs.
* Move ASTRecordReader into its own header; NFC.John McCall2019-12-142-352/+353
| | | | | | | | | | | | | AbstractBasicReader.h has quite a few dependencies already, and that's only likely to increase. Meanwhile, ASTRecordReader is really an implementation detail of the ASTReader that is only used in a small number of places. I've kept it in a public header for the use of projects like Swift that might want to plug in to Clang's serialization framework. I've also moved OMPClauseReader into an implementation file, although it can't be made private because of friendship.
* MSVC build fix: forget some unneeded and incorrect friends.John McCall2019-12-142-3/+0
| | | | | | | | On MSVC, friend declarations are (incorrectly) visible even if not otherwise declared, which causes them to interfere with lookup. ASTTypeWriter is actually in an anonymous namespace and cannot be ASTWriter's friend. The others simply don't need to be anymore.
* Abstract serialization: TableGen the (de)serialization code for Types.John McCall2019-12-1410-18/+1685
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic technical design here is that we have three levels of readers and writers: - At the lowest level, there's a `Basic{Reader,Writer}` that knows how to emit the basic structures of the AST. CRTP allows this to be metaprogrammed so that the client only needs to support a handful of primitive types (e.g. `uint64_t` and `IdentifierInfo*`) and more complicated "inline" structures such as `DeclarationName` can just be emitted in terms of those primitives. In Clang's binary-serialization code, these are `ASTRecord{Reader,Writer}`. For now, a large number of basic structures are still emitted explicitly by code on those classes rather than by either TableGen or CRTP metaprogramming, but I expect to move more of these over. - In the middle, there's a `Property{Reader,Writer}` which is responsible for processing the properties of a larger object. The object-level reader/writer asks the property-level reader/writer to project out a particular property, yielding a basic reader/writer which will be used to read/write the property's value, like so: ``` propertyWriter.find("count").writeUInt32(node->getCount()); ``` Clang's binary-serialization code ignores this level (it uses the basic reader/writer as the property reader/writer and has the projection methods just return `*this`) and simply relies on the roperties being read/written in a stable order. - At the highest level, there's an object reader/writer (e.g. `Type{Reader,Writer}` which emits a logical object with properties. Think of this as writing something like a JSON dictionary literal. I haven't introduced support for bitcode abbreviations yet --- it turns out that there aren't any operative abbreviations for types besides the QualType one --- but I do have some ideas of how they should work. At any rate, they'll be necessary in order to handle statements. I'm sorry for not disentangling the patches that added basic and type reader/writers; I made some effort to, but I ran out of energy after disentangling a number of other patches from the work. Negligible impact on module size, time to build a set of about 20 fairly large modules, or time to read a few declarations out of them.
* Abstract serialization: TableGen "basic" reader/writer CRTPJohn McCall2019-12-145-3/+194
| | | | classes that serialize basic values
* Standardize the reader methods in ASTReader; NFC.John McCall2019-12-141-182/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | There are three significant changes here: - Most of the methods to read various embedded structures (`APInt`, `NestedNameSpecifier`, `DeclarationName`, etc.) have been moved from `ASTReader` to `ASTRecordReader`. This cleans up quite a bit of code which was passing around `(F, Record, Idx)` arguments everywhere or doing explicit indexing, and it nicely parallels how it works on the writer side. It also sets us up to then move most of these methods into the `BasicReader`s that I'm introducing as part of abstract serialization. As part of this, several of the top-level reader methods (e.g. `readTypeRecord`) have been converted to use `ASTRecordReader` internally, which is a nice readability improvement. - I've standardized most of these method names on `readFoo` rather than `ReadFoo` (used in some of the helper structures) or `GetFoo` (used for some specific types for no apparent reason). - I've changed a few of these methods to return their result instead of reading into an argument passed by reference. This is partly for general consistency and partly because it will make the metaprogramming easier with abstract serialization.
* Extract the TypeClass <-> TypeCode map into a .def file; NFC.John McCall2019-12-142-142/+67
|
* Add a function to get the ExceptionSpecInfo of a function type; NFC.John McCall2019-12-141-11/+18
|
* [c++20] Improve phrasing of diagnostic for missing #include <compare>.Richard Smith2019-12-132-3/+14
|
* [OPENMP]Fix skipping of functions body.Alexey Bataev2019-12-132-0/+23
| | | | | | When parsing the code with OpenMP and the function's body must be skipped, need to skip also OpenMP annotation tokens. Otherwise the counters for braces/parens are unbalanced and parsing fails.
* [ARM][MVE][Intrinsics] remove extraneous intrinsics. (Reapply)Mark Murray2019-12-132-23/+31
| | | | | | | | | | | | | | | | | | Summary: I overstepped my reach and generated too many intrinsics; these never made it into the tests. Remove these extras. Some needed to be signed-olny, and there were some possible but unrequired _x variants that needed an extra argument to IntrinsicMX to allow [de-]selection at compile-time. Reviewers: simon_tatham Subscribers: kristof.beyls, dmgreen, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71466
* Revert "[ARM][MVE][Intrinsics] remove extraneous intrinsics."Dmitri Gribenko2019-12-132-29/+21
| | | | | | | This reverts commit 0eb0992739189dba0d86af33722bc27260a9b555. The code does not compile: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/20462
* [ARM][MVE][Intrinsics] remove extraneous intrinsics.Mark Murray2019-12-132-21/+29
| | | | | | | | | | | | | | | | | | Summary: I overstepped my reach and generated too many intrinsics; these never made it into the tests. Remove these extras. Some needed to be signed-olny, and there were some possible but unrequired _x variants that needed an extra argument to IntrinsicMX to allow [de-]selection at compile-time. Reviewers: simon_tatham Subscribers: kristof.beyls, dmgreen, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71466
* [ARM][MVE] Add vector reduction intrinsics with two vector operandsMikhail Maltsev2019-12-132-0/+127
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds intrinsics for the following MVE instructions: * VABAV * VMLADAV, VMLSDAV * VMLALDAV, VMLSLDAV * VRMLALDAVH, VRMLSLDAVH Each of the above 4 groups has a corresponding new LLVM IR intrinsic, since the instructions cannot be easily represented using general-purpose IR operations. Reviewers: simon_tatham, ostannard, dmgreen, MarkMurrayARM Reviewed By: MarkMurrayARM Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71062
* [ARM][MVE] Add intrinsics for more immediate shifts.Simon Tatham2019-12-131-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fills in the remaining shift operations that take a single vector input and an immediate shift count: the `vqshl`, `vqshlu`, `vrshr` and `vshll[bt]` families. `vshll[bt]` (which shifts each input lane left into a double-width output lane) is the most interesting one. There are separate MC instruction ids for shifting by exactly the input lane width and shifting by less than that, because the instruction encoding is so completely different for the lane-width special case. So I had to write two sets of patterns to match based on the immediate shift count, which involved adding a ComplexPattern matcher to avoid the general-case pattern accidentally matching the special case too. For that family I've made sure to add an llc codegen test for both versions of each instruction. I'm experimenting with a new strategy for parametrising the isel patterns for all these instructions: adding extra fields to the relevant `Instruction` subclass itself, which are ignored by the Tablegen backends that generate the MC data, but can be retrieved from each instance of that instruction subclass when it's passed as a template parameter to the multiclass that generates its isel patterns. A nice effect of that is that I can fill in those informational fields using `let` blocks, rather than having to type them out once per instruction at `defm` time. (As a result, quite a lot of existing instruction `def`s are reindented by this patch, so it's clearer to read with whitespace changes ignored.) Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard Reviewed By: MarkMurrayARM Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71458
* [Sema] Improve diagnostic about addr spaces for overload candidatesAnastasia Stulova2019-12-133-2/+28
| | | | | | | | | | Allow sending address spaces into diagnostics to simplify and improve error reporting. Improved wording of diagnostics for address spaces in overloading. Tags: #clang Differential Revision: https://reviews.llvm.org/D71111
* [ARM][MVE][Intrinsics] Add *_x() variants of my *_m() intrinsics.Mark Murray2019-12-131-72/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Better use of multiclass is used, and this helped find some existing bugs in the predicated VMULL* intrinsics, which are now fixed. The refactored VMULL[TB]Q_(INT|POLY)_M() intrinsics were discovered to have an argument ("inactive") with incorrect type, and this required a fix that is included in this whole patch. The argument "inactive" should have been the same width (per vector element) as the return type of the intrinsic, but was not in the case where the return type was double the element width of the input types. To assist in testing the multiclassing , and to thwart further gremlins, the unit tests are improved in scope. The *.ll tests are all generated by a small bit of throw-away scripting from the corresponding *.c tests, and as such the diffs are large and nasty. Look at the file rather than the diff. Reviewers: dmgreen, miyuki, ostannard, simon_tatham Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71421
* Correct inf typoAndrew Gaul2019-12-131-1/+1
| | | | | | | | | | | | Reviewers: krasimir Reviewed By: krasimir Subscribers: Jim, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57732
* [OPENMP50]Improve checks for declare variant functions compatibility.Alexey Bataev2019-12-121-4/+0
| | | | | Added check for functions compatibility in C and removed restriction for functions with no prototypes in declare variant constrcut.
* [ARM][CMSE] Add CMSE header and builtinsMomchil Velikov2019-12-121-0/+6
| | | | | | | | | | | | This is patch C2 as mentioned in RFC http://lists.llvm.org/pipermail/cfe-dev/2019-March/061834.html This adds CMSE builtin functions, and introduces arm_cmse.h header which has useful macros, functions, and data types for end-users of CMSE. Patch by Javed Absar. Diferential Revision: https://reviews.llvm.org/D70817
* [Tooling/Syntax] Helpers to find spelled tokens touching a location.Sam McCall2019-12-122-0/+22
| | | | | | | | | | | | Summary: Useful when positions are used to target nodes, with before/after ambiguity. Reviewers: ilya-biryukov, kbobyrev Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71356
* [Syntax] Build nodes for simple cases of top level declarationsIlya Biryukov2019-12-121-2/+92
| | | | | | | | | | | | | | | | Summary: More complicated nodes (e.g. template declarations) will be implemented in the follow-up patches. Reviewers: gribozavr2 Reviewed By: gribozavr2 Subscribers: merge_guards_bot, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70856
* [analyzer] Do not cache out on some shared implicit AST nodesGabor Horvath2019-12-111-0/+1
| | | | | | | | | | | Some AST nodes which stands for implicit initialization is shared. The analyzer will do the same evaluation on the same nodes resulting in the same state. The analyzer will "cache out", i.e. it thinks that it visited an already existing node in the exploded graph. This is not true in this case and we lose coverage. Since these nodes do not really require any processing from the analyzer we just omit them from the CFG. Differential Revision: https://reviews.llvm.org/D71371
* Revert "[clang][clang-scan-deps] Aggregate the full dependency information."Michael Spencer2019-12-112-151/+9
| | | | | | This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1. It broke clang-ppc64be-linux, but not sure why yet.
OpenPOWER on IntegriCloud