summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Make output of ast-print closer to C++ codeSerge Pavlov2016-10-311-4/+3
| | | | | | | Put semicolon after non-defining method declaration and a class specialization body. llvm-svn: 285543
* PR30831: Teach template type diffing to cope with TemplateSpecializationTypesRichard Smith2016-10-281-7/+10
| | | | | | that desugar to non-TSTs (such as injected-class-names). llvm-svn: 285437
* Fix implementation of the likely resolution of core issue 253 to support classRichard Smith2016-10-281-1/+1
| | | | | | | | based arrays. Patch by Ian Tessier! Differential Review: https://reviews.llvm.org/D25974 llvm-svn: 285430
* Relax assertion in ↵Justin Lebar2016-10-281-1/+1
| | | | | | | | | | FunctionDecl::doesDeclarationForceExternallyVisibleDefinition. Previously we were asserting that this declaration doesn't have a body *and* won't have a body after we continue parsing. This is too strong and breaks the go-bindings test during codegen. llvm-svn: 285412
* [CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on ↵Justin Lebar2016-10-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | functions without bodies. Summary: In CUDA compilation, we call isInlineDefinitionExternallyVisible (via getGVALinkageForFunction) on functions while parsing their definitions. At the point in time when we call getGVALinkageForFunction, we haven't yet added the body to the function, so we trip this assert. But as far as I can tell, this is harmless. To work around this, we add a new flag to FunctionDecl, "WillHaveBody". There was other code that was working around the existing assert with a really awful hack -- this change lets us get rid of that hack. Reviewers: rsmith, tra Subscribers: aemerson, cfe-commits Differential Revision: https://reviews.llvm.org/D25640 llvm-svn: 285410
* Refactor call emission to package the function pointer together withJohn McCall2016-10-261-5/+9
| | | | | | | | | | | abstract information about the callee. NFC. The goal here is to make it easier to recognize indirect calls and trigger additional logic in certain cases. That logic will come in a later patch; in the meantime, I felt that this was a significant improvement to the code. llvm-svn: 285258
* Fix use-after-scope in ASTContext.Benjamin Kramer2016-10-261-1/+1
| | | | | | | | | | | | Extend lifetime of ExceptionTypeStorage, as it is referenced by CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an ArrayRef) Patch by Sam McCall! Differential Revision: https://reviews.llvm.org/D25983 llvm-svn: 285192
* Implement name mangling proposal for exception specifications from ↵Richard Smith2016-10-263-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cxx-abi-dev 2016-10-11. This has the following ABI impact: 1) Functions whose parameter or return types are non-throwing function pointer types have different manglings in c++1z mode from prior modes. This is necessary because c++1z permits overloading on the noexceptness of function pointer parameter types. A warning is issued for cases that will change manglings in c++1z mode. 2) Functions whose parameter or return types contain instantiation-dependent exception specifications change manglings in all modes. This is necessary to support overloading on / SFINAE in these exception specifications, which a careful reading of the standard indicates has essentially always been permitted. Note that, in order to be affected by these changes, the code in question must specify an exception specification on a function pointer/reference type that is written syntactically within the declaration of another function. Such declarations are very rare, and I have so far been unable to find any code that would be affected by this. (Note that such things will probably become more common in C++17, since it's a lot easier to get a noexcept function type as a function parameter / return type there.) This change does not affect the set of symbols produced by a build of clang, libc++, or libc++abi. llvm-svn: 285150
* Re-apply patch r279045.Kelvin Li2016-10-253-0/+64
| | | | llvm-svn: 285066
* Fix 'unknown documentation command' warning rangesErik Verbruggen2016-10-251-4/+6
| | | | | | | | | Warnings generated by -Wdocumentation-unknown-command did only have a start location, not a full source range. This resulted in only the "carret" being show in messages, and IDEs highlighting only the single initial character. llvm-svn: 285056
* Fix bug where one of the cases where we mangle a <bare-unresolved-name> failedRichard Smith2016-10-241-25/+31
| | | | | | | | to emit the <template-args> portion. Refactor so that mangleUnresolvedName actually emits the entire <unresolved-name>, so this mistake is harder to make again. llvm-svn: 285022
* 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
OpenPOWER on IntegriCloud