Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Be explicit about empty param list calls.

With the exception of toString and the odd JavaBean getter.
  • Loading branch information...
commit e7ab2f4a978e244cdd4c8c03170caa2a44c7adea 1 parent d1b16c4
@retronym retronym authored
Showing with 390 additions and 390 deletions.
  1. +1 −1  src/compiler/scala/tools/ant/Same.scala
  2. +6 −6 src/compiler/scala/tools/ant/ScalaTool.scala
  3. +1 −1  src/compiler/scala/tools/ant/Scalac.scala
  4. +1 −1  src/compiler/scala/tools/nsc/CompileServer.scala
  5. +2 −2 src/compiler/scala/tools/nsc/ConsoleWriter.scala
  6. +1 −1  src/compiler/scala/tools/nsc/EvalLoop.scala
  7. +10 −10 src/compiler/scala/tools/nsc/Global.scala
  8. +1 −1  src/compiler/scala/tools/nsc/Main.scala
  9. +2 −2 src/compiler/scala/tools/nsc/MainTokenMetric.scala
  10. +1 −1  src/compiler/scala/tools/nsc/PhaseAssembly.scala
  11. +3 −3 src/compiler/scala/tools/nsc/ast/Printers.scala
  12. +5 −5 src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
  13. +22 −22 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
  14. +5 −5 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  15. +5 −5 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
  16. +31 −31 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
  17. +1 −1  src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala
  18. +2 −2 src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
  19. +6 −6 src/compiler/scala/tools/nsc/backend/icode/Members.scala
  20. +12 −12 src/compiler/scala/tools/nsc/backend/icode/Printers.scala
  21. +2 −2 src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala
  22. +4 −4 src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala
  23. +21 −21 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
  24. +2 −2 src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala
  25. +4 −4 src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
  26. +3 −3 src/compiler/scala/tools/nsc/backend/opt/InlineExceptionHandlers.scala
  27. +10 −10 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
  28. +1 −1  src/compiler/scala/tools/nsc/dependencies/Changes.scala
  29. +1 −1  src/compiler/scala/tools/nsc/doc/DocFactory.scala
  30. +1 −1  src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
  31. +1 −1  src/compiler/scala/tools/nsc/doc/doclet/Generator.scala
  32. +1 −1  src/compiler/scala/tools/nsc/doc/html/Doclet.scala
  33. +1 −1  src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
  34. +1 −1  src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
  35. +3 −3 src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
  36. +1 −1  src/compiler/scala/tools/nsc/interactive/REPL.scala
  37. +1 −1  src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala
  38. +2 −2 src/compiler/scala/tools/nsc/interpreter/ILoop.scala
  39. +1 −1  src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
  40. +2 −2 src/compiler/scala/tools/nsc/io/Jar.scala
  41. +54 −54 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
  42. +101 −101 src/compiler/scala/tools/nsc/javac/JavaScanners.scala
  43. +2 −2 src/compiler/scala/tools/nsc/plugins/Plugins.scala
  44. +3 −3 src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala
  45. +2 −2 src/compiler/scala/tools/nsc/settings/MutableSettings.scala
  46. +3 −3 src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
  47. +6 −6 src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
  48. +2 −2 src/compiler/scala/tools/nsc/transform/CleanUp.scala
  49. +2 −2 src/compiler/scala/tools/nsc/transform/Constructors.scala
  50. +2 −2 src/compiler/scala/tools/nsc/transform/Erasure.scala
  51. +1 −1  src/compiler/scala/tools/nsc/transform/Mixin.scala
  52. +2 −2 src/compiler/scala/tools/nsc/transform/OverridingPairs.scala
  53. +6 −6 src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
  54. +1 −1  src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
  55. +1 −1  src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
  56. +1 −1  src/compiler/scala/tools/nsc/typechecker/Infer.scala
  57. +3 −3 src/compiler/scala/tools/nsc/typechecker/Macros.scala
  58. +1 −1  src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
  59. +2 −2 src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala
  60. +4 −4 src/compiler/scala/tools/nsc/typechecker/Typers.scala
  61. +2 −2 src/compiler/scala/tools/nsc/util/ClassPath.scala
  62. +1 −1  src/compiler/scala/tools/nsc/util/ShowPickled.scala
  63. +1 −1  src/compiler/scala/tools/reflect/MacroImplementations.scala
  64. +3 −3 src/compiler/scala/tools/util/Javap.scala
  65. +1 −1  src/compiler/scala/tools/util/PathResolver.scala
  66. +2 −2 src/compiler/scala/tools/util/SocketServer.scala
