summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix mangling of implicit calls to operator-> to only include a single "pt",Richard Smith2016-10-241-1/+4
| | | | | | rather than including an extra one for each level of 'operator->()' invoked. llvm-svn: 285015
* Fix crash if StmtProfile finds a type-dependent member access for which we haveRichard Smith2016-10-241-0/+6
| | | | | | | | | | | resolved the -> to a call to a specific operator-> function. The particular test case added here is actually being mishandled: the implicit member access should not be type-dependent (because it's accessing a non-type-dependent member of the current instantiation), but calls to a type-dependent operator-> that is a member of the current instantiation would be liable to hit the same codepath. llvm-svn: 284999
* Fix mangling numbers for varargs lambdas; varargs and non-varargs lambdas getRichard Smith2016-10-231-2/+3
| | | | | | different lambda-sigs, so they should have different counters. llvm-svn: 284933
* Remove move constructors that are identical to the generated default move ctor.Benjamin Kramer2016-10-211-3/+1
| | | | llvm-svn: 284856
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-2016-181/+164
| | | | | | No functionality change intended. llvm-svn: 284730
* PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.Richard Smith2016-10-201-0/+16
| | | | llvm-svn: 284684
* [c++1z] Fix corner case where we could create a function type whose ↵Richard Smith2016-10-181-8/+12
| | | | | | canonical type is not actually canonical. llvm-svn: 284528
* When two function types have equivalent (but distinct) noexcept ↵Richard Smith2016-10-181-24/+61
| | | | | | specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression. llvm-svn: 284519
* [c++1z] Include "noexcept" in builtin function types where appropriate. FixesRichard Smith2016-10-181-0/+3
| | | | | | | an assertion failure looking up a matching ::operator delete for __builtin_operator_delete. llvm-svn: 284458
* [c++1z] Use canonical expression equivalence to determine whether two differentRichard Smith2016-10-182-14/+14
| | | | | | | | | dependent noexcept specifications result in the same canonical function type. We still use non-canonical hashing when deduplicating type sugar so that diagnostics will point to the right place. llvm-svn: 284457
* Revert "Reinstate r281429, reverted in r281452, with a fix for its ↵Benjamin Kramer2016-10-171-60/+4
| | | | | | | | | mishandling of" This reverts commit r284176. It still marks some modules as invisible that should be visible. Will follow up with the author with a test case. llvm-svn: 284382
* AST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULTJustin Bogner2016-10-171-1/+1
| | | | llvm-svn: 284366
* AST: Improve a couple of comments and cast unused values to voidJustin Bogner2016-10-161-5/+4
| | | | | | | | Make these comments a bit more explicit that they're initializing the RawText member, and explicitly cast the unused result of getRawText to void for clarity. llvm-svn: 284341
* P0012R1: Make exception specifications be part of the type system. ThisRichard Smith2016-10-162-15/+98
| | | | | | | implements the bulk of the change (modifying the type system to include exception specifications), but not all the details just yet. llvm-svn: 284337
* Reinstate r284008 reverted in r284081, with two fixes:Richard Smith2016-10-141-0/+53
| | | | | | | | | | | | | | | | | | | 1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach the second case if it's the addition of the initializer itself that converts an existing declaration into a definition). 2) When rebuilding a redeclaration chain for a variable, if we merge two definitions together, mark the definitions as merged so the retained definition is made visible whenever the demoted definition would have been. Original commit message (from r283882): [modules] PR28752: Do not instantiate variable declarations which are not visible. Original patch by Vassil Vassilev! Changes listed above are mine. llvm-svn: 284284
* Fix bogus assert breaking modules self-host.Richard Smith2016-10-141-4/+6
| | | | llvm-svn: 284187
* Reinstate r281429, reverted in r281452, with a fix for its mishandling ofRichard Smith2016-10-131-4/+58
| | | | | | | | | compiles without -fmodules-local-submodule-visibility. Original commit message: [modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition. llvm-svn: 284176
* Add and use isDiscardableGVALinkage function.Justin Lebar2016-10-131-9/+2
| | | | | | | | | | Reviewers: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25571 llvm-svn: 284159
* [CUDA] Emit deferred diagnostics during Sema rather than during codegen.Justin Lebar2016-10-131-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Emitting deferred diagnostics during codegen was a hack. It did work, but usability was poor, both for us as compiler devs and for users. We don't codegen if there are any sema errors, so for users this meant that they wouldn't see deferred errors if there were any non-deferred errors. For devs, this meant that we had to carefully split up our tests so that when we tested deferred errors, we didn't emit any non-deferred errors. This change moves checking for deferred errors into Sema. See the big comment in SemaCUDA.cpp for an overview of the idea. This checking adds overhead to compilation, because we have to maintain a partial call graph. As a result, this change makes deferred errors a CUDA-only concept (whereas before they were a general concept). If anyone else wants to use this framework for something other than CUDA, we can generalize at that time. This patch makes the minimal set of test changes -- after this lands, I'll go back through and do a cleanup of the tests that we no longer have to split up. Reviewers: rnk Subscribers: cfe-commits, rsmith, tra Differential Revision: https://reviews.llvm.org/D25541 llvm-svn: 284158
* Revert r284008. This is us to fail to instantiate static data members in someRichard Smith2016-10-121-53/+0
| | | | | | cases. I'm working on reducing a testcase. llvm-svn: 284081
* Reinstate r283887 and r283882.Vassil Vassilev2016-10-121-0/+53
| | | | | | | | | | | Original message: "[modules] PR28752: Do not instantiate variable declarations which are not visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith!" llvm-svn: 284008
* Revert r283887 and r283882, until the issue is understood and fixed.Vassil Vassilev2016-10-111-53/+0
| | | | llvm-svn: 283890
* [modules] PR28752: Do not instantiate variable declarations which are not ↵Vassil Vassilev2016-10-111-0/+53
| | | | | | | | | | visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith! llvm-svn: 283882
* [AST] Don't use make_pointee_iterator in VTableBuilder.Justin Lebar2016-10-101-3/+4
| | | | | | | Our implementation of make_pointee_iterator seems to be causing MSVC 2015 to crash, so I'm going to remove it. llvm-svn: 283790
* Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use ofRichard Smith2016-10-106-19/+94
| | | | | | | | | | | past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. llvm-svn: 283789
* Use unique_ptr for VTableBuilder::VBaseInfo map.Justin Lebar2016-10-101-15/+14
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25424 llvm-svn: 283772
* Use unique_ptr for VTableBuilder::VFTableLayouts map.Justin Lebar2016-10-101-2/+1
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25423 llvm-svn: 283771
* Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.Justin Lebar2016-10-101-29/+32
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25422 llvm-svn: 283770
* [AST] Use unique_ptr for VTableLayout.Justin Lebar2016-10-101-12/+10
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25421 llvm-svn: 283769
* [AST] Convert MangleNumberingContext to a unique_ptr.Justin Lebar2016-10-104-9/+11
| | | | | | | | | | | | Summary: It doesn't need to be refcounted anymore, either. Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25420 llvm-svn: 283768
* Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned ↵Daniel Jasper2016-10-106-94/+19
| | | | | | | | | | | | allocation." This reverts commit r283722. Breaks: Clang.SemaCUDA.device-var-init.cu Clang.CodeGenCUDA.device-var-init.cu http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/ llvm-svn: 283750
* P0035R4: Semantic analysis and code generation for C++17 overalignedRichard Smith2016-10-106-19/+94
| | | | | | allocation. llvm-svn: 283722
* Un-tabify source files, NFC.Yaron Keren2016-10-084-8/+7
| | | | llvm-svn: 283657
* Fix PR30440: Initialize FunctionTypeDepth in CXXNameManglerAlex Lorenz2016-10-061-4/+4
| | | | | | | | | | | | This commit fixes PR 30440 by initializing CXXNameMangler's FunctionTypeDepth in the two constructors added in r274222 (The commit that caused this regression). rdar://28455269 Differential Revision: https://reviews.llvm.org/D24932 llvm-svn: 283428
* ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.Manman Ren2016-10-031-3/+7
| | | | | | | | | | | | | | | The deserialization of redeclartion can cause seg fault since getCanonicalDecl of the redeclaration returns the lookup result on the ObjCContainerDecl, which can be null if FindExternalVisibleDeclsByName is not done updating the lookup results. The fix is to return the redeclaration itself as the canonical decl. Note that the handling for redeclaration of ObjCMethodDecl is not in line with other redeclarables. rdar://28488466 llvm-svn: 283145
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-031-0/+11
| | | | | | | | | | | | | declarations. This commit ensures that the correct record type is printed out for the using declarations that represent C++ inherited constructors. It fixes a regression introduced in r274049 which changed the name that's stored in the using declarations that correspond to inherited constructors. Differential Revision: https://reviews.llvm.org/D25131 llvm-svn: 283105
* Revert r283102 (Typo in the phabricator link)Alex Lorenz2016-10-031-11/+0
| | | | llvm-svn: 283104
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-031-0/+11
| | | | | | | | | | | | | declarations. This commit ensures that the correct record type is printed out for the using declarations that represent C++ inherited constructors. It fixes a regression introduced in r274049 which changed the name that's stored in the using declarations that correspond to inherited constructors. Differential Revision: https://reviews.llvm.org/D25131 llvm-svn: 283102
* P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.Richard Smith2016-09-291-1/+1
| | | | llvm-svn: 282800
* [Coroutines] Add proper mangling for operator co_await for MicrosoftABIGor Nishanov2016-09-281-8/+2
| | | | | | | | | | Reviewers: rnk, rsmith Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25045 llvm-svn: 282645
* [ASTImporter] Implement some expression-related AST node import (part 2)Aleksei Sidorin2016-09-281-43/+597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Some code cleanup * Add tests not present in http://reviews.llvm.org/D14286 * Integrate a test suite from Serge Pavlov (http://reviews.llvm.org/D14224) * ArrayTypeTraitExpr: serialize sub-expression to avoid keeping it undefined * Implement import of some nodes: - ArrayTypeTraitExpr - ExpressionTraitExpr - OpaqueValueExpr - ArraySubscriptExpr - ExplicitCastExpr - ImplicitValueInitExpr - OffsetOfExpr - CXXThisExpr - CXXThrowExpr - CXXNoexceptExpr - CXXDefaultArgExpr - CXXScalarValueInitExpr - CXXBindTemporaryExpr - CXXTemporaryObjectExpr - MaterializeTemporaryExpr - ExprWithCleanups - StaticAssertDecl - FriendDecl - DecayedType Differential Revision: https://reviews.llvm.org/D14326 llvm-svn: 282572
* [Modules TS] Diagnose 'export' declaration within 'export' declaration.Richard Smith2016-09-261-0/+16
| | | | llvm-svn: 282443
* PR30401: Fix substitutions for functions with abi_tagDmitry Polukhin2016-09-211-2/+18
| | | | llvm-svn: 282059
* [cleanup] Remove excessive padding from TextTokenRetokenizer::PositionAlexander Shaposhnikov2016-09-201-1/+1
| | | | | | | | | Reorder the fields of the struct TextTokenRetokenizer::Position to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24751 llvm-svn: 281995
* Reorder initializers in CallStackFrame so that we don't get a warning.Samuel Antao2016-09-191-2/+2
| | | | llvm-svn: 281923
* Remove excessive padding from the struct CallStackFrameAlexander Shaposhnikov2016-09-191-6/+6
| | | | | | | | | | | The struct CallStackFrame is in lib/AST/ExprConstant.cpp inside anonymous namespace. This diff reorders the fields and removes excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D23901 llvm-svn: 281907
* Revert "[modules] When merging one definition into another, propagate the ↵Eric Liu2016-09-141-59/+4
| | | | | | | | list of re-exporting modules from the discarded definition to the retained definition." This reverts commit r281429. llvm-svn: 281452
* [modules] When merging one definition into another, propagate the list ofRichard Smith2016-09-141-4/+59
| | | | | | re-exporting modules from the discarded definition to the retained definition. llvm-svn: 281429
* ObjectiveC Generics: Start using ObjCTypeParamType.Manman Ren2016-09-133-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | For ObjC type parameter, we used to have TypedefType that is canonicalized to id or the bound type. We can't represent "T <protocol>" and thus will lose the type information in the following example: @interface MyMutableDictionary<KeyType, ObjectType> : NSObject - (void)setObject:(ObjectType)obj forKeyedSubscript:(KeyType <NSCopying>)key; @end MyMutableDictionary<NSString *, NSString *> *stringsByString; NSNumber *n1, *n2; stringsByString[n1] = n2; --> no warning on type mismatch of the key. To fix the problem, we introduce a new type ObjCTypeParamType that supports a list of protocol qualifiers. We create ObjCTypeParamType for ObjCTypeParamDecl when we create ObjCTypeParamDecl. We also substitute ObjCTypeParamType instead of TypedefType on an ObjCTypeParamDecl. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23080 llvm-svn: 281358
* ObjectiveC generics: Add ObjCTypeParamType in the type system.Manman Ren2016-09-136-0/+117
| | | | | | | | | | | | | | | | | We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the representation of "T <protocol>" where T is a type parameter. Before this, we use TypedefType to represent the type parameter for ObjC. ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized to the underlying type with the protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23079 llvm-svn: 281355
OpenPOWER on IntegriCloud