aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/TailRec.scala
Commit message (Collapse)AuthorAgeFilesLines
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-384/+0
|
* Merge pull request #1587 from dotty-staging/change-tasty-posGuillaume Martres2016-11-041-1/+1
|\ | | | | Fix Tasty positions
| * Drop original on TypeTreeMartin Odersky2016-10-151-1/+1
| | | | | | | | | | | | | | | | The plan is to keep original type until after pickling, and afterwards replace it with a simple TypeTree. # Conflicts: # src/dotty/tools/dotc/core/tasty/TreePickler.scala
* | Fix #1614: correctly handle polymorphic inner methodsDmitry Petrashko2016-10-231-1/+5
|/ | | | | Even if outer class & method isn't polymorpnic, inner method might be. Need to handle this correctly.
* Reformatting to avoid a long lineMartin Odersky2016-10-111-1/+4
|
* Improve positions for MemberDefs using `namePos`Felix Mulder2016-10-101-4/+9
|
* Fix a couple of warnings.Nicolas Stucki2016-08-261-3/+5
|
* Tailrec:report error if method containing @tailrec callsite isn't finalDmitry Petrashko2016-04-181-2/+16
|
* Implement #1221. Allow to specify per-callsite @tailrec annotation.Dmitry Petrashko2016-04-181-3/+4
| | | | See examples in following commit.
* Fix #1089: Special-case local methodsDmitry Petrashko2016-03-311-16/+32
| | | | | | This is a simpler fix than the previous one. Local methods, cannot change `this` and do not need to go through FullParameterization.
* Tailrec: drop support for polymorphic recursion.Dmitry Petrashko2016-03-311-1/+3
| | | | | | | | | | If the method that recurses over a different type arguments, if this method is specialised, it would lead to method not being tail-rec anymore. Eg: def foo[@specialized A, @specialized B]: Unit = foo[B, A]
* FullParametrization: allow to have $this of ThisType.Dmitry Petrashko2016-03-311-8/+8
| | | | | | | | | TailRec methods remain members of enclosing class, it means that they can refer to methods that require this.type. It means that tailrec, unlike value classes is not allowed to widen type of $this to it's full self type. Fixes #1089
* Merge pull request #928 from dotty-staging/stdlib-definitionsDmitry Petrashko2015-11-101-3/+3
|\ | | | | Make Definitions survive recompilation of core definitions.
| * Standardize naming and definition order of annotation classesMartin Odersky2015-11-091-3/+3
| |
* | Tailrec: fix compilation of IndexedSeqOptimizedDmitry Petrashko2015-11-091-1/+1
|/ | | | Fixed #912
* Correct a large number of typos.Jason Zaugg2015-05-141-3/+3
| | | | | I scanned the main sources with IntellIJ's spell checker and corrected what showed up.
* Ensure spaces after `if` in Dotty source.Dmitry Petrashko2015-04-091-1/+1
|
* Make some tree fields lazyMartin Odersky2015-03-181-4/+4
| | | | | | | | | | | | | | | | Lazy fields are - the rhs field of a ValDef or DefDef - the body field of a Template These can be instantiated with Lazy instances. The scheme is such that lazy fields are completely transparent for users of the Trees API. The only downside is that the parameter used to initialize a potentially lazy field has a weak type (now it's Any, with Dotty it would be a union type of the form `T | Lazy[T]`. Therefore, the parameter cannot be recovered through pattern matching.
* Even more careful handling of tailcalls.Dmitry Petrashko2015-02-031-19/+23
| | | | See i321 doc for description of problem and decision taken.
* Fix i321, tail call needs to be careful with abstracting over class type ↵Dmitry Petrashko2015-02-031-6/+10
| | | | | | arguments. Or it could lead to Ycheck error that was triggered in #321.
* Make Literalize run at new default phase thisTransform.nextMartin Odersky2014-12-141-1/+2
|
* Drop modifiers as separate data from MemberDef treesMartin Odersky2014-11-101-3/+3
| | | | Typed MemberDef trees now take the modifiers from their symbol's data.
* Get rid of ExceptionHandlerSel.Dmitry Petrashko2014-10-301-11/+0
| | | | It's not used anymore as superseded by previous commit.
* Restructure Try node.Dmitry Petrashko2014-10-301-5/+4
| | | | | | Now Try node always has cases as handlers. In case handler is an Ident of type Throwable => T than it's desugared to a CaseDef during parsing.
* Make typing of Try nodes idempotentDmitry Petrashko2014-10-301-1/+1
|
* Fix TailRec to handle inline exception handlers and non-trivial not-inlinedDmitry Petrashko2014-10-301-1/+3
|
* TailRec now handles Try with Ident-handlerDmitry Petrashko2014-10-301-0/+1
|
* Fix #196. Errorneus tail-optimization of inner DefDef'sDmitry Petrashko2014-10-221-1/+2
| | | | | | | | | Unless a DefDef is a result of desugaring an exception handler it shouldn't be optimized by tailrec. There's a potential improvement here: to detect that a DefDef is a label def which itself is called only in tail position. This is a requirement to implement #194
* Allow extensions methods to play well with tailrec.Dmitry Petrashko2014-10-111-3/+6
|
* Handle return in tailcalls.Martin Odersky2014-09-121-18/+22
| | | | | Avoids characterizing the "from" link in a return as a tail call reference.
* Rename in Phase: name -> phaseNameMartin Odersky2014-08-181-1/+1
| | | | | Most transformations are subclasses of phase. Having a generic name like `name` in scope everywhere is therefore very risky.
* Delete propagateType and RetypingTreeMapMartin Odersky2014-08-151-12/+7
| | | | Their functionality is now rolled into TypedTreeCopier.
* Changes to tree copyingMartin Odersky2014-08-131-13/+12
| | | | | | | | 1) Add copiers with default arguments, to avoid boilerplate 2) All copiers are now curried wrt first argument (which is the original tree). We already make use of the new features in cpy.DefDef, but not yet elsewhere.
* New methods in DefinitionsMartin Odersky2014-08-111-1/+1
| | | | | Also renamed Boolean_and/or to _&&/||, to make it conform to naming convention for other Definition operators.
* Disentangle phases from treetransformsMartin Odersky2014-08-091-2/+2
| | | | | | | | TreeTransforms are no longer phases. This allows to generate new transforms in prepare... methods without running into the problem that thee new transforms are undefined as phases. It also makes for a cleaner separation of concerns.
* Make trees after TailRec type correctDmitry Petrashko2014-07-221-90/+73
| | | | | | | | | TailRec now relies on FullParameterization and uses two passes for transformation. First one decides weather the method will be transformed and if yes, starts rewriting calls in taill position. Second one lifts the method body to a fully parameterized one, correcting types.
* Added infix methods for some tree constructionsMartin Odersky2014-07-171-1/+1
| | | | | | | Added several forms of "select" and "appliedTo" methods which construct Select, Apply, TypeApply trees. Motivation: Infix methods allow chaining which is more legible than deep nesting.
* Fix dotty deviation failure in TailRecDmitry Petrashko2014-05-081-1/+1
|
* Making dotc/transform Dotty compliantMartin Odersky2014-05-081-2/+3
| | | | Fixes to make the files in `transform` compile in Dotty.
* Fix TailRec to use Label flag.Dmitry Petrashko2014-05-061-6/+16
| | | | | | Conflicts: src/dotty/tools/dotc/backend/jvm/BCodeBodyBuilder.scala src/dotty/tools/dotc/core/Definitions.scala
* TailRec phase and tests for it.Dmitry Petrashko2014-04-111-0/+341
Ported tailcall phase from scalac with such changes: - all transformation is done in the phase itself (previously half of the work was done in backend) - it is now able to run before uncurry - it is now a treeTransform - renamed to tailrec to make it more obvious that this phase transforms only recursive calls. For now this is a single phase which speculatively transforms DefDefs. Speculation can be potentially removed by splitting into 2 phases: one detecting which methods should be transformed second performing transformation. But, as transformation requires as same amount of work as detection, I believe it will be simpler to maintain it as a single phase. Conflicts: tests/pos/typers.scala