aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/Compiler.scala
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplication of console reportersFelix Mulder2016-10-101-1/+1
|
* Add modifiers to highlightingFelix Mulder2016-10-101-4/+0
|
* Add ability to choose between fancy and non-fancy outputFelix Mulder2016-10-101-1/+5
|
* Rename `ConsoleReporter` => `FancyConsoleReporter`Felix Mulder2016-10-101-1/+1
|
* Add Inlined tree nodeMartin Odersky2016-10-021-0/+1
| | | | | | | | | ... 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.
* Identation/spacing cleanupOlivier Blanvillain2016-09-081-2/+2
|
* Fix #1442: add new phase, SelectStaticDmitry Petrashko2016-08-091-0/+1
| | | | | | | | GenBCode has an implicit assumption that I wasn't aware of: GetStatic should not be emitted against a valid selector. If it is, GenBCode messes up the stack by not pop-ing the selector. Surprisingly, this transformation is perfumed in nsc by flatten.
* Fix #1209: Skip redundant superclasses\supertraits.Nicolas Stucki2016-07-131-1/+2
|
* Fix #856: Handle try/catch cases as catch cases if possible.Nicolas Stucki2016-06-281-1/+2
| | | | | | | Previously they were all lifted into a match with the came cases. Now the first cases are handled directly by by the catch. If one of the cases can not be handled the old scheme is applied to to it and all subsequent cases.
* MoveStatic: Move static methods & fields into companion classDmitry Petrashko2016-06-071-0/+1
| | | | | | | As a funny side-effect this allows to execute arbitrary code in static initialisers: @static val a: Unit = {println("loaded")}
* Add sbt incremental compilation supportGuillaume Martres2016-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To test this with sbt, see https://github.com/lampepfl/dotty/wiki/Using-Dotty-with-sbt The following flags are added: - -Yforce-sbt-phases: Run the phases used by sbt for incremental compilation (ExtractDependencies and ExtractAPI) even if the compiler is ran outside of sbt, for debugging. - -Ydump-sbt-inc: For every compiled foo.scala, output the API representation and dependencies used for sbt incremental compilation in foo.inc, implies -Yforce-sbt-phases. This commit introduces two new phases which do not transform trees: - `ExtractDependencies` which extracts the dependency information of the current compilation unit and sends it to sbt via callbacks - `ExtractAPI` which creates a representation of the API of the current compilation unit and sends it to sbt via callbacks Briefly, when a file changes sbt will recompile it, if its API has changed (determined by what `ExtractAPI` sent) then sbt will determine which reverse-dependencies (determined by what `ExtractDependencies` sent) of the API have to be recompiled depending on what changed. See http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html for more information on how sbt incremental compilation works. This phase was originally based on https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt which attempts to integrate the sbt phases into scalac (and is itself based on https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt), but it has been heavily refactored and adapted to Dotty. The main functional differences are: - ExtractDependencies runs right after Frontend (so that we don't lose dependency informations because of the simplifications done by PostTyper), but ExtractAPI runs right after PostTyper (so that SuperAccessors are part of the API). - `ExtractAPI` only extract types as they are defined and never "as seen from" some some specific prefix, see its documentation for more details. - `ExtractDependenciesTraverser` and `ExtractUsedNames` have been fused into one tree traversal in `ExtractDependenciesCollector`. TODO: Try to run these phases in parallel with the rest of the compiler pipeline since they're independent (except for the sbt callbacks in `GenBCode`) ?
* Add initial partial evaluation of isInstanceOf callsFelix Mulder2016-05-261-0/+1
|
* Address review comments of #1188Dmitry Petrashko2016-04-181-2/+2
|
* Decouple handling array constructors from typer.Dmitry Petrashko2016-04-181-1/+2
| | | | It's done in a separate ArrayConstructors phase now.
* Better documentation of main classesMartin Odersky2016-04-011-0/+3
|
* Document phasesMartin Odersky2016-04-011-48/+49
| | | | Give a one-line explanation what each phase does in Compiler.
* 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.
* Merge pull request #1148 from sjrd/scalajs-gen-exprsodersky2016-03-181-1/+5
|\ | | | | Implement most of the Scala.js IR code generator.
| * Implement most of the Scala.js IR code generator.Sébastien Doeraene2016-03-101-1/+5
| | | | | | | | | | | | | | | | Notable things that are missing at this point: * Pattern matching * Try * Most of the JavaScript interop
* | Merge pull request #1155 from dotty-staging/staticodersky2016-03-091-0/+1
|\ \ | | | | | | Implement @static sip.
| * | Implement @static sip.Dmitry Petrashko2016-03-071-0/+1
| |/ | | | | | | | | | | | | | | This pull request implements most of machinery needed for https://github.com/scala/scala.github.com/pull/491 Only 3-rd check is not implemented by this commit. I propose to get this in faster to fix #1149
* | Merge pull request #1150 from dotty-staging/change-lambdalift-fasttrackodersky2016-03-071-1/+1
|\ \ | |/ |/| Change lambdalift - fasttrack
| * Fix call propagation from constructor to classMartin Odersky2016-03-021-1/+1
| |
* | Merge pull request #1126 from sjrd/scalajsDmitry Petrashko2016-03-041-3/+14
|\ \ | | | | | | Initial infrastructure and hello world for the Scala.js back-end.
| * | Store the JSDefinitions in a custom platform SJSPlatform.Sébastien Doeraene2016-03-011-2/+2
| | | | | | | | | | | | | | | | | | This required the ability to instantiate a different `Platform` depending on settings, which, in turn, required to defer the initialization of `ContextBase.platform`.
| * | Initial infrastructure and hello world for the Scala.js back-end.Sébastien Doeraene2016-03-011-1/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Scala.js back-end can be enabled with the `-scalajs` command-line option. Currently, it adds one phase to the pipeline, which emits .sjsir files from trees. A sandbox project `sjsSandbox`, in `sandbox/scalajs/`, can be used to easily test Scala.js compilation. One can run the `main()` method of the `hello.world` object with > sjsSandbox/run The back-end only contains the bare mimimum to compile the hello world application in the sandbox. Anything else will blow up (for example, primitive method calls). It is a work-in-progress.
* | Merge pull request #1111 from dotty-staging/fix-#1099Dmitry Petrashko2016-03-021-1/+0
|\ \ | |/ |/| Special case pattern matching against abstract types with class tags
| * Synthesize classTags in Typer.Martin Odersky2016-02-201-1/+0
| | | | | | | | | | | | | | Now diagnoses missing ClassTags of abstract types as implicit failures. Also: Simpler API of tpd.clsOf.
* | Do not create companions that will be dropped later.Dmitry Petrashko2016-02-201-1/+1
|/ | | | | | | | Fix blocker bug reported in #1114 I dislike this fix as now phase needs to know in advance if it will ever need a companion for the class. On the bright side, this change makes it clear which phases need companions
* Fix problems in DropEmptyCompanionsMartin Odersky2016-02-111-4/+3
|
* New phase to drop empty companion objectsMartin Odersky2016-02-111-0/+1
|
* Compiler: use the reporter passed from the DriverGuillaume Martres2016-02-041-3/+1
| | | | | | | | | | | | With this commit and the previous one, partest should finally correctly log the output of the compiler and display it at the end of its execution if compilation failed. Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter. Previously, the initial Reporter was always overriden in Compiler by rootReporter so it had no effect, but this is not the case anymore, and the negative junit tests fail with the ThrowingReporter since they throw an exception instead of exiting with a certain number of errors.
* ConsoleReporter: remove unused argument ctxGuillaume Martres2016-02-041-1/+1
|
* Merge pull request #928 from dotty-staging/stdlib-definitionsDmitry Petrashko2015-11-101-2/+3
|\ | | | | Make Definitions survive recompilation of core definitions.
| * First versions of Definitions based on TypeRefs not Symbols.Martin Odersky2015-11-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbols are not stable between runs, so if some symbol referred to from Definitions gets recompiled, there are then two Symbols that are both visible, one referenced from Definitions, the other the one that got compiled. Thos led to a crash when e.g. compiling scala.Short, because the newly compiled symbol was not recognized as a primitive value class. The present commit tries to make systematic changes without regard to simplicity or aesthetics. This will be polished in future commits. // ### comments signal areas that need further attention.
* | New phase: crossCastAnd.Dmitry Petrashko2015-11-101-0/+1
|/ | | | | | | This transform makes sure that all private member selections from AndTypes are performed from the first component of AndType. This is needed for correctness of erasure. See `tests/run/PrivateAnd.scala`
* Make a new fresh name creator for each unitMartin Odersky2015-10-301-5/+4
| | | | Needed to make builds deterministic.
* New phase: ExplicitSelfMartin Odersky2015-09-171-0/+1
| | | | | Makes self types explicit, if this is needed to identify a member in a select. Fixes #789.
* Move literalize functionality to PostTyperMartin Odersky2015-09-141-1/+0
| | | | | | | | | Now, PostTyper replaces constant expressions with literals. If we wait any longer then any tree rewriting of an application node would have to do constant folding again, which is a hassle. With the previous late Literalize phase, constant expressions consisting of operations and arguments lost their constantness in PostTyper.
* Add comment to Compiler.scala about behaviour of ConstructorsDmitry Petrashko2015-08-241-1/+1
|
* Add LiftTry phaseMartin Odersky2015-08-051-0/+1
| | | | | Phase lifts tries that would be illegal because they execute on non-empty expression stacks.
* Implement non-local returnsMartin Odersky2015-08-041-0/+1
| | | | Non-local returns are now implemented.
* Put GetClass to next mini-phaseAlexander Myltsev2015-07-271-2/+2
|
* Implement getClass methodAlexander Myltsev2015-07-251-0/+1
|
* Move the inlining of value class methods before ErasureGuillaume Martres2015-07-071-2/+3
| | | | | | | | | | | | | | | | VCInline is split into two phases: - VCInlineMethods (before Erasure) replaces value class method calls by calls to extension methods - VCElideAllocations (after Erasure) handles == and optimizing the unboxing of a boxed value class, as VCInline did before. This should not affect anything currently, but in the future we will have phases before Erasure that mangle names (like TypeSpecializer, see #630), being able to put these phases after VCInlineMethods means that VCInlineMethods does not need to know anything about how these phases mangle names, this reduces the coupling between phases. The trade-off is that VCInlineMethods needs to deal with type parameters and multiple parameter lists whereas VCInline didn't.
* Add reentrancy checkingMartin Odersky2015-07-061-1/+2
| | | | | | | | | | New miniphase CheckRentrant verifies that compiled program is without vars accessible through global roots if -Ycheck-reentrant option is set. Known shortcoming: Array elements are currently not considered as vars. This is because in many programs arrays are used as an efficient container for immutable fields.
* Merge pull request #699 from dotty-staging/fix/trait-constructorsDmitry Petrashko2015-07-011-2/+1
|\ | | | | Fix trait constructors
| * Drop TraitConstructors phaseMartin Odersky2015-06-271-2/+1
| | | | | | | | | | | | | | | | It did not do enough to carry its own weight, in particular because DenotationTransformers do have a price - every encountered denotation in the whole program is passed through them. The name change from <init> to $init$ was all it did, that is now rolled into Mixin. Also renamed IMPLCLASS_CONSTRUCTOR to TRAIT_CONSTRUCTOR.
* | Make reporter ised in Compiler configurableMartin Odersky2015-06-291-5/+7
|/ | | | Not needed right now, but will be useful later.
* Merge pull request #691 from vsalvis/vsalvis-partest-outputDmitry Petrashko2015-06-261-5/+5
|\ | | | | Partest output redirection over context.reporter