View
2  src/compiler/scala/tools/ant/Same.scala
@@ -110,7 +110,7 @@ class Same extends ScalaMatchingTask {
\*============================================================================*/
override def execute() = {
- validateAttributes
+ validateAttributes()
val mapper = getMapper
allEqualNow = true
val originNames: Array[String] = getDirectoryScanner(origin.get).getIncludedFiles
View
12 src/compiler/scala/tools/ant/ScalaTool.scala
@@ -190,13 +190,13 @@ class ScalaTool extends ScalaMatchingTask {
val builder = new StringBuilder()
while (chars.hasNext) {
- val char = chars.next
+ val char = chars.next()
if (char == '@') {
- var char = chars.next
+ var char = chars.next()
val token = new StringBuilder()
while (chars.hasNext && char != '@') {
token.append(char)
- char = chars.next
+ char = chars.next()
}
if (token.toString == "")
builder.append('@')
@@ -212,13 +212,13 @@ class ScalaTool extends ScalaMatchingTask {
val builder = new StringBuilder()
while (chars.hasNext) {
- val char = chars.next
+ val char = chars.next()
if (char == '@') {
- var char = chars.next
+ var char = chars.next()
val token = new StringBuilder()
while (chars.hasNext && char != '@') {
token.append(char)
- char = chars.next
+ char = chars.next()
}
if (tokens.contains(token.toString))
builder.append(tokens(token.toString))
View
2  src/compiler/scala/tools/ant/Scalac.scala
@@ -676,7 +676,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
file
}
- val res = execWithArgFiles(java, List(writeSettings.getAbsolutePath))
+ val res = execWithArgFiles(java, List(writeSettings().getAbsolutePath))
if (failonerror && res != 0)
buildError("Compilation failed because of an internal compiler error;"+
" see the error output for details.")
View
2  src/compiler/scala/tools/nsc/CompileServer.scala
@@ -157,7 +157,7 @@ class StandardCompileServer extends SocketServer {
}
}
reporter.printSummary()
- if (isMemoryFullEnough) {
+ if (isMemoryFullEnough()) {
info("Nulling out compiler due to memory utilization.")
clearCompiler()
}
View
4 src/compiler/scala/tools/nsc/ConsoleWriter.scala
@@ -13,9 +13,9 @@ import java.io.Writer
* @version 1.0
*/
class ConsoleWriter extends Writer {
- def close = flush
+ def close() = flush()
- def flush = Console.flush
+ def flush() = Console.flush()
def write(cbuf: Array[Char], off: Int, len: Int) {
if (len > 0)
View
2  src/compiler/scala/tools/nsc/EvalLoop.scala
@@ -14,7 +14,7 @@ trait EvalLoop {
def loop(action: (String) => Unit) {
@tailrec def inner() {
Console.print(prompt)
- val line = try Console.readLine catch { case _: EOFException => null }
+ val line = try Console.readLine() catch { case _: EOFException => null }
if (line != null && line != "") {
action(line)
inner()
View
20 src/compiler/scala/tools/nsc/Global.scala
@@ -409,7 +409,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
currentRun.informUnitStarting(this, unit)
apply(unit)
}
- currentRun.advanceUnit
+ currentRun.advanceUnit()
} finally {
//assert(currentUnit == unit)
currentRun.currentUnit = unit0
@@ -1200,7 +1200,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
// Flush the cache in the terminal phase: the chain could have been built
// before without being used. (This happens in the interpreter.)
- terminal.reset
+ terminal.reset()
// Each subcomponent supplies a phase, which are chained together.
// If -Ystop:phase is given, neither that phase nor any beyond it is added.
@@ -1283,14 +1283,14 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def advancePhase() {
unitc = 0
phasec += 1
- refreshProgress
+ refreshProgress()
}
/** take note that a phase on a unit is completed
* (for progress reporting)
*/
def advanceUnit() {
unitc += 1
- refreshProgress
+ refreshProgress()
}
def cancel() { reporter.cancelled = true }
@@ -1400,8 +1400,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if (canCheck) {
phase = globalPhase
- if (globalPhase.id >= icodePhase.id) icodeChecker.checkICodes
- else treeChecker.checkTrees
+ if (globalPhase.id >= icodePhase.id) icodeChecker.checkICodes()
+ else treeChecker.checkTrees()
}
}
@@ -1451,7 +1451,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
}
else {
- allConditionalWarnings foreach (_.summarize)
+ allConditionalWarnings foreach (_.summarize())
if (seenMacroExpansionsFallingBack)
warning("some macros could not be expanded and code fell back to overridden methods;"+
@@ -1502,7 +1502,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
while (globalPhase.hasNext && !reporter.hasErrors) {
val startTime = currentTime
phase = globalPhase
- globalPhase.run
+ globalPhase.run()
// progress update
informTime(globalPhase.description, startTime)
@@ -1542,7 +1542,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if (settings.Ystatistics.value)
statistics.print(phase)
- advancePhase
+ advancePhase()
}
if (traceSymbolActivity)
@@ -1602,7 +1602,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
val maxId = math.max(globalPhase.id, typerPhase.id)
firstPhase.iterator takeWhile (_.id < maxId) foreach (ph =>
enteringPhase(ph)(ph.asInstanceOf[GlobalPhase] applyPhase unit))
- refreshProgress
+ refreshProgress()
}
}
View
2  src/compiler/scala/tools/nsc/Main.scala
@@ -38,7 +38,7 @@ object Main extends Driver with EvalLoop {
case Some(ex) => reporter.cancelled = true // Causes exit code to be non-0
case None => reporter.reset() // Causes other compiler errors to be ignored
}
- askShutdown
+ askShutdown()
false
}
else true
View
4 src/compiler/scala/tools/nsc/MainTokenMetric.scala
@@ -21,11 +21,11 @@ object MainTokenMetric {
var totale = 0
for (source <- fnames) {
val s = new UnitScanner(new CompilationUnit(compiler.getSourceFile(source)))
- s.nextToken
+ s.nextToken()
var i = 0
while (s.token != EOF) {
i += 1
- s.nextToken
+ s.nextToken()
}
Console.println(i.toString + " " + source.toString())
totale += i
View
2  src/compiler/scala/tools/nsc/PhaseAssembly.scala
@@ -165,7 +165,7 @@ trait PhaseAssembly {
} else {
val promote = hl.to.before.filter(e => (!e.hard))
- hl.to.before.clear
+ hl.to.before.clear()
sanity foreach (edge => hl.to.before += edge)
for (edge <- promote) {
rerun = true
View
6 src/compiler/scala/tools/nsc/ast/Printers.scala
@@ -152,7 +152,7 @@ trait Printers extends scala.reflect.internal.Printers { this: Global =>
// If thenp or elsep has only one statement, it doesn't need more than one line.
case If(cond, thenp, elsep) =>
def ifIndented(x: Tree) = {
- indent ; println() ; printTree(x) ; undent
+ indent() ; println() ; printTree(x) ; undent()
}
val List(thenStmts, elseStmts) = List(thenp, elsep) map allStatements
@@ -166,12 +166,12 @@ trait Printers extends scala.reflect.internal.Printers { this: Global =>
if (elseStmts.nonEmpty) {
print(" else")
- indent ; println()
+ indent() ; println()
elseStmts match {
case List(x) => printTree(x)
case _ => printTree(elsep)
}
- undent ; println()
+ undent() ; println()
}
case _ => s()
}
View
10 src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
@@ -59,7 +59,7 @@ abstract class TreeBrowsers {
frame.createFrame(lock)
// wait for the frame to be closed
- lock.acquire
+ lock.acquire()
t
}
@@ -81,7 +81,7 @@ abstract class TreeBrowsers {
frame.createFrame(lock)
// wait for the frame to be closed
- lock.acquire
+ lock.acquire()
}
}
@@ -182,13 +182,13 @@ abstract class TreeBrowsers {
* especially symbols/types would change while the window is visible.
*/
def createFrame(lock: Lock): Unit = {
- lock.acquire // keep the lock until the user closes the window
+ lock.acquire() // keep the lock until the user closes the window
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE)
frame.addWindowListener(new WindowAdapter() {
/** Release the lock, so compilation may resume after the window is closed. */
- override def windowClosed(e: WindowEvent): Unit = lock.release
+ override def windowClosed(e: WindowEvent): Unit = lock.release()
});
jTree = new JTree(treeModel) {
@@ -251,7 +251,7 @@ abstract class TreeBrowsers {
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Q, menuKey + shiftKey, false))
override def actionPerformed(e: ActionEvent) {
closeWindow()
- global.currentRun.cancel
+ global.currentRun.cancel()
}
}
)
View
44 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
@@ -99,7 +99,7 @@ trait MarkupParsers {
*/
def xCheckEmbeddedBlock: Boolean = {
// attentions, side-effect, used in xText
- xEmbeddedBlock = (ch == '{') && { nextch; (ch != '{') }
+ xEmbeddedBlock = (ch == '{') && { nextch(); (ch != '{') }
xEmbeddedBlock
}
@@ -115,7 +115,7 @@ trait MarkupParsers {
while (isNameStart(ch)) {
val start = curOffset
val key = xName
- xEQ
+ xEQ()
val mid = curOffset
val value: Tree = ch match {
case '"' | '\'' =>
@@ -128,7 +128,7 @@ trait MarkupParsers {
}
case '{' =>
- nextch
+ nextch()
xEmbeddedExpr
case SU =>
throw TruncatedXMLControl
@@ -141,7 +141,7 @@ trait MarkupParsers {
aMap(key) = value
if (ch != '/' && ch != '>')
- xSpace
+ xSpace()
}
aMap
}
@@ -184,10 +184,10 @@ trait MarkupParsers {
* @precond ch == '&'
*/
def content_AMP(ts: ArrayBuffer[Tree]) {
- nextch
+ nextch()
val toAppend = ch match {
case '#' => // CharacterRef
- nextch
+ nextch()
val theChar = handle.text(tmppos, xCharRef)
xToken(';')
theChar
@@ -216,8 +216,8 @@ trait MarkupParsers {
return true // end tag
val toAppend = ch match {
- case '!' => nextch ; if (ch =='[') xCharData else xComment // CDATA or Comment
- case '?' => nextch ; xProcInstr // PI
+ case '!' => nextch() ; if (ch =='[') xCharData else xComment // CDATA or Comment
+ case '?' => nextch() ; xProcInstr // PI
case _ => element // child node
}
@@ -234,7 +234,7 @@ trait MarkupParsers {
tmppos = o2p(curOffset)
ch match {
// end tag, cdata, comment, pi or child node
- case '<' => nextch ; if (content_LT(ts)) return ts
+ case '<' => nextch() ; if (content_LT(ts)) return ts
// either the character '{' or an embedded scala block }
case '{' => content_BRACE(tmppos, ts) // }
// EntityRef or CharRef
@@ -266,7 +266,7 @@ trait MarkupParsers {
debugLastStartElement.push((start, qname))
val ts = content
xEndTag(qname)
- debugLastStartElement.pop
+ debugLastStartElement.pop()
val pos = r2p(start, start, curOffset)
qname match {
case "xml:group" => handle.group(pos, ts)
@@ -285,12 +285,12 @@ trait MarkupParsers {
while (ch != SU) {
if (ch == '}') {
- if (charComingAfter(nextch) == '}') nextch
+ if (charComingAfter(nextch()) == '}') nextch()
else errorBraces()
}
buf append ch
- nextch
+ nextch()
if (xCheckEmbeddedBlock || ch == '<' || ch == '&')
return done
}
@@ -337,12 +337,12 @@ trait MarkupParsers {
content_LT(ts)
// parse more XML ?
- if (charComingAfter(xSpaceOpt) == '<') {
- xSpaceOpt
+ if (charComingAfter(xSpaceOpt()) == '<') {
+ xSpaceOpt()
while (ch == '<') {
- nextch
+ nextch()
ts append element
- xSpaceOpt
+ xSpaceOpt()
}
handle.makeXMLseq(r2p(start, start, curOffset), ts)
}
@@ -363,7 +363,7 @@ trait MarkupParsers {
saving[Boolean, Tree](handle.isPattern, handle.isPattern = _) {
handle.isPattern = true
val tree = xPattern
- xSpaceOpt
+ xSpaceOpt()
tree
}
},
@@ -401,10 +401,10 @@ trait MarkupParsers {
val start = curOffset
val qname = xName
debugLastStartElement.push((start, qname))
- xSpaceOpt
+ xSpaceOpt()
val ts = new ArrayBuffer[Tree]
- val isEmptyTag = (ch == '/') && { nextch ; true }
+ val isEmptyTag = (ch == '/') && { nextch() ; true }
xToken('>')
if (!isEmptyTag) {
@@ -414,13 +414,13 @@ trait MarkupParsers {
if (xEmbeddedBlock) ts ++= xScalaPatterns
else ch match {
case '<' => // tag
- nextch
+ nextch()
if (ch != '/') ts append xPattern // child
else return false // terminate
case '{' => // embedded Scala patterns
while (ch == '{') {
- nextch
+ nextch()
ts ++= xScalaPatterns
}
assert(!xEmbeddedBlock, "problem with embedded block")
@@ -438,7 +438,7 @@ trait MarkupParsers {
while (doPattern) { } // call until false
xEndTag(qname)
- debugLastStartElement.pop
+ debugLastStartElement.pop()
}
handle.makeXMLpat(r2p(start, start, curOffset), qname, ts)
View
10 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1519,7 +1519,7 @@ self =>
placeholderParams = param :: placeholderParams
id
case LPAREN =>
- atPos(in.offset)(makeParens(commaSeparated(expr)))
+ atPos(in.offset)(makeParens(commaSeparated(expr())))
case LBRACE =>
canApply = false
blockExpr()
@@ -2482,7 +2482,7 @@ self =>
* }}}
*/
def funDefOrDcl(start : Int, mods: Modifiers): Tree = {
- in.nextToken
+ in.nextToken()
if (in.token == THIS) {
atPos(start, in.skipToken()) {
val vparamss = paramClauses(nme.CONSTRUCTOR, classContextBounds map (_.duplicate), ofCaseClass = false)
@@ -2644,7 +2644,7 @@ self =>
* }}}
*/
def classDef(start: Int, mods: Modifiers): ClassDef = {
- in.nextToken
+ in.nextToken()
val nameOffset = in.offset
val name = identForType()
atPos(start, if (name == tpnme.ERROR) start else nameOffset) {
@@ -2684,7 +2684,7 @@ self =>
* }}}
*/
def objectDef(start: Int, mods: Modifiers): ModuleDef = {
- in.nextToken
+ in.nextToken()
val nameOffset = in.offset
val name = ident()
val tstart = in.offset
@@ -2790,7 +2790,7 @@ self =>
if (inScalaRootPackage && ScalaValueClassNames.contains(name))
Template(parents0, self, anyvalConstructor :: body)
else
- Template(anyrefParents, self, constrMods, vparamss, body, o2p(tstart))
+ Template(anyrefParents(), self, constrMods, vparamss, body, o2p(tstart))
}
}
View
10 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
@@ -366,7 +366,7 @@ trait Scanners extends ScannersCommon {
getOperatorRest()
}
}
- fetchLT
+ fetchLT()
case '~' | '!' | '@' | '#' | '%' |
'^' | '*' | '+' | '-' | /*'<' | */
'>' | '?' | ':' | '=' | '&' |
@@ -403,7 +403,7 @@ trait Scanners extends ScannersCommon {
}
getNumber()
}
- fetchZero
+ fetchZero()
case '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' =>
base = 10
getNumber()
@@ -444,7 +444,7 @@ trait Scanners extends ScannersCommon {
}
}
}
- fetchDoubleQuote
+ fetchDoubleQuote()
case '\'' =>
def fetchSingleQuote() = {
nextChar()
@@ -463,7 +463,7 @@ trait Scanners extends ScannersCommon {
}
}
}
- fetchSingleQuote
+ fetchSingleQuote()
case '.' =>
nextChar()
if ('0' <= ch && ch <= '9') {
@@ -512,7 +512,7 @@ trait Scanners extends ScannersCommon {
nextChar()
}
}
- fetchOther
+ fetchOther()
}
}
View
62 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -50,14 +50,14 @@ abstract class GenICode extends SubComponent {
var unit: CompilationUnit = NoCompilationUnit
override def run() {
- scalaPrimitives.init
+ scalaPrimitives.init()
classes.clear()
super.run()
}
override def apply(unit: CompilationUnit): Unit = {
this.unit = unit
- unit.icode.clear
+ unit.icode.clear()
informProgress("Generating icode for " + unit)
gen(unit.body)
this.unit = NoCompilationUnit
@@ -137,7 +137,7 @@ abstract class GenICode extends SubComponent {
else
ctx1.bb.closeWith(RETURN(m.returnType))
}
- if (!ctx1.bb.closed) ctx1.bb.close
+ if (!ctx1.bb.closed) ctx1.bb.close()
prune(ctx1.method)
} else
ctx1.method.setCode(NoCode)
@@ -186,7 +186,7 @@ abstract class GenICode extends SubComponent {
val thrownKind = toTypeKind(expr.tpe)
val ctx1 = genLoad(expr, ctx, thrownKind)
ctx1.bb.emit(THROW(expr.tpe.typeSymbol), expr.pos)
- ctx1.bb.enterIgnoreMode
+ ctx1.bb.enterIgnoreMode()
(ctx1, NothingReference)
}
@@ -335,7 +335,7 @@ abstract class GenICode extends SubComponent {
MONITOR_EXIT() setPos tree.pos,
THROW(ThrowableClass)
))
- exhCtx.bb.enterIgnoreMode
+ exhCtx.bb.enterIgnoreMode()
exhCtx
})), EmptyTree, tree)
@@ -349,9 +349,9 @@ abstract class GenICode extends SubComponent {
private def genLoadIf(tree: If, ctx: Context, expectedType: TypeKind): (Context, TypeKind) = {
val If(cond, thenp, elsep) = tree
- var thenCtx = ctx.newBlock
- var elseCtx = ctx.newBlock
- val contCtx = ctx.newBlock
+ var thenCtx = ctx.newBlock()
+ var elseCtx = ctx.newBlock()
+ val contCtx = ctx.newBlock()
genCond(cond, ctx, thenCtx, elseCtx)
@@ -434,7 +434,7 @@ abstract class GenICode extends SubComponent {
else if (isArrayOp(code))
genArrayOp(tree, ctx, code, expectedType)
else if (isLogicalOp(code) || isComparisonOp(code)) {
- val trueCtx, falseCtx, afterCtx = ctx.newBlock
+ val trueCtx, falseCtx, afterCtx = ctx.newBlock()
genCond(tree, ctx, trueCtx, falseCtx)
trueCtx.bb.emitOnly(
@@ -477,7 +477,7 @@ abstract class GenICode extends SubComponent {
val resCtx: Context = tree match {
case LabelDef(name, params, rhs) =>
def genLoadLabelDef = {
- val ctx1 = ctx.newBlock
+ val ctx1 = ctx.newBlock()
if (nme.isLoopHeaderLabel(name))
ctx1.bb.loopHeader = true
@@ -559,7 +559,7 @@ abstract class GenICode extends SubComponent {
// we have to run this without the same finalizer in
// the list, otherwise infinite recursion happens for
// finalizers that contain 'return'
- val fctx = finalizerCtx.newBlock
+ val fctx = finalizerCtx.newBlock()
ctx1.bb.closeWith(JUMP(fctx.bb))
ctx1 = genLoad(f1, fctx, UNIT)
}
@@ -572,7 +572,7 @@ abstract class GenICode extends SubComponent {
}
adapt(returnedKind, ctx1.method.returnType, ctx1, tree.pos)
ctx1.bb.emit(RETURN(ctx.method.returnType), tree.pos)
- ctx1.bb.enterIgnoreMode
+ ctx1.bb.enterIgnoreMode()
generatedType = expectedType
ctx1
}
@@ -750,7 +750,7 @@ abstract class GenICode extends SubComponent {
// (if it's not in ignore mode, double-closing is an error)
val ctx1 = genLoadLabelArguments(args, label, ctx)
ctx1.bb.emitOnly(if (label.anchored) JUMP(label.block) else PJUMP(label))
- ctx1.bb.enterIgnoreMode
+ ctx1.bb.enterIgnoreMode()
ctx1
} else if (isPrimitive(sym)) { // primitive method call
val (newCtx, resKind) = genPrimitiveOp(app, ctx, expectedType)
@@ -906,10 +906,10 @@ abstract class GenICode extends SubComponent {
genLoadLiteral
case Block(stats, expr) =>
- ctx.enterScope
+ ctx.enterScope()
var ctx1 = genStat(stats, ctx)
ctx1 = genLoad(expr, ctx1, expectedType)
- ctx1.exitScope
+ ctx1.exitScope()
ctx1
case Typed(Super(_, _), _) =>
@@ -948,7 +948,7 @@ abstract class GenICode extends SubComponent {
def genLoadMatch = {
debuglog("Generating SWITCH statement.");
val ctx1 = genLoad(selector, ctx, INT) // TODO: Java 7 allows strings in switches (so, don't assume INT and don't convert the literals using intValue)
- val afterCtx = ctx1.newBlock
+ val afterCtx = ctx1.newBlock()
var caseCtx: Context = null
generatedType = toTypeKind(tree.tpe)
@@ -958,7 +958,7 @@ abstract class GenICode extends SubComponent {
for (caze @ CaseDef(pat, guard, body) <- cases) {
assert(guard == EmptyTree, guard)
- val tmpCtx = ctx1.newBlock
+ val tmpCtx = ctx1.newBlock()
pat match {
case Literal(value) =>
tags = value.intValue :: tags
@@ -1053,7 +1053,7 @@ abstract class GenICode extends SubComponent {
// 3: invokevirtual #29; //Method scala/Predef$.$qmark$qmark$qmark:()Lscala/runtime/Nothing$;
// 6: athrow
// So this case tacks on the ahtrow which makes the JVM happy because class Nothing is declared as a subclass of Throwable
- case NothingReference => ctx.bb.emit(THROW(ThrowableClass)) ; ctx.bb.enterIgnoreMode
+ case NothingReference => ctx.bb.emit(THROW(ThrowableClass)) ; ctx.bb.enterIgnoreMode()
// TODO why do we have this case? It's saying if we have a throwable and a non-throwable is expected then we should emit a cast? Why would we get here?
case ThrowableReference if !(ThrowableClass.tpe <:< to.toType) => ctx.bb.emit(CHECK_CAST(to)) // downcast throwables
case _ =>
@@ -1397,7 +1397,7 @@ abstract class GenICode extends SubComponent {
lazy val rhs = args.head
def genZandOrZor(and: Boolean) = {
- val ctxInterm = ctx.newBlock
+ val ctxInterm = ctx.newBlock()
if (and) genCond(lhs, ctx, ctxInterm, elseCtx)
else genCond(lhs, ctx, thenCtx, ctxInterm)
@@ -1423,10 +1423,10 @@ abstract class GenICode extends SubComponent {
else if (isComparisonOp(code))
genComparisonOp(lhs, rhs, code)
else
- default
+ default()
}
- case _ => default
+ case _ => default()
}
}
@@ -1495,11 +1495,11 @@ abstract class GenICode extends SubComponent {
} else {
val eqEqTempLocal = getTempLocal
var ctx1 = genLoad(l, ctx, ObjectReference)
- lazy val nonNullCtx = ctx1.newBlock
+ lazy val nonNullCtx = ctx1.newBlock()
// l == r -> if (l eq null) r eq null else l.equals(r)
ctx1 = genLoad(r, ctx1, ObjectReference)
- val nullCtx = ctx1.newBlock
+ val nullCtx = ctx1.newBlock()
ctx1.bb.emitOnly(
STORE_LOCAL(eqEqTempLocal) setPos l.pos,
@@ -1833,13 +1833,13 @@ abstract class GenICode extends SubComponent {
ctx1.bb = ctx1.method.startBlock
ctx1.defdef = d
ctx1.scope = EmptyScope
- ctx1.enterScope
+ ctx1.enterScope()
ctx1
}
/** Return a new context for a new basic block. */
def newBlock(): Context = {
- val block = method.code.newBlock
+ val block = method.code.newBlock()
handlers foreach (_ addCoveredBlock block)
currentExceptionHandlers foreach (_ addBlock block)
block.varsInScope.clear()
@@ -1886,7 +1886,7 @@ abstract class GenICode extends SubComponent {
*/
private def enterExceptionHandler(exh: ExceptionHandler): Context = {
currentExceptionHandlers ::= exh
- val ctx = newBlock
+ val ctx = newBlock()
exh.setStartBlock(ctx.bb)
ctx
}
@@ -1929,7 +1929,7 @@ abstract class GenICode extends SubComponent {
val outerCtx = this.dup // context for generating exception handlers, covered by finalizer
val finalizerCtx = this.dup // context for generating finalizer handler
- val afterCtx = outerCtx.newBlock
+ val afterCtx = outerCtx.newBlock()
var tmp: Local = null
val kind = toTypeKind(tree.tpe)
val guardResult = kind != UNIT && mayCleanStack(finalizer)
@@ -1943,7 +1943,7 @@ abstract class GenICode extends SubComponent {
}
def emitFinalizer(ctx: Context): Context = if (!finalizer.isEmpty) {
- val ctx1 = finalizerCtx.dup.newBlock
+ val ctx1 = finalizerCtx.dup.newBlock()
ctx.bb.closeWith(JUMP(ctx1.bb))
if (guardResult) {
@@ -1966,8 +1966,8 @@ abstract class GenICode extends SubComponent {
val ctx1 = genLoad(finalizer, ctx, UNIT);
ctx1.bb.emit(LOAD_LOCAL(exception));
ctx1.bb.emit(THROW(ThrowableClass));
- ctx1.bb.enterIgnoreMode;
- ctx1.bb.close
+ ctx1.bb.enterIgnoreMode();
+ ctx1.bb.close()
finalizerCtx.endHandler()
}
@@ -1983,7 +1983,7 @@ abstract class GenICode extends SubComponent {
outerCtx.endHandler()
}
- val bodyCtx = this.newBlock
+ val bodyCtx = this.newBlock()
if (finalizer != EmptyTree)
bodyCtx.addFinalizer(finalizer, finalizerCtx)
View
2  src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala
@@ -208,7 +208,7 @@ abstract class ICodeCheckers {
if (s1.length != s2.length) {
if (allUnits(s1) && allUnits(s2))
workaround("Ignoring mismatched boxed units")
- else if (isHandlerBlock)
+ else if (isHandlerBlock())
workaround("Ignoring mismatched stacks entering exception handler")
else
throw new CheckerException(incompatibleString)
View
4 src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
@@ -78,7 +78,7 @@ trait Linearizers {
}
}
- def dequeue: Elem = worklist.pop;
+ def dequeue: Elem = worklist.pop();
/**
* Prepend b to the list, if not already scheduled.
@@ -146,7 +146,7 @@ trait Linearizers {
def linearize(m: IMethod): List[BasicBlock] = {
blocks = Nil;
visited.clear()
- added.clear;
+ added.clear();
m.exh foreach (b => rpo(b.startBlock));
rpo(m.startBlock);
View
12 src/compiler/scala/tools/nsc/backend/icode/Members.scala
@@ -58,7 +58,7 @@ trait Members {
}
// Constructor code
- startBlock = newBlock
+ startBlock = newBlock()
def removeBlock(b: BasicBlock) {
if (settings.debug.value) {
@@ -155,7 +155,7 @@ trait Members {
class IMethod(val symbol: Symbol) extends IMember {
var code: Code = NoCode
- def newBlock() = code.newBlock
+ def newBlock() = code.newBlock()
def startBlock = code.startBlock
def lastBlock = { assert(blocks.nonEmpty, symbol); blocks.last }
def blocks = code.blocksList
@@ -232,7 +232,7 @@ trait Members {
var bb = code.startBlock
while (!nextBlock.isEmpty) {
if (nextBlock.isDefinedAt(bb)) {
- bb.open
+ bb.open()
var succ = bb
do {
succ = nextBlock(succ);
@@ -246,7 +246,7 @@ trait Members {
val oldTKs = lastInstr.consumedTypes
assert(lastInstr.consumed == oldTKs.size, "Someone forgot to override consumedTypes() in " + lastInstr)
- bb.removeLastInstruction
+ bb.removeLastInstruction()
for(tk <- oldTKs.reverse) { bb.emit(DROP(tk), lastInstr.pos) }
succ.toList foreach { i => bb.emit(i, i.pos) }
code.removeBlock(succ)
@@ -254,9 +254,9 @@ trait Members {
nextBlock -= bb
} while (nextBlock.isDefinedAt(succ))
- bb.close
+ bb.close()
} else
- bb = nextBlock.keysIterator.next
+ bb = nextBlock.keysIterator.next()
}
checkValid(this)
}
View
24 src/compiler/scala/tools/nsc/backend/icode/Printers.scala
@@ -28,7 +28,7 @@ trait Printers { self: ICodes =>
def println(s: String) {
print(s);
- println
+ println()
}
def println() {
@@ -55,12 +55,12 @@ trait Printers { self: ICodes =>
def printClass(cls: IClass) {
print(cls.symbol.toString()); print(" extends ");
printList(cls.symbol.info.parents, ", ");
- indent; println(" {");
+ indent(); println(" {");
println("// fields:");
- cls.fields.foreach(printField); println;
+ cls.fields.foreach(printField); println();
println("// methods");
cls.methods.foreach(printMethod);
- undent; println;
+ undent(); println();
println("}")
}
@@ -80,16 +80,16 @@ trait Printers { self: ICodes =>
println("locals: " + m.locals.mkString("", ", ", ""))
println("startBlock: " + m.startBlock)
println("blocks: " + m.code.blocks.mkString("[", ",", "]"))
- println
+ println()
lin.linearize(m) foreach printBlock
println("}")
- indent; println("Exception handlers: ")
+ indent(); println("Exception handlers: ")
m.exh foreach printExceptionHandler
- undent; println
+ undent(); println()
} else
- println
+ println()
}
def printParam(p: Local) {
@@ -98,10 +98,10 @@ trait Printers { self: ICodes =>
}
def printExceptionHandler(e: ExceptionHandler) {
- indent;
+ indent();
println("catch (" + e.cls.simpleName + ") in " + e.covered.toSeq.sortBy(_.label) + " starting at: " + e.startBlock);
println("consisting of blocks: " + e.blocks);
- undent;
+ undent();
println("with finalizer: " + e.finalizer);
// linearizer.linearize(e.startBlock) foreach printBlock;
}
@@ -111,9 +111,9 @@ trait Printers { self: ICodes =>
if (bb.loopHeader) print("[loop header]")
print(": ");
if (settings.debug.value) print("pred: " + bb.predecessors + " succs: " + bb.successors + " flags: " + bb.flagsString)
- indent; println
+ indent(); println()
bb.toList foreach printInstruction
- undent; println
+ undent(); println()
}
def printInstruction(i: Instruction) {
View
4 src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala
@@ -30,7 +30,7 @@ trait DataFlowAnalysis[L <: SemiLattice] {
/* Implement this function to initialize the worklist. */
def init(f: => Unit): Unit = {
iterations = 0
- in.clear; out.clear; worklist.clear; visited.clear;
+ in.clear(); out.clear(); worklist.clear(); visited.clear();
f
}
@@ -46,7 +46,7 @@ trait DataFlowAnalysis[L <: SemiLattice] {
while (!worklist.isEmpty) {
if (stat) iterations += 1
//Console.println("worklist in: " + worklist);
- val point = worklist.iterator.next; worklist -= point; visited += point;
+ val point = worklist.iterator.next(); worklist -= point; visited += point;
//Console.println("taking out point: " + point + " worklist out: " + worklist);
val output = f(point, in(point))
View
8 src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala
@@ -132,7 +132,7 @@ abstract class TypeFlowAnalysis {
}
def run() = {
- timer.start
+ timer.start()
// icodes.lubs0 = 0
forwardAnalysis(blockTransfer)
timer.stop
@@ -355,7 +355,7 @@ abstract class TypeFlowAnalysis {
override def run {
- timer.start
+ timer.start()
forwardAnalysis(blockTransfer)
timer.stop
@@ -601,7 +601,7 @@ abstract class TypeFlowAnalysis {
return;
}
- worklist.clear // calling reinit(f: => Unit) would also clear visited, thus forgetting about blocks visited before reinit.
+ worklist.clear() // calling reinit(f: => Unit) would also clear visited, thus forgetting about blocks visited before reinit.
// asserts conveying an idea what CFG shapes arrive here:
// staleIn foreach (p => assert( !in.isDefinedAt(p), p))
@@ -665,7 +665,7 @@ abstract class TypeFlowAnalysis {
override def forwardAnalysis(f: (P, lattice.Elem) => lattice.Elem): Unit = {
while (!worklist.isEmpty && relevantBBs.nonEmpty) {
if (stat) iterations += 1
- val point = worklist.iterator.next; worklist -= point;
+ val point = worklist.iterator.next(); worklist -= point;
if(relevantBBs(point)) {
shrinkedWatchlist = false
val output = f(point, in(point))
View
42 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -1618,7 +1618,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
if (isParcelableClass) { addCreatorCode(lastBlock) }
lastBlock emit RETURN(UNIT)
- lastBlock.close
+ lastBlock.close()
method = m
jmethod = clinitMethod
@@ -1798,8 +1798,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
}
def goTo(label: asm.Label) { jmethod.visitJumpInsn(Opcodes.GOTO, label) }
- def emitIF(cond: TestOp, label: asm.Label) { jmethod.visitJumpInsn(cond.opcodeIF, label) }
- def emitIF_ICMP(cond: TestOp, label: asm.Label) { jmethod.visitJumpInsn(cond.opcodeIFICMP, label) }
+ def emitIF(cond: TestOp, label: asm.Label) { jmethod.visitJumpInsn(cond.opcodeIF(), label) }
+ def emitIF_ICMP(cond: TestOp, label: asm.Label) { jmethod.visitJumpInsn(cond.opcodeIFICMP(), label) }
def emitIF_ACMP(cond: TestOp, label: asm.Label) {
assert((cond == EQ) || (cond == NE), cond)
val opc = (if(cond == EQ) Opcodes.IF_ACMPEQ else Opcodes.IF_ACMPNE)
@@ -2365,7 +2365,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
scoping.popScope(lv, end, instr.pos)
}
}
- genLocalInstr
+ genLocalInstr()
case icodes.stackCat =>
def genStackInstr() = (instr: @unchecked) match {
@@ -2389,7 +2389,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case LOAD_EXCEPTION(_) => ()
}
- genStackInstr
+ genStackInstr()
case icodes.constCat => genConstant(jmethod, instr.asInstanceOf[CONSTANT].constant)
@@ -2423,7 +2423,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
}
}
- genCastInstr
+ genCastInstr()
case icodes.objsCat =>
def genObjsInstr() = (instr: @unchecked) match {
@@ -2442,7 +2442,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case MONITOR_ENTER() => emit(Opcodes.MONITORENTER)
case MONITOR_EXIT() => emit(Opcodes.MONITOREXIT)
}
- genObjsInstr
+ genObjsInstr()
case icodes.fldsCat =>
def genFldsInstr() = (instr: @unchecked) match {
@@ -2463,7 +2463,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
jmethod.visitFieldInsn(opc, owner, fieldJName, fieldDescr)
}
- genFldsInstr
+ genFldsInstr()
case icodes.mthdsCat =>
def genMethodsInstr() = (instr: @unchecked) match {
@@ -2476,7 +2476,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case call @ CALL_METHOD(method, style) => genCallMethod(call)
}
- genMethodsInstr
+ genMethodsInstr()
case icodes.arraysCat =>
def genArraysInstr() = (instr: @unchecked) match {
@@ -2485,7 +2485,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case CREATE_ARRAY(elem, 1) => jcode newarray elem
case CREATE_ARRAY(elem, dims) => jmethod.visitMultiANewArrayInsn(descriptor(ArrayN(elem, dims)), dims)
}
- genArraysInstr
+ genArraysInstr()
case icodes.jumpsCat =>
def genJumpInstr() = (instr: @unchecked) match {
@@ -2535,7 +2535,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case CJUMP(success, failure, cond, kind) =>
if (kind.isIntSizedType) { // BOOL, BYTE, CHAR, SHORT, or INT
if (nextBlock == success) {
- jcode.emitIF_ICMP(cond.negate, labels(failure))
+ jcode.emitIF_ICMP(cond.negate(), labels(failure))
// .. and fall through to success label
} else {
jcode.emitIF_ICMP(cond, labels(success))
@@ -2543,7 +2543,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
}
} else if (kind.isRefOrArrayType) { // REFERENCE(_) | ARRAY(_)
if (nextBlock == success) {
- jcode.emitIF_ACMP(cond.negate, labels(failure))
+ jcode.emitIF_ACMP(cond.negate(), labels(failure))
// .. and fall through to success label
} else {
jcode.emitIF_ACMP(cond, labels(success))
@@ -2560,7 +2560,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
else emit(Opcodes.DCMPL)
}
if (nextBlock == success) {
- jcode.emitIF(cond.negate, labels(failure))
+ jcode.emitIF(cond.negate(), labels(failure))
// .. and fall through to success label
} else {
jcode.emitIF(cond, labels(success))
@@ -2571,7 +2571,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case CZJUMP(success, failure, cond, kind) =>
if (kind.isIntSizedType) { // BOOL, BYTE, CHAR, SHORT, or INT
if (nextBlock == success) {
- jcode.emitIF(cond.negate, labels(failure))
+ jcode.emitIF(cond.negate(), labels(failure))
} else {
jcode.emitIF(cond, labels(success))
if (nextBlock != failure) { jcode goTo labels(failure) }
@@ -2607,7 +2607,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
else emit(Opcodes.DCMPL)
}
if (nextBlock == success) {
- jcode.emitIF(cond.negate, labels(failure))
+ jcode.emitIF(cond.negate(), labels(failure))
} else {
jcode.emitIF(cond, labels(success))
if (nextBlock != failure) { jcode goTo labels(failure) }
@@ -2615,14 +2615,14 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
}
}
- genJumpInstr
+ genJumpInstr()
case icodes.retCat =>
def genRetInstr() = (instr: @unchecked) match {
case RETURN(kind) => jcode emitRETURN kind
case THROW(_) => emit(Opcodes.ATHROW)
}
- genRetInstr
+ genRetInstr()
}
}
@@ -2732,7 +2732,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
abort("Unknown arithmetic primitive " + primitive)
}
}
- genArith
+ genArith()
// TODO Logical's 2nd elem should be declared ValueTypeKind, to better approximate its allowed values (isIntSized, its comments appears to convey)
// TODO GenICode uses `toTypeKind` to define that elem, `toValueTypeKind` would be needed instead.
@@ -2764,7 +2764,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
if (kind != BOOL) { emitT2T(INT, kind) }
}
}
- genLogical
+ genLogical()
case Shift(op, kind) =>
def genShift() = op match {
@@ -2793,7 +2793,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
emitT2T(INT, kind)
}
}
- genShift
+ genShift()
case Comparison(op, kind) =>
def genCompare() = op match {
@@ -2813,7 +2813,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
}
}
- genCompare
+ genCompare()
case Conversion(src, dst) =>
debuglog("Converting from: " + src + " to: " + dst)
View
4 src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala
@@ -96,7 +96,7 @@ abstract class ClosureElimination extends SubComponent {
/* Some embryonic copy propagation. */
def analyzeMethod(m: IMethod): Unit = try {if (m.hasCode) {
cpp.init(m)
- cpp.run
+ cpp.run()
m.linearizedBlocks() foreach { bb =>
var info = cpp.in(bb)
@@ -200,7 +200,7 @@ abstract class ClosureElimination extends SubComponent {
def apply(m: IMethod): Unit = if (m.hasCode) {
liveness = new global.icodes.liveness.LivenessAnalysis
liveness.init(m)
- liveness.run
+ liveness.run()
m foreachBlock transformBlock
}
View
8 src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
@@ -106,7 +106,7 @@ abstract class DeadCodeElimination extends SubComponent {
def collectRDef(m: IMethod): Unit = if (m.hasCode) {
defs = immutable.HashMap.empty; worklist.clear(); useful.clear();
rdef.init(m);
- rdef.run;
+ rdef.run();
m foreachBlock { bb =>
useful(bb) = new mutable.BitSet(bb.size)
@@ -340,8 +340,8 @@ abstract class DeadCodeElimination extends SubComponent {
m foreachBlock { bb =>
debuglog(bb + ":")
val oldInstr = bb.toList
- bb.open
- bb.clear
+ bb.open()
+ bb.clear()
for (Pair(i, idx) <- oldInstr.zipWithIndex) {
if (useful(bb)(idx)) {
debuglog(" * " + i + " is useful")
@@ -374,7 +374,7 @@ abstract class DeadCodeElimination extends SubComponent {
}
}
- if (bb.nonEmpty) bb.close
+ if (bb.nonEmpty) bb.close()
else log(s"empty block encountered in $m")
}
}
View
6 src/compiler/scala/tools/nsc/backend/opt/InlineExceptionHandlers.scala
@@ -69,9 +69,9 @@ abstract class InlineExceptionHandlers extends SubComponent {
* -some exception handler duplicates expect the exception on the stack while others expect it in a local
* => Option[Local]
*/
- private val handlerCopies = perRunCaches.newMap[BasicBlock, Option[(Option[Local], BasicBlock)]]
+ private val handlerCopies = perRunCaches.newMap[BasicBlock, Option[(Option[Local], BasicBlock)]]()
/* This map is the inverse of handlerCopies, used to compute the stack of duplicate blocks */
- private val handlerCopiesInverted = perRunCaches.newMap[BasicBlock, (BasicBlock, TypeKind)]
+ private val handlerCopiesInverted = perRunCaches.newMap[BasicBlock, (BasicBlock, TypeKind)]()
private def handlerLocal(bb: BasicBlock): Option[Local] =
for (v <- handlerCopies get bb ; (local, block) <- v ; l <- local) yield l
@@ -357,7 +357,7 @@ abstract class InlineExceptionHandlers extends SubComponent {
}
val caughtException = toTypeKind(caughtClass.tpe)
// copy the exception handler code once again, dropping the LOAD_EXCEPTION
- val copy = handler.code.newBlock
+ val copy = handler.code.newBlock()
copy.emitOnly((handler.iterator drop dropCount).toSeq: _*)
// extend the handlers of the handler to the copy
View
20 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -242,7 +242,7 @@ abstract class Inliners extends SubComponent {
def clearCaches() {
// methods
NonPublicRefs.usesNonPublics.clear()
- recentTFAs.clear
+ recentTFAs.clear()
tfa.knownUnsafe.clear()
tfa.knownSafe.clear()
tfa.knownNever.clear()
@@ -363,7 +363,7 @@ abstract class Inliners extends SubComponent {
assert(ocm.method.isEffectivelyFinal && ocm.method.owner.isEffectivelyFinal)
if(analyzeInc(ocm, x, ocm.method.owner, -1, ocm.method)) {
inlineCount += 1
- break
+ break()
}
}
}
@@ -513,7 +513,7 @@ abstract class Inliners extends SubComponent {
for (cm <- cms; if tfa.remainingCALLs.isDefinedAt(cm)) {
val analysis.CallsiteInfo(_, receiver, stackLength, concreteMethod) = tfa.remainingCALLs(cm)
if (analyzeInc(cm, bb, receiver, stackLength, concreteMethod)) {
- break
+ break()
}
}
}
@@ -568,7 +568,7 @@ abstract class Inliners extends SubComponent {
warn(inlFail.pos, "At the end of the day, could not inline @inline-marked method " + inlFail.method.originalName.decode)
}
- m.normalize
+ m.normalize()
if (sizeBeforeInlining > 0) {
val instrAfterInlining = m.code.instructionCount
val inlinings = caller.inlinedCalls
@@ -811,7 +811,7 @@ abstract class Inliners extends SubComponent {
/** Add a new block in the current context. */
def newBlock() = {
- val b = caller.m.code.newBlock
+ val b = caller.m.code.newBlock()
activeHandlers foreach (_ addCoveredBlock b)
if (retVal ne null) b.varsInScope += retVal
b.varsInScope += inlinedThis
@@ -890,8 +890,8 @@ abstract class Inliners extends SubComponent {
}
// re-emit the instructions before the call
- block.open
- block.clear
+ block.open()
+ block.clear()
block emit instrBefore
// store the arguments into special locals
@@ -900,7 +900,7 @@ abstract class Inliners extends SubComponent {
// jump to the start block of the callee
blockEmit(JUMP(inlinedBlock(inc.m.startBlock)))
- block.close
+ block.close()
// duplicate the other blocks in the callee
val calleeLin = inc.m.linearizedBlocks()
@@ -923,11 +923,11 @@ abstract class Inliners extends SubComponent {
emitInlined(map(i))
info = if(hasRETURN) a.interpret(info, i) else null
}
- inlinedBlock(bb).close
+ inlinedBlock(bb).close()
}
afterBlock emit instrAfter
- afterBlock.close
+ afterBlock.close()
staleIn += afterBlock
splicedBlocks ++= (calleeLin map inlinedBlock)
View
2  src/compiler/scala/tools/nsc/dependencies/Changes.scala
@@ -168,7 +168,7 @@ abstract class Changes {
implicit val defaultStrictTypeRefTest = true
val to = toSym.info
- changedTypeParams.clear
+ changedTypeParams.clear()
def omitSymbols(s: Symbol): Boolean = !s.hasFlag(LOCAL | LIFTED | PRIVATE | SYNTHETIC)
val cs = new mutable.ListBuffer[Change]
View
2  src/compiler/scala/tools/nsc/doc/DocFactory.scala
@@ -118,7 +118,7 @@ class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor
}
case _ => ()
}
- docletInstance.generate
+ docletInstance.generate()
}
try generate()
View
2  src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
@@ -516,7 +516,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
else {
val s = summary()
val r =
- if (checkParaEnded) List(s) else List(s, inline(false))
+ if (checkParaEnded()) List(s) else List(s, inline(false))
summaryParsed = true
Paragraph(Chain(r))
}
View
2  src/compiler/scala/tools/nsc/doc/doclet/Generator.scala
@@ -21,7 +21,7 @@ abstract class Generator {
/** Outputs documentation (as a side effect). */
def generate(): Unit = {
assert(checks forall { check => check() })
- generateImpl
+ generateImpl()
}
/** Outputs documentation (as a side effect). This method is called only if all `checks` are true. */
View
2  src/compiler/scala/tools/nsc/doc/html/Doclet.scala
@@ -13,7 +13,7 @@ import doclet._
class Doclet extends Generator with Universer with Indexer {
def generateImpl() {
- new html.HtmlFactory(universe, index).generate
+ new html.HtmlFactory(universe, index).generate()
}
}
View
2  src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
@@ -111,7 +111,7 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) {
val p = "/scala/tools/nsc/doc/html/resource/" + subPath
val inputStream = getClass.getResourceAsStream(p)
assert(inputStream != null, p)
- }.toByteArray
+ }.toByteArray()
val dest = Directory(siteRoot) / subPath
dest.parent.createDirectory()
val out = dest.toFile.bufferedOutput()
View
2  src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
@@ -315,7 +315,7 @@ class DotDiagramGenerator(settings: doc.Settings) extends DiagramGenerator {
* Calls dot with a given dot string and returns the SVG output.
*/
private def generateSVG(dotInput: String, template: DocTemplateEntity) = {
- val dotOutput = DiagramGenerator.getDotRunner.feedToDot(dotInput, template)
+ val dotOutput = DiagramGenerator.getDotRunner().feedToDot(dotInput, template)
var tSVG = -System.currentTimeMillis
val result = if (dotOutput != null) {
View
6 src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -51,7 +51,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
}
_modelFinished = true
// complete the links between model entities, everthing that couldn't have been done before
- universe.rootPackage.completeModel
+ universe.rootPackage.completeModel()
Some(universe) filter (_.rootPackage != null)
}
@@ -382,7 +382,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
if (!sym.isAliasType && !sym.isAbstractType)
for (member <- members)
member match {
- case d: DocTemplateImpl => d.completeModel
+ case d: DocTemplateImpl => d.completeModel()
case _ =>
}
@@ -631,7 +631,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
import Streamable._
Path(settings.docRootContent.value) match {
case f : File => {
- val rootComment = closing(f.inputStream)(is => parse(slurp(is), "", NoPosition, Option(inTpl)))
+ val rootComment = closing(f.inputStream())(is => parse(slurp(is), "", NoPosition, Option(inTpl)))
Some(rootComment)
}
case _ => None
View
2  src/compiler/scala/tools/nsc/interactive/REPL.scala
@@ -65,7 +65,7 @@ object REPL {
def loop(action: (String) => Unit) {
Console.print(prompt)
try {
- val line = Console.readLine
+ val line = Console.readLine()
if (line.length() > 0) {
action(line)
}
View
2  src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala
@@ -163,7 +163,7 @@ trait ScratchPadMaker { self: Global =>
while (scanner.token != EOF) {
startOffset += scanner.offset
token += scanner.token
- scanner.nextToken
+ scanner.nextToken()
endOffset += scanner.lastOffset
}
View
4 src/compiler/scala/tools/nsc/interpreter/ILoop.scala
@@ -265,7 +265,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
else None
}
private def addToolsJarToLoader() = {
- val cl = findToolsJar match {
+ val cl = findToolsJar() match {
case Some(tools) => ScalaClassLoader.fromURLs(Seq(tools.toURL), intp.classLoader)
case _ => intp.classLoader
}
@@ -656,7 +656,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
foreach (intp quietRun _)
)
// classloader and power mode setup
- intp.setContextClassLoader
+ intp.setContextClassLoader()
if (isReplPower) {
replProps.power setValue true
unleashAndSetPhase()
View
2  src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
@@ -140,7 +140,7 @@ trait StructuredTypeStrings extends DestructureTypes {
def wrapAtom[U](value: U) = new TypeAtom(value)
}
- def show(tp: Type): String = intoNodes(tp).show
+ def show(tp: Type): String = intoNodes(tp).show()
}
View
4 src/compiler/scala/tools/nsc/io/Jar.scala
@@ -115,9 +115,9 @@ class JarWriter(val file: File, val manifest: Manifest) {
val buf = new Array[Byte](10240)
def loop(): Unit = in.read(buf, 0, buf.length) match {
case -1 => in.close()
- case n => out.write(buf, 0, n) ; loop
+ case n => out.write(buf, 0, n) ; loop()
}
- loop
+ loop()
}
def close() = out.close()
View
108 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
@@ -74,7 +74,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
nbraces += 1
case _ =>
}
- in.nextToken
+ in.nextToken()
}
}
@@ -148,7 +148,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
nbraces += 1
case _ =>
}
- in.nextToken
+ in.nextToken()
in.token match {
case RPAREN =>
nparens -= 1
@@ -163,7 +163,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
while (!(tokens contains in.token) && in.token != EOF) {
if (in.token == LBRACE) { skipAhead(); accept(RBRACE) }
else if (in.token == LPAREN) { skipAhead(); accept(RPAREN) }
- else in.nextToken
+ else in.nextToken()
}
}
@@ -180,7 +180,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
syntaxError(posToReport, msg, true)
}
- if (in.token == token) in.nextToken
+ if (in.token == token) in.nextToken()
pos
}
@@ -200,7 +200,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def ident(): Name =
if (in.token == IDENTIFIER) {
val name = in.name
- in.nextToken
+ in.nextToken()
name
} else {
accept(IDENTIFIER)
@@ -210,7 +210,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def repsep[T <: Tree](p: () => T, sep: Int): List[T] = {
val buf = ListBuffer[T](p())
while (in.token == sep) {
- in.nextToken
+ in.nextToken()
buf += p()
}
buf.toList
@@ -234,7 +234,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def qualId(): RefTree = {
var t: RefTree = atPos(in.currentPos) { Ident(ident()) }
while (in.token == DOT) {
- in.nextToken
+ in.nextToken()
t = atPos(in.currentPos) { Select(t, ident()) }
}
t
@@ -243,7 +243,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def optArrayBrackets(tpt: Tree): Tree =
if (in.token == LBRACKET) {
val tpt1 = atPos(in.pos) { arrayOf(tpt) }
- in.nextToken
+ in.nextToken()
accept(RBRACKET)
optArrayBrackets(tpt1)
} else tpt
@@ -251,21 +251,21 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def basicType(): Tree =
atPos(in.pos) {
in.token match {
- case BYTE => in.nextToken; TypeTree(ByteClass.tpe)
- case SHORT => in.nextToken; TypeTree(ShortClass.tpe)
- case CHAR => in.nextToken; TypeTree(CharClass.tpe)
- case INT => in.nextToken; TypeTree(IntClass.tpe)
- case LONG => in.nextToken; TypeTree(LongClass.tpe)
- case FLOAT => in.nextToken; TypeTree(FloatClass.tpe)
- case DOUBLE => in.nextToken; TypeTree(DoubleClass.tpe)
- case BOOLEAN => in.nextToken; TypeTree(BooleanClass.tpe)
+ case BYTE => in.nextToken(); TypeTree(ByteClass.tpe)
+ case SHORT => in.nextToken(); TypeTree(ShortClass.tpe)
+ case CHAR => in.nextToken(); TypeTree(CharClass.tpe)
+ case INT => in.nextToken(); TypeTree(IntClass.tpe)
+ case LONG => in.nextToken(); TypeTree(LongClass.tpe)
+ case FLOAT => in.nextToken(); TypeTree(FloatClass.tpe)
+ case DOUBLE => in.nextToken(); TypeTree(DoubleClass.tpe)
+ case BOOLEAN => in.nextToken(); TypeTree(BooleanClass.tpe)
case _ => syntaxError("illegal start of type", true); errorTypeTree
}
}
def typ(): Tree =
optArrayBrackets {
- if (in.token == FINAL) in.nextToken
+ if (in.token == FINAL) in.nextToken()
if (in.token == IDENTIFIER) {
var t = typeArgs(atPos(in.currentPos)(Ident(ident())))
// typeSelect generates Select nodes is the lhs is an Ident or Select,
@@ -278,7 +278,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
case _ => SelectFromTypeTree(t, name.toTypeName)
}
while (in.token == DOT) {
- in.nextToken
+ in.nextToken()
t = typeArgs(atPos(in.currentPos)(typeSelect(t, ident())))
}
convertToTypeId(t)
@@ -292,14 +292,14 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def typeArg(): Tree =
if (in.token == QMARK) {
val pos = in.currentPos
- in.nextToken
+ in.nextToken()
var lo: Tree = TypeTree(NothingClass.tpe)
var hi: Tree = TypeTree(AnyClass.tpe)
if (in.token == EXTENDS) {
- in.nextToken
+ in.nextToken()
hi = typ()
} else if (in.token == SUPER) {
- in.nextToken
+ in.nextToken()
lo = typ()
}
val tdef = atPos(pos) {
@@ -315,7 +315,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
typ()
}
if (in.token == LT) {
- in.nextToken
+ in.nextToken()
val t1 = convertToTypeId(t)
val args = repsep(typeArg, COMMA)
acceptClosingAngle()
@@ -330,7 +330,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def annotations(): List[Tree] = {
//var annots = new ListBuffer[Tree]
while (in.token == AT) {
- in.nextToken
+ in.nextToken()
annotation()
}
List() // don't pass on annotations for now
@@ -354,38 +354,38 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
while (true) {
in.token match {
case AT if (in.lookaheadToken != INTERFACE) =>
- in.nextToken
+ in.nextToken()
annotation()
case PUBLIC =>
isPackageAccess = false
- in.nextToken
+ in.nextToken()
case PROTECTED =>
flags |= Flags.PROTECTED
- in.nextToken
+ in.nextToken()
case PRIVATE =>
isPackageAccess = false
flags |= Flags.PRIVATE
- in.nextToken
+ in.nextToken()
case STATIC =>
flags |= Flags.STATIC
- in.nextToken
+ in.nextToken()
case ABSTRACT =>
flags |= Flags.ABSTRACT
- in.nextToken
+ in.nextToken()
case FINAL =>
flags |= Flags.FINAL
- in.nextToken
+ in.nextToken()
case NATIVE =>
addAnnot(NativeAttr)
- in.nextToken
+ in.nextToken()
case TRANSIENT =>
addAnnot(TransientAttr)
- in.nextToken
+ in.nextToken()
case VOLATILE =>
addAnnot(VolatileAttr)
- in.nextToken
+ in.nextToken()
case SYNCHRONIZED | STRICTFP =>
- in.nextToken
+ in.nextToken()
case _ =>
val privateWithin: TypeName =
if (isPackageAccess && !inInterface) thisPackageName
@@ -399,7 +399,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def typeParams(): List[TypeDef] =
if (in.token == LT) {
- in.nextToken
+ in.nextToken()
val tparams = repsep(typeParam, COMMA)
acceptClosingAngle()
tparams
@@ -410,7 +410,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val name = identForType()
val hi =
if (in.token == EXTENDS) {
- in.nextToken
+ in.nextToken()
bound()
} else {
scalaDot(tpnme.Any)
@@ -423,7 +423,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
atPos(in.currentPos) {
val buf = ListBuffer[Tree](typ())
while (in.token == AMP) {
- in.nextToken
+ in.nextToken()
buf += typ()
}
val ts = buf.toList
@@ -439,11 +439,11 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
}
def formalParam(): ValDef = {
- if (in.token == FINAL) in.nextToken
+ if (in.token == FINAL) in.nextToken()
annotations()
var t = typ()
if (in.token == DOTDOTDOT) {
- in.nextToken
+ in.nextToken()
t = atPos(t.pos) {
AppliedTypeTree(scalaDot(tpnme.JAVA_REPEATED_PARAM_CLASS_NAME), List(t))
}
@@ -453,7 +453,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def optThrows() {
if (in.token == THROWS) {
- in.nextToken
+ in.nextToken()
repsep(typ, COMMA)
}
}
@@ -472,7 +472,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val isVoid = in.token == VOID
var rtpt =
if (isVoid) {
- in.nextToken
+ in.nextToken()
TypeTree(UnitClass.tpe) setPos in.pos
} else typ()
var pos = in.currentPos
@@ -545,7 +545,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val buf = ListBuffer[Tree](varDecl(pos, mods, tpt, name.toTermName))
val maybe = new ListBuffer[Tree] // potential variable definitions.
while (in.token == COMMA) {
- in.nextToken
+ in.nextToken()
if (in.token == IDENTIFIER) { // if there's an ident after the comma ...
val name = ident()
if (in.token == ASSIGN || in.token == SEMI) { // ... followed by a `=` or `;`, we know it's a real variable definition
@@ -626,19 +626,19 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def collectIdents() : Int = {
if (in.token == ASTERISK) {
val starOffset = in.pos
- in.nextToken
+ in.nextToken()
buf += nme.WILDCARD
starOffset
} else {
val nameOffset = in.pos
buf += ident()
if (in.token == DOT) {
- in.nextToken
+ in.nextToken()
collectIdents()
} else nameOffset
}
}
- if (in.token == STATIC) in.nextToken
+ if (in.token == STATIC) in.nextToken()
else buf += nme.ROOTPKG
val lastnameOffset = collectIdents()
accept(SEMI)
@@ -659,7 +659,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def interfacesOpt() =
if (in.token == IMPLEMENTS) {
- in.nextToken
+ in.nextToken()
repsep(typ, COMMA)
} else {