summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* [MS] Don't statically initialize dllimport member function pointersReid Kleckner2017-06-231-0/+16
| | | | | | | | | | | | We were already applying the same rules to dllimport function pointers. David Majnemer added that logic back in r211677 to fix PR20130. We failed to extend that logic to non-virtual member function pointers, which are basically function pointers in a struct with some extra offsets. Fixes PR33570. llvm-svn: 306137
* PR33552: Distinguish between declarations that are owned by no module andRichard Smith2017-06-232-4/+4
| | | | | | | | | | | | | | | | | | | declarations that are owned but unconditionally visible. This allows us to set declarations as visible even if they have a local owning module, without losing information. In turn, that means that our Objective-C support can keep on incorrectly assuming the "hidden" bit on the declaration is the whole story with regard to name visibility. This will also be useful once we support the C++ Modules TS export semantics. Objective-C name visibility is still incorrect in any case where the "hidden" bit is not the complete story: for instance, in Objective-C++ the set of visible categories will be wrong during template instantiation, and with local submodule visibility enabled it will be wrong when building modules. Fixing that will require a major overhaul of how visibility is handled for Objective-C (and particularly for categories). llvm-svn: 306075
* Support MS builtins using 'long' on LP64 platformsBruno Cardoso Lopes2017-06-211-1/+13
| | | | | | | | | | | | | | | This allows for -fms-extensions to work the same on LP64. For example, _BitScanReverse is expected to be 32-bit, matching Windows/LLP64, even though long is 64-bit on x86_64 Darwin or Linux (LP64). Implement this by adding a new character code 'N', which is 'int' if the target is LP64 and the same 'L' otherwise Differential Revision: https://reviews.llvm.org/D34377 rdar://problem/32599746 llvm-svn: 305875
* Special-case handling of destructors in override lists when dumping ASTs.Lang Hames2017-06-201-3/+6
| | | | | | | Fixes a bug in r305850: CXXDestructors don't have names, so we need to handle printing of them separately. llvm-svn: 305860
* Preserve CXX method overrides in ASTImporterLang Hames2017-06-202-0/+36
| | | | | | | | | | | | | | Summary: The ASTImporter should import CXX method overrides from the source context when it imports a method decl. Reviewers: spyffe, rsmith, doug.gregor Reviewed By: spyffe Differential Revision: https://reviews.llvm.org/D34371 llvm-svn: 305850
* D31187: Fix removal of out-of-line definitions.Vassil Vassilev2017-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | Consider: struct MyClass { void f() {} } MyClass::f(){} // expected error redefinition of f. #1 Some clients (eg. cling) need to call removeDecl for the redefined (#1) decl. This patch enables us to remove the lookup entry is registered in the semantic decl context and not in the primary decl context of the lexical decl context where we currently are trying to remove it from. It is not trivial to test this piece and writing a full-blown unit test seems too much. llvm-svn: 305799
* Call setMustBuildLookupTable on TagDecls in ExternalASTMergerLang Hames2017-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: setMustBuildLookupTable should be called on imported TagDecls otherwise we may fail to import their member decls (if they have any). Not calling the setMustBuildLookupTable method results in a failure in the attached test case when lookup for the 'x' member fails on struct S, which hasn't had its decls imported elsewhere. (By contrast the member-in-struct testcase hasn't run into this issue because the import of its decls is triggered when the struct instance is defined, and the member access follows this). Reviewers: spyffe, rsmith Reviewed By: spyffe, rsmith Differential Revision: https://reviews.llvm.org/D34253 llvm-svn: 305619
* [ODRHash] Hash VarDecl members.Richard Trieu2017-06-161-0/+12
| | | | | | | These VarDecl's are static data members of classes. Since the initializers are also hashed, this also provides checking for default arguments to methods. llvm-svn: 305543
* [coroutines] Allow co_await and co_yield expressions that return an lvalue ↵Eric Fiselier2017-06-151-2/+2
| | | | | | | | | | | | | | | | | | to compile Summary: The title says it all. Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Subscribers: rjmccall, cfe-commits Differential Revision: https://reviews.llvm.org/D34194 llvm-svn: 305496
* [ODRHash] Hash TemplateArgument::Pack and TemplateTypeParmTypeRichard Trieu2017-06-151-0/+11
| | | | llvm-svn: 305440
* AST: Add missing break at end of switchDuncan P. N. Exon Smith2017-06-141-0/+1
| | | | llvm-svn: 305418
* Fix for Itanium mangler issue with templatesDmitry Polukhin2017-06-141-0/+2
| | | | | | | | Patch by Serge Preis Differential Revision: https://reviews.llvm.org/D32428 llvm-svn: 305377
* [ODRHash] Remove debugging code from r305361Richard Trieu2017-06-141-1/+0
| | | | llvm-svn: 305362
* [ODRHash] Hash Template and TemplateExpansion in TemplateArgument.Richard Trieu2017-06-141-0/+3
| | | | llvm-svn: 305361
* [ODRHash] Hash Expr for TemplateArgument::ExpressionRichard Trieu2017-06-141-0/+16
| | | | llvm-svn: 305360
* [ODRHash] Add TemplateArgument kind to hash.Richard Trieu2017-06-131-1/+5
| | | | llvm-svn: 305328
* Revert "Revert r301742 which made ExprConstant checking apply to all ↵Diana Picus2017-06-131-4/+9
| | | | | | | | | full-exprs." This reverts commit r305239 because it broke the buildbots (the diag-flags.cpp test is failing). llvm-svn: 305287
* Revert r301742 which made ExprConstant checking apply to all full-exprs.Nick Lewycky2017-06-121-9/+4
| | | | | | This patch also exposed pre-existing bugs in clang, see PR32864 and PR33140#c3 . llvm-svn: 305239
* Revert r303316, a change to ExprConstant to evaluate function arguments.Nick Lewycky2017-06-121-28/+5
| | | | | | The patch was itself correct but it uncovered other bugs which are going to be difficult to fix, per PR33140. llvm-svn: 305233
* [Sema] Use the right FoldingSet.George Burgess IV2017-06-121-1/+1
| | | | | | | | | | | | | | We were doing FindNodeOrInsertPos on SubstTemplateTypeParmPackTypes, so we should presumably be inserting into SubstTemplateTypeParmPackTypes. Looks like the FoldingSet API can be tweaked a bit so that we can catch things like this at compile-time. I'll look into that shortly. I'm unsure of how to test this; suggestions welcome. Thanks to Vladimir Voskresensky for bringing this up! llvm-svn: 305207
* Revert r305110 to fix buildbotRichard Trieu2017-06-091-19/+1
| | | | llvm-svn: 305130
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-091-1/+19
| | | | | | | Recommit r304592 that was reverted in r304618. r305104 should have fixed the issue. llvm-svn: 305110
* [ODRHash] Skip inline namespaces when hashing.Richard Trieu2017-06-092-13/+19
| | | | | | | Speculatively try to fix the underlying issue from r304592, of underlying types being confused when inline namespaces are used. llvm-svn: 305104
* [DebugInfo] Add kind of ImplicitParamDecl for emission of FlagObjectPointer.Alexey Bataev2017-06-093-18/+21
| | | | | | | | | | | | | | | | | Summary: If the first parameter of the function is the ImplicitParamDecl, codegen automatically marks it as an implicit argument with `this` or `self` pointer. Added internal kind of the ImplicitParamDecl to separate 'this', 'self', 'vtt' and other implicit parameters from other kind of parameters. Reviewers: rjmccall, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33735 llvm-svn: 305075
* Update libdeps to add BinaryFormat, introduced in r304864.NAKAMURA Takumi2017-06-071-0/+1
| | | | llvm-svn: 304869
* Reorder and reformat.NAKAMURA Takumi2017-06-071-1/+3
| | | | llvm-svn: 304868
* [clang] Remove double semicolons. NFC.Mandeep Singh Grang2017-06-061-1/+1
| | | | | | | | | | | | | | Reviewers: rsmith, craig.topper, efriedma Reviewed By: efriedma Subscribers: efriedma, cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D33926 llvm-svn: 304823
* [OpenCL] Fix pipe size in TypeInfo.Anastasia Stulova2017-06-051-3/+2
| | | | | | | | | | | Pipes are now the size of pointers rather than the size of the type that they contain. Patch by Simon Perretta! Differential Revision: https://reviews.llvm.org/D33597 llvm-svn: 304708
* Implement isDefined by call to isThisDeclarationADefinition.Serge Pavlov2017-06-041-3/+2
| | | | | | | | | | Modifies FunctionDecl::isThisDeclarationADefinition so that it covers all the cases checked by FunctionDecl::isDefined. Implements the latter method by call to isThisDeclarationADefinition. This change is a part of the patch D30170. llvm-svn: 304684
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-037-0/+11
| | | | llvm-svn: 304650
* Revert r304592Richard Trieu2017-06-031-19/+1
| | | | | | | r304592 - [ODRHash] Add support for TemplateArgument types. Possibly causing one of the errors in modules build bot. llvm-svn: 304618
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-021-1/+19
| | | | llvm-svn: 304592
* ASTPrinter: Objective-C method declarations don't need a space afterAlex Lorenz2017-06-021-2/+4
| | | | | | | | the return type rdar://32332039 llvm-svn: 304553
* Mangle __unaligned in Itanium ABIRoger Ferrer Ibanez2017-06-021-6/+16
| | | | | | | | | | | | | | | | | | | __unaligned is not currently mangled in any way in the Itanium ABI. This causes failures when using -fms-extensions and C++ in targets using Itanium ABI. As suggested by @rsmith the simplest thing to do here is actually mangle the qualifier as a vendor extension. This patch also removes the change done in D31976 and updates its test to the new reality. This fixes https://bugs.llvm.org/show_bug.cgi?id=33080 https://bugs.llvm.org/show_bug.cgi?id=33178 Differential Revision: https://reviews.llvm.org/D33398 llvm-svn: 304523
* [ODRHash] Support TemplateSpecializationTypeRichard Trieu2017-05-311-1/+27
| | | | llvm-svn: 304261
* Make helper functions static. NFC.Benjamin Kramer2017-05-261-2/+2
| | | | llvm-svn: 304028
* Update MS mangling EBNF, NFCReid Kleckner2017-05-261-0/+2
| | | | llvm-svn: 304006
* Create valid LValue to represent null pointers in constant exprsTim Northover2017-05-261-6/+14
| | | | | | | | | | | | We were leaving the SubobjectDesignator in a surprising situation, where it was allegedly valid but didn't actually refer to a type. This caused a crash later on. This patch fills out the SubobjectDesignator with the pointee type (as happens in other evaluations of constant pointers) so that we don't crash later. llvm-svn: 303957
* [modules] When reparenting a local declaration, don't mark the declaration asRichard Smith2017-05-231-3/+11
| | | | | | | | | | | being visible with its owning module if we're not tracking owning modules for local declarations. This avoids the possibility of a declaration being (meaninglessly) marked as hidden with no owning module, which would otherwise lead to violated AST invariants (checked by the added assertion). llvm-svn: 303699
* [coroutines] Build GRO declaration and return GRO statementGor Nishanov2017-05-221-1/+3
| | | | | | | | | | | | | | | | | | Summary: 1. build declaration of the gro local variable that keeps the result of get_return_object. 2. build return statement returning the gro variable 3. emit them during CodeGen 4. sema and CodeGen tests updated Reviewers: EricWF, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31646 llvm-svn: 303573
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-201-0/+21
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
* [ODRHash] Revert r303450 to fix buildbotRichard Trieu2017-05-191-90/+2
| | | | | | | r303450 [ODRHash] Support TemplateName and TemplateArgument llvm-svn: 303459
* Do not issue -Wnullability-completeness for dependent types that are not ↵Richard Smith2017-05-191-9/+7
| | | | | | written as pointer types. llvm-svn: 303451
* [ODRHash] Support TemplateName and TemplateArgumentRichard Trieu2017-05-191-2/+90
| | | | llvm-svn: 303450
* CodeGen: Cast alloca to expected address spaceYaxun Liu2017-05-182-11/+6
| | | | | | | | | | | Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 llvm-svn: 303370
* [index] Avoid one more crash caused by infinite recursion that happens whenAlex Lorenz2017-05-181-2/+10
| | | | | | | | | | looking up a dependent name in a record that derives from itself rdar://32273000 Differential Revision: https://reviews.llvm.org/D33324 llvm-svn: 303366
* The constant expression evaluator should examine function arguments for ↵Nick Lewycky2017-05-171-5/+28
| | | | | | non-constexpr function calls unless the EvalInfo says to stop. llvm-svn: 303317
* [ODRHash] Support NestedNameSpecifierRichard Trieu2017-05-171-1/+29
| | | | llvm-svn: 303233
* [ODRHash] Support more types in the ODR checker.Richard Trieu2017-05-171-0/+50
| | | | | | Added support for TagType, TypeWithKeyword, and all children types. llvm-svn: 303231
* [modules] When creating a declaration, cache its owning module immediatelyRichard Smith2017-05-173-9/+11
| | | | | | | | | | | | | | | rather than waiting until it's queried. Currently this is only applied to local submodule visibility mode, as we don't yet allocate storage for the owning module in non-local-visibility modules compilations. This reinstates r302965, reverted in r303037, with a fix for the reported crash, which occurred when reparenting a local declaration to be a child of a hidden imported declaration (specifically during template instantiation). llvm-svn: 303224
OpenPOWER on IntegriCloud