aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/TreeTransform.scala
Commit message (Collapse)AuthorAgeFilesLines
* CleanupsMartin Odersky2016-10-021-2/+1
| | | | | Better comments and refactorings that move some things around so that less modules depend on Inliner.
* Add Inlined tree nodeMartin Odersky2016-10-021-1/+31
| | | | | | | | | ... to tag inlined calls. Perform typings and transformations of inlined calls in a context that refers to the INlined node in its InlinedCall property. The idea is that we can use this to issue better error positions. This remains to be implemented.
* Get rid of SelectFromType tree node.Martin Odersky2016-09-251-29/+0
| | | | | | Roll its functionality into Select. Since we can always tell whether a tree is a type or term there is no expressiveness gained by having a separate tree node.
* Drop PairMartin Odersky2016-09-251-29/+0
| | | | | | | | Drop tree node class 'Pair'. It was used only in imports, where it can easily be replaced by Thicket. The envisaged use for generic pairs is almost sure better modelled by a "Pair" class in Dotty's standard library.
* Decouple annotation transformers from info transformersMartin Odersky2016-05-231-20/+10
|
* Transform annotations only if defined in current runMartin Odersky2016-04-291-4/+11
| | | | | | | | There's no point transforming annotations that come from classfiles. It's inefficient to do so and it's also risky because it means we'd have to make sense of Scala-2 generated trees. This should avoid the error in #1222.
* Move Mode to coreMartin Odersky2016-04-011-1/+1
| | | | | Mode is used from a lot of low-level code, does not just reflect Typer info. So it makes more sense top to place it in the core package.
* Add second field to SeqLiteralMartin Odersky2016-03-101-1/+2
| | | | | | | The field keeps track of the element type. This is necessary because JavaSeqLiteral is nonvariant and the elements might be empty, so we cannot always compute the type from the element types.
* Fix miniphase assembly.Martin Odersky2015-08-151-12/+11
| | | | | | | | There were two architectural errors here, which confused TreeTransforms and MiniPhases and which caused "NotDefinedHere" on transformFollowing: 1. TreeTransforms should not have idx fields, MiniPhases have them.2 2. TreeTransformers initialize arrays of MiniPhases not TreeTransforms.
* Add @sharable annotationMartin Odersky2015-07-061-2/+3
| | | | | | | Add @sharable annotation for classes and vals that are presumed to be safely sharable between threads. Also: Document CtxLazy.
* Correct a large number of typos.Jason Zaugg2015-05-141-8/+8
| | | | | I scanned the main sources with IntellIJ's spell checker and corrected what showed up.
* Avoid prepare actions form earlier phases when doing a transformFollowinfDeepMartin Odersky2015-05-021-1/+8
| | | | See comment in the code.
* Ensure spaces after `if` in Dotty source.Dmitry Petrashko2015-04-091-1/+1
|
* Eliminate Throw as a typed TreeMartin Odersky2015-03-041-28/+0
| | | | | | | | Replace with <compiler-ops>.throw(exception) Only leave Throw as an untyped tree.
* Don't transform Return#fromMartin Odersky2014-12-171-1/+5
| | | | Explanation given in the comment.
* Replace Throwable catches with NonFatalMartin Odersky2014-12-151-2/+8
| | | | | | Previously, stackoverflows led to infinite loops because the catch immediately threw another stack overflow. Anyway, one should never catch Throwable.
* Fix Bind node contents not being transformed if phase didn't register ↵Dmitry Petrashko2014-12-151-2/+2
| | | | transformBind.
* Merge pull request #286 from dotty-staging/change/defaultphaseDmitry Petrashko2014-12-151-2/+4
|\ | | | | Change/defaultphase
| * Change default treeTrannsformPhase to phase.nextMartin Odersky2014-12-141-1/+1
| |
| * Make sure AnnotationTransformers run at own phaseMartin Odersky2014-12-141-0/+2
| |
| * Ensure that transformStats is run at phase thisTransformPhase.Martin Odersky2014-12-141-1/+1
| |
* | Make TreeTransform type check in dotty. There's no magic type behind ↵Dmitry Petrashko2014-12-121-4/+4
| | | | | | | | getClass in dotty.
* | Precompute initial NXTransformations in TreeTransforms.Dmitry Petrashko2014-12-121-5/+9
| | | | | | | | Helps Annotation transformers which do not need to reinitialise themselves anymore.
* | Call getClass 30 times less in TreeTransforms initialisation.Dmitry Petrashko2014-12-121-69/+74
| |
* | Remove Separator. It's not used anymoreDmitry Petrashko2014-12-121-6/+0
|/
* Fix TreeTransfrom ignoring SeqLiterals.Dmitry Petrashko2014-12-031-1/+1
|
* Adapting branch to absence of modifiers in trees.Dmitry Petrashko2014-11-221-26/+1
|
* AnnotationTransformer now also transforms typesDmitry Petrashko2014-11-221-1/+19
| | | | | | | Required as gettersAndSetters ignores modifiers in tree and uses ones in the type instead. This means that gettersAndSetters carries over modifiers from type to tree and this one violates postconditions.
* Extract AnnotationTransformer functionality from ElimRepeated to a traitDmitry Petrashko2014-11-221-0/+31
| | | | to be reused by FirstTransform
* Remove init method from TreeTransformMartin Odersky2014-11-121-6/+1
| | | | Do not lead to temptation...
* Added methods to prepare-for and transform a complete compilation unit tree.Martin Odersky2014-11-121-4/+23
| | | | Should replace destructive inits.
* 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.
* Fixed bug in treating Thickets in TreeTransformMartin Odersky2014-11-091-2/+3
|
* Take supercalls into account for statement contextMartin Odersky2014-11-091-2/+1
| | | | | After Mixin, super calls can appear in statemenr sequences. They need to be typechecked and transformed using a special context.
* Restructure Try node.Dmitry Petrashko2014-10-301-2/+2
| | | | | | 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.
* Allow extensions methods to play well with tailrec.Dmitry Petrashko2014-10-111-0/+5
|
* Better failure diagnostic in TreeTransformMartin Odersky2014-09-121-10/+16
| | | | Include a backtrace of nested calls on error.
* Add inSuperCall mode and flag.Martin Odersky2014-09-041-1/+1
| | | | | Needed to keep a record of definitions in supercall arguments. These may not see the enclosing class.
* Fix context for super callsMartin Odersky2014-08-241-1/+1
| | | | | | | | Super calls need to have special contexts, going beyond super-mode. It's explained in detail in Context#superCallContext. this(...) calls also need special contexts, but this is not enabled yet (some tests fail, need to track down why).
* Changed phase dependencies from names to classes.Martin Odersky2014-08-181-1/+1
| | | | Don't want stringly types for this.
* 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.
* Add hook for phase when a TreeTransform is run.Martin Odersky2014-08-151-33/+35
| | | | | | Achieved by overridanle method treeTransformPhase in TreeTransform. This is currently by default the current phase. We should migrate it to the one after current phase.
* Changes to tree copyingMartin Odersky2014-08-131-30/+30
| | | | | | | | 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.
* Disentangle phases from treetransformsMartin Odersky2014-08-091-46/+61
| | | | | | | | 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.
* prepareStats should span all statement transformsMartin Odersky2014-08-091-2/+2
| | | | | Statements are now transformed with the transform returned by prepareStats, analogoys to the other prepare methods.
* Changed first phase normalization and improvements to TreeTransformMartin Odersky2014-08-031-58/+68
| | | | | | | | | | | | | | Two improvements to TreeTransform: 1) Added transformOther functionality which handles trees not handled by other parts 2) Passes down Mode.Pattern in the context when in a pattern. TreeTransform no longer normalizes unknown trees but passes them to transformOther. The former Companions phase has been renamed to FirstTransform. It now performs the following optimizations: - adds companion objects (this was done before) - other normalizations that were formally done in TreeTransform, - rewrite native methods to stubs (this was formally done in RefChecks)
* Fixes to MacroTransform and TreeTransformerMartin Odersky2014-07-171-1/+7
| | | | | | | 1) Make local context go to module class if the tree symbol is a package val. Perviously, this gave the wrong context owner for package definitions. 2) Add a hook to define the phase in which a transform should be run.
* Changed PostTyperTransformer schemeMartin Odersky2014-07-171-1/+5
| | | | | | | | | | | | 1) We now always generate companion objects for classes. This is done in mini-phase "companions", which also assures that companion-modules appear after companion-classes. 2) PostTyperTransformers is gone; the part which normalizes trees has been rolled into TreeTransform and the part which reordered companion classes and modules is now in Companions. Note: Some tests were deisabled; should be re-enabled by Dmitry where needed.
* Fix wrong period for creating nested ctx in TreeTransforms.Dmitry Petrashko2014-07-161-2/+5
| | | | | | | `owner` for nestedContext in `TreeTransforms` was assigned using initial period of whole `TreeTransforms` block. That is incorrect as denotation for this owner could have been create by some phase in this block.
* Short-circuit TreeTransform.transformDmitry Petrashko2014-07-161-5/+7
| | | | No need to perform zero transformations.