summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement Attribute Target MultiVersioningErich Keane2018-01-082-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC's attribute 'target', in addition to being an optimization hint, also allows function multiversioning. We currently have the former implemented, this is the latter's implementation. This works by enabling functions with the same name/signature to coexist, so that they can all be emitted. Multiversion state is stored in the FunctionDecl itself, and SemaDecl manages the definitions. Note that it ends up having to permit redefinition of functions so that they can all be emitted. Additionally, all versions of the function must be emitted, so this also manages that. Note that this includes some additional rules that GCC does not, since defining something as a MultiVersion function after a usage has been made illegal. The only 'history rewriting' that happens is if a function is emitted before it has been converted to a multiversion'ed function, at which point its name needs to be changed. Function templates and virtual functions are NOT yet supported (not supported in GCC either). Additionally, constructors/destructors are disallowed, but the former is planned. llvm-svn: 322028
* Serialize the IDNS for a UsingShadowDecl rather than recomputing it.Richard Smith2018-01-062-1/+3
| | | | | | | | | Attempting to recompute it are doomed to fail because the IDNS of a declaration is not necessarily preserved across serialization and deserialization (in turn because whether a friend declaration is visible depends on whether some prior non-friend declaration exists). llvm-svn: 321921
* NFC.Evgeny Stupachenko2018-01-051-0/+1
| | | | | | | | | The patch fixes r321395, that cuased -Werror=unused-but-set-variable issue for Diagnosed var on prod build. From: Evgeny Stupachenko <evstupac@gmail.com> llvm-svn: 321854
* Again reverting an attempt to convert the DeclSpec enums into scoped enums.Faisal Vali2018-01-011-3/+3
| | | | | | | | | | | | - reverts r321622, r321625, and r321626. - the use of bit-fields is still resulting in warnings - even though we can use static-asserts to harden the code and ensure the bit-fields are wide enough. The bots still complain of warnings being seen. - to silence the warnings requires specifying the bit-fields with the underlying enum type (as opposed to the enum type itself), which then requires lots of unnecessary static casts of each enumerator within DeclSpec to the underlying-type, which even though could be seen as implementation details, it does hamper readability - and given the additional litterings, makes me question the value of the change. So in short - I give up (for now at least). Sorry about the noise. llvm-svn: 321628
* [NFC] Modernize enums TypeSpecifierWidth, TypeSpecifierSign & ↵Faisal Vali2018-01-011-3/+3
| | | | | | | | | | | | TypeSpecifierType into scoped enums with underlying types. - Since these enums are used as bit-fields - for the bit-fields to be interpreted as unsigned, the underlying type must be specified as unsigned. Previous failed attempt - wherein I did not specify an underlying type - was the sum of: https://reviews.llvm.org/rC321614 https://reviews.llvm.org/rC321615 llvm-svn: 321622
* Revert r321614 and r321615Faisal Vali2018-01-011-3/+3
| | | | | | | | - the enum changes to TypeSpecifierType are breaking some tests - and will require a more careful integration. Sorry about rushing these changes - thought I could sneak them in prior to heading out for new years ;) llvm-svn: 321616
* Add scope specifiers to updated scoped-enums (that I somehow missed in r321614)Faisal Vali2018-01-011-3/+3
| | | | llvm-svn: 321615
* [AST] Inline CompoundStmt contents into the parent allocation.Benjamin Kramer2017-12-241-2/+3
| | | | | | Saves a pointer on every CompoundStmt. llvm-svn: 321429
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-233-35/+215
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. This is a re-commit of r320230. llvm-svn: 321395
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-4/+2
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* Revert r320230 to fix buildbots.Richard Trieu2017-12-093-215/+35
| | | | llvm-svn: 320239
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-093-35/+215
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* Generalize "static data member instantiated" notification to cover variable ↵Richard Smith2017-12-053-10/+44
| | | | | | | | | templates too. While here, split the "point of instantiation changed" notification out from it; these two really are orthogonal changes. llvm-svn: 319727
* Correctly handle line table entries without filenames during AST serializationHans Wennborg2017-12-042-1/+3
| | | | | | | | | | The current code would hit an assert in ASTWriter when trying to write out the filename for a line table entry that didn't have any. Fix this by allowing the -1 sentinel value to round-trip through serialization. Differential revision: https://reviews.llvm.org/D40746 llvm-svn: 319707
* Now that C++17 is official (https://www.iso.org/standard/68564.html), start ↵Aaron Ballman2017-12-041-1/+1
| | | | | | changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. llvm-svn: 319688
* PR35456: Track definedness of variable template specializations separately fromRichard Smith2017-12-022-0/+2
| | | | | | | | | | whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. llvm-svn: 319605
* [OPENMP] Add support for cancel constructs in `target teams distributeAlexey Bataev2017-11-222-0/+2
| | | | | | | | | parallel for`. Add support for cancel/cancellation point directives inside `target teams distribute parallel for` directives. llvm-svn: 318881
* [OPENMP] Add support for cancel constructs in [teams] distributeAlexey Bataev2017-11-222-0/+4
| | | | | | | | | parallel for directives. Added codegen/sema support for cancel constructs in [teams] distribute parallel for directives. llvm-svn: 318872
* [PCH+Modules] Improve diagnosticts to help out users pass an extra header ↵Bruno Cardoso Lopes2017-11-171-2/+9
| | | | | | | | | | | | | | | search path When mixing PCH and Implicit Modules, missing a header search path can lead to the implicit built PCM to complaint about not finding its matching module map. Instead of adding more magic to implicit modules engine, add a note to help the user add the appropriate path. rdar://problem/33388847 llvm-svn: 318503
* Adjust r316292 - remove the anonymous union for sharing a bitfield in ↵Faisal Vali2017-11-112-3/+2
| | | | | | | | | | | | | | FunctionDecl. The anonymous union did NOT save us storage, but instead behaved as if we added an additional integer data member to FunctionDecl. For additional context, the anonymous union renders the bit fields as non-adjacent and prevents them from sharing the same 'memory location' (i.e. bit-storage) by requiring the anonymous union object to be appropriately aligned. This was confirmed through discussion with Richard Smith in Albuquerque (ISO C++ Meeting) https://reviews.llvm.org/rL316292 llvm-svn: 317984
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-113-113/+176
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317953
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-081-102/+133
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317648
* [preamble] Also record the "skipping" state of the preprocessorErik Verbruggen2017-11-032-2/+25
| | | | | | | | | | When a preamble ends in a conditional preprocessor block that is being skipped, the preprocessor needs to continue skipping that block when the preamble is used. This fixes PR34570. llvm-svn: 317308
* Modular Codegen: Don't home always_inline functionsDavid Blaikie2017-11-021-3/+5
| | | | | | | | Since they'll likely (not always - if the address is taken, etc) be inlined away, even at -O0, separately provided weak definitions are likely to be unused so skip all of that. llvm-svn: 317279
* Modular Codegen: Don't home/modularize static functions in headersDavid Blaikie2017-11-021-9/+16
| | | | | | | | | | | | | | | | Consistent with various workarounds in the backwards compatible modules that allow static functions in headers to exist, be deduplicated to some degree, and not generally fail right out of the gate... do the same with modular codegen as there are enough cases (including in libstdc++ and in LLVM itself - though I cleaned up the easy ones) that it's worth supporting as a migration/backcompat step. Simply create a separate, internal linkage function in each object that needs it. If an available_externally/modularized function references a static function, but the modularized function is eventually dropped and not inlined, the static function will be dropped as unreferenced. llvm-svn: 317274
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-021-28/+41
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317273
* PR33746: Store the 'inline'ness of a static data member with the update recordRichard Smith2017-11-022-0/+4
| | | | | | | | | for instantiating its definition. We model the 'inline'ness as being instantiated with the static data member in order to track whether the declaration has become a definition yet. llvm-svn: 317147
* [C++17] Fix PR34970 - tweak overload resolution for class template ↵Faisal Vali2017-10-222-0/+3
| | | | | | | | | | | | | | | | | | | deduction-guides in line with WG21's p0620r0. In order to identify the copy deduction candidate, I considered two approaches: - attempt to determine whether an implicit guide is a copy deduction candidate by checking certain properties of its subsituted parameter during overload-resolution. - using one of the many bits (WillHaveBody) from FunctionDecl (that CXXDeductionGuideDecl inherits from) that are otherwise irrelevant for deduction guides After some brittle gymnastics w the first strategy, I settled on the second, although to avoid confusion and to give that bit a better name, i turned it into a member of an anonymous union. Given this identification 'bit', the tweak to overload resolution was a simple reordering of the deduction guide checks (in SemaOverload.cpp::isBetterOverloadCandidate), in-line with Jason Merrill's p0620r0 drafting which made it into the working paper. Concordant with that, I made sure the copy deduction candidate is always added. References: See https://bugs.llvm.org/show_bug.cgi?id=34970 See http://wg21.link/p0620r0 llvm-svn: 316292
* Support for destroying operator delete, per C++2a proposal P0722.Richard Smith2017-10-133-3/+13
| | | | | | | | | | This feature is not (yet) approved by the C++ committee, so this is liable to be reverted or significantly modified based on committee feedback. No functionality change intended for existing code (a new type must be defined in namespace std to take advantage of this feature). llvm-svn: 315662
* Fix warnings. [-Wdocumentation]NAKAMURA Takumi2017-10-121-3/+5
| | | | llvm-svn: 315573
* Revert r314955: "Remove PendingBody mechanism for function and ObjC method ↵Daniel Jasper2017-10-113-75/+59
| | | | | | | | | | | deserialization." This is breaking a build of https://github.com/abseil/abseil-cpp and so likely not really NFC. Also reverted subsequent r314956/7. I'll forward reproduction instructions to Richard. llvm-svn: 315439
* Fix a (slightly weird) 'comma operator within array index expression' ↵Simon Pilgrim2017-10-101-1/+2
| | | | | | warning on VS builds. NFCI. llvm-svn: 315314
* PR33924: Merge block-scope anonymous declarations if there are multiple ↵Richard Smith2017-10-052-2/+3
| | | | | | definitions of the enclosing function. llvm-svn: 314956
* Remove PendingBody mechanism for function and ObjC method deserialization.Richard Smith2017-10-052-57/+72
| | | | | | | | | | | | In its place, track on the canonical function declaration whether there is a declaration with a body (and if so, which one). This brings function definition handling in line with what we do in all other contexts, and is necessary to allow us to merge declarations within multiple definitions of the same function (eg, PR33924). No functionality change intended. llvm-svn: 314955
* [OPENMP] Capture argument of `device` clause for target-basedAlexey Bataev2017-10-022-0/+2
| | | | | | | | | | directives. The argument of the `device` clause in target-based executable directives must be captured to support codegen for the `target` directives with the `depend` clauses. llvm-svn: 314686
* Dependent Address Space SupportAndrew Gozillon2017-10-022-0/+41
| | | | | | | | | | | | | | This patch relates to: https://reviews.llvm.org/D33666 This adds support for template parameters to be passed to the address_space attribute. The main goal is to add further flexibility to the attribute and allow for it to be used easily with templates. The main additions are a new type (DependentAddressSpaceType) alongside its TypeLoc and its mangling. As well as the logic required to support dependent address spaces which mainly resides in TreeTransform.h and SemaType.cpp. llvm-svn: 314649
* [ODRHash] Add base classes to hashing CXXRecordDecl.Richard Trieu2017-09-302-3/+124
| | | | llvm-svn: 314581
* Minor cleanups to address feedback from Bruno. NFCDouglas Gregor2017-09-141-1/+0
| | | | llvm-svn: 313318
* [Module map] Introduce a private module re-export directive.Douglas Gregor2017-09-142-1/+19
| | | | | | | | | | | | | Introduce a new "export_as" directive for top-level modules, which indicates that the current module is a "private" module whose symbols will eventually be exported through the named "public" module. This is in support of a common pattern in the Darwin ecosystem where a single public framework is constructed of several private frameworks, with (currently) header duplication and some support from the linker. Addresses rdar://problem/34438420. llvm-svn: 313316
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-082-0/+6
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-082-6/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-082-0/+6
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* [modules ts] Ensure that module linkage variables are always emitted and ↵Richard Smith2017-09-071-10/+10
| | | | | | always have their name mangled. llvm-svn: 312684
* [modules ts] Emit global variables in a module interface unit as part of ↵Richard Smith2017-09-063-6/+28
| | | | | | that unit, not in importers. llvm-svn: 312665
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-062-1/+4
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. llvm-svn: 312638
* Fix MSVC narrowing conversion warning.Simon Pilgrim2017-09-041-1/+1
| | | | llvm-svn: 312479
* Implement Itanium name mangling support for C++ Modules TS.Richard Smith2017-09-042-5/+5
| | | | | | | | | | | | This follows the scheme agreed with Nathan Sidwell, which can be found here: https://gcc.gnu.org/wiki/cxx-modules?action=AttachFile This will be proposed to the itanium-cxx-abi list once we have some experience with how well it works; the ABI for this TS should be considered unstable until it is part of the Itanium C++ ABI. llvm-svn: 312467
* [modules] Add ability to specify module name to module file mapping (reapply)Boris Kolpackov2017-08-314-11/+59
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
* Revert r312105 [modules] Add ability to specify module name to module file ↵Victor Leschuk2017-08-304-59/+11
| | | | | | | | mapping Looks like it breaks win10 builder. llvm-svn: 312112
* [modules] Add ability to specify module name to module file mappingBoris Kolpackov2017-08-304-11/+59
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312105
OpenPOWER on IntegriCloud