aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/config/Config.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-02 11:08:28 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-11-22 01:35:07 +0100
commit8a61ff432543a29234193cd1f7c14abd3f3d31a0 (patch)
treea8147561d307af862c295cfc8100d271063bb0dd /compiler/src/dotty/tools/dotc/config/Config.scala
parent6a455fe6da5ff9c741d91279a2dc6fe2fb1b472f (diff)
downloaddotty-8a61ff432543a29234193cd1f7c14abd3f3d31a0.tar.gz
dotty-8a61ff432543a29234193cd1f7c14abd3f3d31a0.tar.bz2
dotty-8a61ff432543a29234193cd1f7c14abd3f3d31a0.zip
Move compiler and compiler tests to compiler dir
Diffstat (limited to 'compiler/src/dotty/tools/dotc/config/Config.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/config/Config.scala138
1 files changed, 138 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/config/Config.scala b/compiler/src/dotty/tools/dotc/config/Config.scala
new file mode 100644
index 000000000..7744a5479
--- /dev/null
+++ b/compiler/src/dotty/tools/dotc/config/Config.scala
@@ -0,0 +1,138 @@
+package dotty.tools.dotc.config
+
+object Config {
+
+ final val cacheMembersNamed = true
+ final val cacheAsSeenFrom = true
+ final val useFingerPrints = true // note: it currently seems to be slightly faster not to use them! my junit test: 548s without, 560s with.
+ final val cacheMemberNames = true
+ final val cacheImplicitScopes = true
+
+ final val checkCacheMembersNamed = false
+
+ /** When updating a constraint bound, check that the constrained parameter
+ * does not appear at the top-level of either of its bounds.
+ */
+ final val checkConstraintsNonCyclic = false
+
+ /** Make sure none of the bounds of a parameter in an OrderingConstraint
+ * contains this parameter at its toplevel (i.e. as an operand of a
+ * combination of &'s and |'s.). The check is performed each time a new bound
+ * is added to the constraint.
+ */
+ final val checkConstraintsSeparated = false
+
+ /** Check that each constraint resulting from a subtype test
+ * is satisfiable.
+ */
+ final val checkConstraintsSatisfiable = false
+
+ /** Check that each constraint is fully propagated. i.e.
+ * If P <: Q then the upper bound of P is a subtype of the upper bound of Q
+ * and the lower bound of Q is a subtype of the lower bound of P.
+ */
+ final val checkConstraintsPropagated = false
+
+ /** Check that constraints of globally committable typer states are closed.
+ * NOTE: When enabled, the check can cause CyclicReference errors because
+ * it traverses all elements of a type. Such failures were observed when
+ * compiling all of dotty together (source seems to be in GenBCode which
+ * accesses javac's settings.)
+ *
+ * It is recommended to turn this option on only when chasing down
+ * a PolyParam instantiation error. See comment in Types.TypeVar.instantiate.
+ */
+ final val debugCheckConstraintsClosed = false
+
+ /** Check that no type appearing as the info of a SymDenotation contains
+ * skolem types.
+ */
+ final val checkNoSkolemsInInfo = false
+
+ /** Type comparer will fail with an assert if the upper bound
+ * of a constrained parameter becomes Nothing. This should be turned
+ * on only for specific debugging as normally instantiation to Nothing
+ * is not an error consdition.
+ */
+ final val failOnInstantiationToNothing = false
+
+ /** Enable noDoubleDef checking if option "-YnoDoubleDefs" is set.
+ * The reason to have an option as well as the present global switch is
+ * that the noDoubleDef checking is done in a hotspot, and we do not
+ * want to incur the overhead of checking an option each time.
+ */
+ final val checkNoDoubleBindings = true
+
+ /** Check positions for consistency after parsing */
+ final val checkPositions = true
+
+ /** Show subtype traces for all deep subtype recursions */
+ final val traceDeepSubTypeRecursions = false
+
+ /** When explaining subtypes and this flag is set, also show the classes of the compared types. */
+ final val verboseExplainSubtype = true
+
+ /** If this flag is set, take the fast path when comparing same-named type-aliases and types */
+ final val fastPathForRefinedSubtype = true
+
+ /** If this flag is set, higher-kinded applications are checked for validity
+ */
+ final val checkHKApplications = false
+
+ /** The recursion depth for showing a summarized string */
+ final val summarizeDepth = 2
+
+ /** Check that variances of lambda arguments match the
+ * variance of the underlying lambda class.
+ */
+ final val checkLambdaVariance = false
+
+ /** Check that certain types cannot be created in erasedTypes phases.
+ * Note: Turning this option on will get some false negatives, since it is
+ * possible that And/Or types are still created during erasure as the result
+ * of some operation on an existing type.
+ */
+ final val checkUnerased = false
+
+ /** In `derivedSelect`, rewrite
+ *
+ * (S & T)#A --> S#A & T#A
+ * (S | T)#A --> S#A | T#A
+ *
+ * Not sure whether this is useful. Preliminary measurements show a slowdown of about
+ * 7% for the build when this option is enabled.
+ */
+ final val splitProjections = false
+
+ /** If this flag is on, always rewrite an application `S[Ts]` where `S` is an alias for
+ * `[Xs] -> U` to `[Xs := Ts]U`.
+ * Turning this flag on was observed to give a ~6% speedup on the JUnit test suite.
+ */
+ final val simplifyApplications = true
+
+ /** Initial size of superId table */
+ final val InitialSuperIdsSize = 4096
+
+ /** Initial capacity of uniques HashMap */
+ final val initialUniquesCapacity = 40000
+
+ /** How many recursive calls to NamedType#underlying are performed before logging starts. */
+ final val LogPendingUnderlyingThreshold = 50
+
+ /** How many recursive calls to isSubType are performed before logging starts. */
+ final val LogPendingSubTypesThreshold = 50
+
+ /** How many recursive calls to findMember are performed before logging names starts
+ * Note: this threshold has to be chosen carefully. Too large, and programs
+ * like tests/pos/IterableSelfRec go into polynomial (or even exponential?)
+ * compile time slowdown. Too small and normal programs will cause the compiler to
+ * do inefficient operations on findMember. The current value is determined
+ * so that (1) IterableSelfRec still compiles in reasonable time (< 10sec) (2) Compiling
+ * dotty itself only causes small pending names lists to be generated (we measured
+ * at max 6 elements) and these lists are never searched with contains.
+ */
+ final val LogPendingFindMemberThreshold = 10
+
+ /** Maximal number of outstanding recursive calls to findMember */
+ final val PendingFindMemberLimit = LogPendingFindMemberThreshold * 4
+}