aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-14 17:50:10 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-14 18:05:41 +0100
commitffe9e2237956d167b51c9ab1e571a04163b525f7 (patch)
tree952d7177e26997df8761452844df0f375a3aae75 /src/dotty/tools/dotc/core/SymDenotations.scala
parentfe865cd382bb21026b79070eafa597b865fe461c (diff)
downloaddotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.gz
dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.bz2
dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.zip
Some configuation parameters
Caching, plus whether we want to match on signatures or types.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index d6032aee3..af2e6a8ca 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -10,6 +10,7 @@ import collection.immutable.BitSet
import scala.reflect.io.AbstractFile
import Decorators.SymbolIteratorDecorator
import annotation.tailrec
+import config.Config
trait SymDenotations { this: Context =>
import SymDenotations._
@@ -921,14 +922,15 @@ object SymDenotations {
* The elements of the returned pre-denotation all
* have existing symbols.
*/
- final def membersNamed(name: Name)(implicit ctx: Context): PreDenotation = {
- var denots: PreDenotation = memberCache lookup name
- if (denots == null) {
- denots = computeMembersNamed(name)
- memberCache enter (name, denots)
- }
- denots
- }
+ final def membersNamed(name: Name)(implicit ctx: Context): PreDenotation =
+ if (Config.cacheMemberNames) {
+ var denots: PreDenotation = memberCache lookup name
+ if (denots == null) {
+ denots = computeMembersNamed(name)
+ memberCache enter (name, denots)
+ }
+ denots
+ } else computeMembersNamed(name)
private def computeMembersNamed(name: Name)(implicit ctx: Context): PreDenotation =
if (!classSymbol.hasChildren || (memberFingerPrint contains name)) {