summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Retain an expression pack expansion when the parameter pack expansion code asksRichard Smith2014-06-061-2/+27
| | | | | | us to. llvm-svn: 210355
* [OPENMP] Parsing/Sema for OMPLasprivateClause.Alexander Musman2014-06-041-0/+27
| | | | | | Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks. llvm-svn: 210184
* [OPENMP] Small comment and reformatting fixes.Alexander Musman2014-06-041-74/+60
| | | | | | | | | Fix post-commit review comments by Carlo Bertolli for commit r209660 - OMP collapse clause. Re-formatted TransformOMP* functions in TreeTransform.h with clang-format. llvm-svn: 210169
* Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExprRichard Smith2014-05-311-47/+13
| | | | | | | consistently, rather than sometimes performing lookup and calling the LookupResult form. No functionality change intended. llvm-svn: 209941
* Parsing/Sema for OMPAlignedClause.Alexander Musman2014-05-291-0/+32
| | | | llvm-svn: 209816
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-291-118/+111
| | | | llvm-svn: 209812
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-51/+51
| | | | | | takeAs to getAs. llvm-svn: 209800
* Parsing/Sema for OMPCollapseClause.Alexander Musman2014-05-271-0/+21
| | | | | | Actual usage in Sema for collapsing loops will in some future patch. llvm-svn: 209660
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-124/+127
| | | | llvm-svn: 209613
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-061-3/+16
| | | | llvm-svn: 208077
* [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP ↵Alexey Bataev2014-05-061-0/+23
| | | | | | clause 'proc_bind' llvm-svn: 208060
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-8/+6
| | | | llvm-svn: 207896
* Rewrite NRVO determination. Track NRVO candidates on the parser Scope and ↵Nick Lewycky2014-05-031-1/+1
| | | | | | | | apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal. Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith. llvm-svn: 207890
* [OPENMP] parsing 'linear' clause (for directive 'omp simd')Alexander Musman2014-04-221-0/+32
| | | | | | Differential Revision: http://reviews.llvm.org/D3272 llvm-svn: 206891
* Implement [over.match.oper]p3 properly, by filtering the non-candidates outRichard Smith2014-04-171-5/+1
| | | | | | | when building the candidate set, rather than trying to contort name lookup into handling this. llvm-svn: 206436
* PR19452: Implement more of [over.match.oper]p3's restrictions on which ↵Richard Smith2014-04-171-3/+4
| | | | | | non-member overloaded operators can be found when no operand is of class type. We used to fail to implement this rule if there was an operand of dependent type. llvm-svn: 206435
* [OPENMP][C++11] Renamed loop vars properly.Alexey Bataev2014-04-041-8/+8
| | | | llvm-svn: 205620
* [OPENMP] Small update for C++11Alexey Bataev2014-04-031-4/+2
| | | | llvm-svn: 205506
* [OPENMP] Implemented 'copyin' clauseAlexey Bataev2014-03-311-0/+31
| | | | llvm-svn: 205164
* [OPENMP] parsing of clause 'safelen' (for directive 'omp simd')Alexey Bataev2014-03-211-0/+20
| | | | llvm-svn: 204428
* [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with ↵Aaron Ballman2014-03-171-5/+4
| | | | | | iterator_range body(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204040
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-141-3/+2
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-141-5/+3
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203947
* [C++11] Replacing OMPThreadPrivateDecl and OMPClause iterators ↵Aaron Ballman2014-03-141-12/+6
| | | | | | varlist_begin() and varlist_end() with iterator_range varlists(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203937
* Add SourceRange to err_not_tag_in_scope diagnostic in ↵Stephan Tolksdorf2014-03-131-2/+1
| | | | | | | | | | | | | TreeTransform<...>::RebuildDependentNameType Apparently the FIXME was overlooked when the source location information was made available to the function. Reviewed By: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D3058 llvm-svn: 203845
* [C++11] Replacing UsingDecl iterators shadow_begin() and shadow_end() with ↵Aaron Ballman2014-03-131-6/+4
| | | | | | iterator_range shadows(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203825
* Another one fix for getSema()/getDerived().getSema()Alexey Bataev2014-03-071-1/+1
| | | | llvm-svn: 203196
* Fixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.Alexey Bataev2014-03-071-1/+1
| | | | llvm-svn: 203195
* [OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp ↵Alexey Bataev2014-03-061-0/+4
| | | | | | simd' support) llvm-svn: 203114
* [OPENMP] Clause 'num_threads'Alexey Bataev2014-03-061-0/+24
| | | | llvm-svn: 203087
* [OPNEMP] Fixed instantiation of 'if' clauseAlexey Bataev2014-03-051-1/+4
| | | | llvm-svn: 202940
* [OPENMP] First changes for Parsing and Sema for 'omp simd' directive supportAlexey Bataev2014-02-271-18/+35
| | | | llvm-svn: 202360
* [OPENMP] 'if' clause support (no CodeGen support)Alexey Bataev2014-02-131-0/+19
| | | | llvm-svn: 201297
* Allow transformation of VariableArray to ConstantArray.Serge Pavlov2014-02-061-1/+3
| | | | | | | | | | | | | | | | | In the following code: struct A { static const int sz; }; template<class T> void f() { T arr[A::sz]; } the array 'arr' is represented as a variable size array in the template. If 'A::sz' gets value below in the translation unit, the array in instantiation can turn into constant size array. This change fixes PR18633. Differential Revision: http://llvm-reviews.chandlerc.com/D2688 llvm-svn: 200899
* Rename getResultLoc() tooAlp Toker2014-01-251-3/+3
| | | | | | | | Follow up to r200082. Spotted by Dmitri llvm-svn: 200105
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-9/+6
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* PR18560: When switching to a new context, don't just save and restore anRichard Smith2014-01-241-1/+2
| | | | | | | override for the type of 'this', also clear it out (unless we're entering the context of a lambda-expression, where it should be inherited). llvm-svn: 199962
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-5/+5
| | | | llvm-svn: 199699
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-14/+10
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-011-28/+0
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. llvm-svn: 198271
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-33/+0
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Remove unused variable.Richard Trieu2013-12-051-1/+0
| | | | llvm-svn: 196459
* Fix init-captures for generic lambdas.Faisal Vali2013-12-051-27/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For an init capture, process the initialization expression right away. For lambda init-captures such as the following: const int x = 10; auto L = [i = x+1](int a) { return [j = x+2, &k = x](char b) { }; }; keep in mind that each lambda init-capture has to have: - its initialization expression executed in the context of the enclosing/parent decl-context. - but the variable itself has to be 'injected' into the decl-context of its lambda's call-operator (which has not yet been created). Each init-expression is a full-expression that has to get Sema-analyzed (for capturing etc.) before its lambda's call-operator's decl-context, scope & scopeinfo are pushed on their respective stacks. Thus if any variable is odr-used in the init-capture it will correctly get captured in the enclosing lambda, if one exists. The init-variables above are created later once the lambdascope and call-operators decl-context is pushed onto its respective stack. Since the lambda init-capture's initializer expression occurs in the context of the enclosing function or lambda, therefore we can not wait till a lambda scope has been pushed on before deciding whether the variable needs to be captured. We also need to process all lvalue-to-rvalue conversions and discarded-value conversions, so that we can avoid capturing certain constant variables. For e.g., void test() { const int x = 10; auto L = [&z = x](char a) { <-- don't capture by the current lambda return [y = x](int i) { <-- don't capture by enclosing lambda return y; } }; If x was not const, the second use would require 'L' to capture, and that would be an error. Make sure TranformLambdaExpr is also aware of this. Patch approved by Richard (Thanks!!) http://llvm-reviews.chandlerc.com/D2092 llvm-svn: 196454
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-051-2/+17
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* Factor duplicated code for TransformTypeInObjectScopeReid Kleckner2013-12-041-49/+22
| | | | | | Fixes the relevant FIXME about copy-pasted code. llvm-svn: 196425
* REFACTOR: Have PushLambdaScope return the LambdaScopeInfo that it creates.Faisal Vali2013-11-121-2/+1
| | | | | | | | No Functionality change. This refactoring avoids having to call getCurLambda right after PushLambdaScope, to obtain the LambdaScopeInfo that was created during the call to PushLambdaScope. llvm-svn: 194438
* PR17800: When performing pack expansion, we must always rebuild the AST nodesRichard Smith2013-11-071-1/+5
| | | | | | | to avoid breaking AST invariants by reusing Stmt nodes within the same function. llvm-svn: 194217
* Refactor out the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-231-1/+3
| | | | | | | | | | | | | | | | | A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test. The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html. Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box). Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. No change in functionality. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193246
* And Again: Teach TreeTransform how to transform nested generic lambdas.Faisal Vali2013-10-231-28/+85
| | | | | | | | | | | | | | | | | | | | | | | | A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted, The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType. This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off. Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476. The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created. Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh! Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date. Hopefully the third time;s a charm *fingers crossed* This does not yet include capturing. Please see test file for examples. This patch was LGTM'd by Doug: http://llvm-reviews.chandlerc.com/D1784 llvm-svn: 193230
* Revert r193223 and r193216.Rafael Espindola2013-10-231-88/+29
| | | | | | | | | | They were causing CodeGenCXX/mangle-exprs.cpp to fail. Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl." Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves." llvm-svn: 193226
OpenPOWER on IntegriCloud