-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[sbt-bridge] Bump Zinc to 1.4.3 and upgrade to CompilerInterface2 #10607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,25 +266,32 @@ object Contexts { | |
base.sources.getOrElseUpdate(file, new SourceFile(file, codec)) | ||
} | ||
|
||
/** Sourcefile with given path name, memoized */ | ||
def getSource(path: TermName): SourceFile = base.sourceNamed.get(path) match { | ||
case Some(source) => | ||
source | ||
case None => try { | ||
val f = new PlainFile(Path(path.toString)) | ||
val src = getSource(f) | ||
base.sourceNamed(path) = src | ||
src | ||
} catch { | ||
case ex: InvalidPathException => | ||
report.error(s"invalid file path: ${ex.getMessage}") | ||
NoSource | ||
} | ||
} | ||
/** SourceFile with given path name, memoized */ | ||
def getSource(path: TermName): SourceFile = getFile(path) match | ||
case NoAbstractFile => NoSource | ||
case file => getSource(file) | ||
|
||
/** Sourcefile with given path, memoized */ | ||
/** SourceFile with given path, memoized */ | ||
def getSource(path: String): SourceFile = getSource(path.toTermName) | ||
|
||
/** AbstraFile with given path name, memoized */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the memoization needed here? Does the Scala 2 compiler bridge do something similar? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following our private discussion I try to remove |
||
def getFile(name: TermName): AbstractFile = base.files.get(name) match | ||
case Some(file) => | ||
file | ||
case None => | ||
try | ||
val file = new PlainFile(Path(name.toString)) | ||
base.files(name) = file | ||
file | ||
catch | ||
case ex: InvalidPathException => | ||
report.error(s"invalid file path: ${ex.getMessage}") | ||
NoAbstractFile | ||
|
||
/** AbstractFile with given path, memoized */ | ||
def getFile(name: String): AbstractFile = getFile(name.toTermName) | ||
|
||
|
||
private var related: SimpleIdentityMap[Phase | SourceFile, Context] = null | ||
|
||
private def lookup(key: Phase | SourceFile): Context = | ||
|
@@ -841,9 +848,9 @@ object Contexts { | |
private var _nextSymId: Int = 0 | ||
def nextSymId: Int = { _nextSymId += 1; _nextSymId } | ||
|
||
/** Sources that were loaded */ | ||
/** Sources and Files that were loaded */ | ||
val sources: util.HashMap[AbstractFile, SourceFile] = util.HashMap[AbstractFile, SourceFile]() | ||
val sourceNamed: util.HashMap[TermName, SourceFile] = util.HashMap[TermName, SourceFile]() | ||
val files: util.HashMap[TermName, AbstractFile] = util.HashMap() | ||
|
||
// Types state | ||
/** A table for hash consing unique types */ | ||
|
@@ -927,7 +934,7 @@ object Contexts { | |
emptyWildcardBounds = null | ||
errorTypeMsg.clear() | ||
sources.clear() | ||
sourceNamed.clear() | ||
files.clear() | ||
comparers.clear() // forces re-evaluation of top and bottom classes in TypeComparer | ||
|
||
// Test that access is single threaded | ||
|
Uh oh!
There was an error while loading. Please reload this page.