summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[AST] Introduce GenericSelectionExpr::Association"Bruno Ricci2019-01-283-12/+11
| | | | | | This breaks GCC 4.8.4. Reported by email by Hans Wennborg. llvm-svn: 352403
* [clang][OpenMP] OMPFlushClause is synthetic, no such clause existsRoman Lebedev2019-01-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://reviews.llvm.org/D57112#inline-506781, 'flush' clause does not exist in the OpenMP spec, it can not be specified, and `OMPFlushClause` class is just a helper class. Therefore `OPENMP_CLAUSE()` in `clang/Basic/OpenMPKinds.def` should not contain 'flush' "clause". I have simply removed the `OPENMP_CLAUSE(flush, OMPFlushClause)` from `clang/Basic/OpenMPKinds.def`, grepped for `OPENMP_CLAUSE` and added `OPENMP_CLAUSE(flush, OMPFlushClause)` back to the **every** place where `OPENMP_CLAUSE` is defined and `clang/Basic/OpenMPKinds.def` is then included. So as-is, this patch is a NFC. Possibly, some of these `OPENMP_CLAUSE(flush, OMPFlushClause)` should be dropped, i don't really know. Test plan: `ninja check-clang` Reviewers: ABataev Reviewed By: ABataev Subscribers: guansong, arphaman, cfe-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D57280 llvm-svn: 352390
* [AST] Introduce GenericSelectionExpr::AssociationBruno Ricci2019-01-283-11/+12
| | | | | | | | | | | | | | | | | Introduce a new class GenericSelectionExpr::Association which bundle together an association expression and its TypeSourceInfo. An iterator GenericSelectionExpr::AssociationIterator is additionally added to make it possible to iterate over ranges of Associations. This iterator is a kind of proxy iterator which abstract over how exactly the expressions and the TypeSourceInfos are stored. Differential Revision: https://reviews.llvm.org/D57106 Reviewed By: aaron.ballman Reviewers: aaron.ballman, steveire, dblaikie, mclow.lists llvm-svn: 352369
* Rename getTypeQualifiers to getMethodQualifiers.Anastasia Stulova2019-01-287-10/+10
| | | | | | | | Use more descriptive name for the method qualifiers getter. Differential Revision: https://reviews.llvm.org/D56792 llvm-svn: 352349
* [AST] Pack GenericSelectionExprBruno Ricci2019-01-261-13/+53
| | | | | | | | | | | | | | | | Store the controlling expression, the association expressions and the corresponding TypeSourceInfos as trailing objects. Additionally use the bit-fields of Stmt to store one SourceLocation, saving one additional pointer. This saves 3 pointers in total per GenericSelectionExpr. Differential Revision: https://reviews.llvm.org/D57104 Reviewed By: aaron.ballman Reviewers: aaron.ballman, steveire llvm-svn: 352276
* [AST][NFC] Various cleanups to GenericSelectionExprBruno Ricci2019-01-261-47/+47
| | | | | | | | | | | | | | | | | | Various cleanups to GenericSelectionExpr factored out of D57104. In particular: 1. Move the friend declaration to the top. 2. Introduce a constant ResultDependentIndex instead of the magic "-1". 3. clang-format 4. Group the member function together so that they can be removed as one block by D57106. NFC. Differential Revision: https://reviews.llvm.org/D57238 Reviewed By: aaron.ballman llvm-svn: 352275
* Fix "control reaches end of non-void function" warning. NFCI.Simon Pilgrim2019-01-251-0/+1
| | | | llvm-svn: 352192
* [AST] Add a method to get a call type from an ObjCMessageExprGeorge Karpenkov2019-01-251-0/+25
| | | | | | | | | | | | Due to references, expression type does not always correspond to an expected method return type (e.g. for a method returning int & the expression type of the call would still be int). We have a helper method for getting the expected type on CallExpr, but not on ObjCMessageExpr. Differential Revision: https://reviews.llvm.org/D57204 llvm-svn: 352147
* [ASTImporter] Fix inequality of functions with different attributesGabor Marton2019-01-241-1/+28
| | | | | | | | | | | | | | | | Summary: FunctionType::ExtInfo holds such properties of a function which are needed mostly for code gen. We should not compare these bits when checking for structural equivalency. Checking ExtInfo caused false ODR errors during CTU analysis (of tmux). Reviewers: a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53699 llvm-svn: 352050
* [Sema] Fix Modified Type in address_space AttributedTypeLeonard Chan2019-01-242-2/+12
| | | | | | | | | | | This is a fix for https://reviews.llvm.org/D51229 where we pass the address_space qualified type as the modified type of an AttributedType. This change now instead wraps the AttributedType with either the address_space qualifier or a DependentAddressSpaceType. Differential Revision: https://reviews.llvm.org/D55447 llvm-svn: 351997
* [ASTImporter] Fix importing OperatorDelete from CXXConstructorDeclRaphael Isemann2019-01-221-1/+17
| | | | | | | | | | | | | | | | | Summary: Shafik found out that importing a CXXConstructorDecl will create a translation unit that causes Clang's CodeGen to crash. The reason for that is that we don't copy the OperatorDelete from the CXXConstructorDecl when importing. This patch fixes it and adds a test case for that. Reviewers: shafik, martong, a_sidorin, a.sidorin Reviewed By: martong, a_sidorin Subscribers: rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D56651 llvm-svn: 351849
* Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>Serge Guelton2019-01-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for isPodLike<std::pair<...>> did not match the expectation of std::is_trivially_copyable which makes the memcpy optimization invalid. This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable. Unfortunately std::is_trivially_copyable is not portable across compiler / STL versions. So a portable version is provided too. Note that the following specialization were invalid: std::pair<T0, T1> llvm::Optional<T> Tests have been added to assert that former specialization are respected by the standard usage of llvm::is_trivially_copyable, and that when a decent version of std::is_trivially_copyable is available, llvm::is_trivially_copyable is compared to std::is_trivially_copyable. As of this patch, llvm::Optional is no longer considered trivially copyable, even if T is. This is to be fixed in a later patch, as it has impact on a long-running bug (see r347004) Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296. Differential Revision: https://reviews.llvm.org/D54472 llvm-svn: 351701
* [ASTDump] NFC: Convert iterative loops to cxx_range_forStephen Kelly2019-01-191-24/+14
| | | | | | | This is coming up a lot in reviews. Better just to change them all at once. llvm-svn: 351647
* [ASTDump] NFC: Use `const auto` in cxx_range_for loopsStephen Kelly2019-01-191-15/+15
| | | | | | This is coming up a lot in reviews. Better just to do them all at once. llvm-svn: 351646
* Move decl context dumping to TextNodeDumperStephen Kelly2019-01-192-7/+11
| | | | | | | | | | | | Summary: Only an obscure case is moved. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56829 llvm-svn: 351637
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1973-294/+219
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Emit !callback metadata and introduce the callback attributeJohannes Doerfert2019-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | With commit r351627, LLVM gained the ability to apply (existing) IPO optimizations on indirections through callbacks, or transitive calls. The general idea is that we use an abstraction to hide the middle man and represent the callback call in the context of the initial caller. It is described in more detail in the commit message of the LLVM patch r351627, the llvm::AbstractCallSite class description, and the language reference section on callback-metadata. This commit enables clang to emit !callback metadata that is understood by LLVM. It does so in three different cases: 1) For known broker functions declarations that are directly generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel. 2) For known broker functions that are identified by their name and source location through the builtin detection, e.g., pthread_create from the POSIX thread API. 3) For user annotated functions that carry the "callback(callee, ...)" attribute. The attribute has to include the name, or index, of the callback callee and how the passed arguments can be identified (as many as the callback callee has). See the callback attribute documentation for detailed information. Differential Revision: https://reviews.llvm.org/D55483 llvm-svn: 351629
* [ASTDump] NFC: Move variable into if() statementStephen Kelly2019-01-181-2/+1
| | | | llvm-svn: 351605
* [ASTDump] NFC: Remove redundant conditionStephen Kelly2019-01-181-4/+1
| | | | | | | | | | | These conditions are duplicated from the dumpDeclContext function called within the if(). This is presumably an attempt to avoid calling the function in the case it will do nothing. That may have made sense in the past if the code was different, but it doesn't make sense now. llvm-svn: 351604
* [ASTDump] NFC: Remove non-needed bracesStephen Kelly2019-01-181-3/+2
| | | | llvm-svn: 351603
* [ASTDump] Mark null params with a tag rather than a child nodeStephen Kelly2019-01-181-4/+9
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56753 llvm-svn: 351601
* [ASTDump] Mark BlockDecls which capture this with a tagStephen Kelly2019-01-181-3/+3
| | | | | | | | | | | | | | Summary: Removal of the child node makes it easier to separate traversal from output generation. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56752 llvm-svn: 351600
* [ASTDump] Mark variadic declarations with a tag instead of child nodeStephen Kelly2019-01-182-8/+8
| | | | | | | | | | | | | | Summary: This makes it easier to separate traversal of the AST from output generation. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56751 llvm-svn: 351597
* [Fixed Point Arithmetic] Fixed Point Addition Constant Expression EvaluationLeonard Chan2019-01-181-49/+148
| | | | | | | | This patch includes logic for constant expression evaluation of fixed point additions. Differential Revision: https://reviews.llvm.org/D55868 llvm-svn: 351593
* [NFC] Fix wParentheses warning in ASTContext getFixedPointSemanticsErich Keane2019-01-181-3/+3
| | | | | Change-Id: I862f00a548236872fe24f7da8eb2bf7917e123ff llvm-svn: 351576
* [Fixed Point Arithmetic] Add APFixedPoint to APValueLeonard Chan2019-01-163-21/+22
| | | | | | | | This adds APFixedPoint to the union of values that can be represented with an APValue. Differential Revision: https://reviews.llvm.org/D56746 llvm-svn: 351368
* [Fixed Point Arithmetic] Fixed Point AdditionLeonard Chan2019-01-161-1/+42
| | | | | | | | | | | | | | | | | | This patch covers addition between fixed point types and other fixed point types or integers, using the conversion rules described in 4.1.4 of N1169. Usual arithmetic rules do not apply to binary operations when one of the operands is a fixed point type, and the result of the operation must be calculated with the full precision of the operands, so we should not perform any casting to a common type. This patch does not include constant expression evaluation for addition of fixed point types. That will be addressed in another patch since I think this one is already big enough. Differential Revision: https://reviews.llvm.org/D53738 llvm-svn: 351364
* Re-order type param children of ObjC nodesStephen Kelly2019-01-151-2/+2
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55394 llvm-svn: 351272
* NFC: Some cleanups that I missed in the previous commitStephen Kelly2019-01-151-9/+6
| | | | llvm-svn: 351271
* Re-order overrides in FunctionDecl dumpStephen Kelly2019-01-151-14/+16
| | | | | | | | | | | | | | Output all content which is local to the FunctionDecl before traversing to child AST nodes. This is necessary so that all of the part which is local to the FunctionDecl can be split into a different method. Reviewers: aaron.ballman Differential Revision: https://reviews.llvm.org/D55083 llvm-svn: 351269
* NFC: Replace iterator loop with cxx_range_forStephen Kelly2019-01-151-4/+2
| | | | llvm-svn: 351268
* Implement BlockDecl::Capture dump in terms of visitorsStephen Kelly2019-01-152-15/+23
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56709 llvm-svn: 351239
* NFC: Implement OMPClause dump in terms of visitorsStephen Kelly2019-01-152-21/+29
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56708 llvm-svn: 351236
* Implement CXXCtorInitializer dump in terms of VisitorStephen Kelly2019-01-152-11/+15
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56707 llvm-svn: 351235
* NFC: Move Decl node handling to TextNodeDumperStephen Kelly2019-01-152-68/+77
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56643 llvm-svn: 351175
* [ASTDump] NFC: Move dump of type nodes to NodeDumperStephen Kelly2019-01-152-88/+162
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56642 llvm-svn: 351172
* [ASTDump] NFC: Move dumping of QualType node to TextNodeDumperStephen Kelly2019-01-142-5/+9
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56641 llvm-svn: 351116
* [ASTDump] NFC: Canonicalize handling of TypeLocInfoStephen Kelly2019-01-141-4/+3
| | | | | | | | | | | | Summary: No need to avoid the Visit method. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56640 llvm-svn: 351115
* [ASTDump] NFC: Move Type Visit implementation to TextNodeDumperStephen Kelly2019-01-142-32/+45
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56639 llvm-svn: 351114
* NFC: Fix nits I missed beforeStephen Kelly2019-01-142-3/+2
| | | | llvm-svn: 351112
* [OpenCL] Set generic addr space of 'this' in special class members.Anastasia Stulova2019-01-141-2/+2
| | | | | | | | | | | | | | | | | Set address spaces of 'this' param correctly for implicit special class members. This also changes initialization conversion sequence to separate address space conversion from other qualifiers in case of binding reference to a temporary. In this case address space conversion should happen after the binding (unlike for other quals). This is needed to materialize it correctly in the alloca address space. Initial patch by Mikael Nilssoni! Differential Revision: https://reviews.llvm.org/D56066 llvm-svn: 351053
* [ASTDump] NFC: Move dump of individual Stmts to TextNodeDumperStephen Kelly2019-01-122-489/+467
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55340 llvm-svn: 351014
* Implement TemplateArgument dumping in terms of VisitorStephen Kelly2019-01-122-44/+68
| | | | | | | | | | | | Summary: Split the output streaming from the traversal to other AST nodes. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55491 llvm-svn: 351012
* [ASTDump] Change parameter to StringRefStephen Kelly2019-01-121-2/+2
| | | | llvm-svn: 351011
* NFC: Port loop to cxx_range_forStephen Kelly2019-01-121-3/+2
| | | | llvm-svn: 350984
* Implement Attr dumping in terms of visitorsStephen Kelly2019-01-112-19/+31
| | | | | | | | | | | | | | Remove now-vestigial dumpType and dumpBareDeclRef methods. The old tablegen generated code used to expect them to be present, but the new generated code has no such requirement. Reviewers: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D55492 llvm-svn: 350958
* [ASTDump] Add utility for dumping a label with child nodesStephen Kelly2019-01-111-7/+7
| | | | | | | | | | | | | | | | | | | Summary: Use it to add optional label nodes to Stmt dumps. This preserves behavior of InitExprList dump: // CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]' // CHECK-NEXT: |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-IntegerLiteral {{.+}} <col:14> 'int' 1 Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55488 llvm-svn: 350957
* Fix a pair of Wfallthrough warnings in ScanfFormatString.Erich Keane2019-01-111-0/+2
| | | | | Change-Id: Ia73a34fdd93fc974224583505f9e6432493cb0da llvm-svn: 350941
* [AST] Remove ASTContext from getThisType (NFC)Brian Gesiak2019-01-112-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/D54862 removed the usages of `ASTContext&` from within the `CXXMethodDecl::getThisType` method. Remove the parameter altogether, as well as all usages of it. This does not result in any functional change because the parameter was unused since https://reviews.llvm.org/D54862. Test Plan: check-clang Reviewers: akyrtzi, mikael Reviewed By: mikael Subscribers: mehdi_amini, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D56509 llvm-svn: 350914
* NFC: Change case of identifiersStephen Kelly2019-01-102-3/+3
| | | | llvm-svn: 350890
OpenPOWER on IntegriCloud