diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-05-30 19:25:14 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-06-06 14:34:57 +1000 |
commit | 037a089ad4fb7137513777ccda6d47e30e151838 (patch) | |
tree | b1ffe6d682ec24d7872967d8dfdd64ed5158f521 /test | |
parent | 1f812e9482855d3fd5a8a5e9118942dc80f22db5 (diff) | |
download | scala-037a089ad4fb7137513777ccda6d47e30e151838.tar.gz scala-037a089ad4fb7137513777ccda6d47e30e151838.tar.bz2 scala-037a089ad4fb7137513777ccda6d47e30e151838.zip |
Store source file paths of classes being compiled in the bytecode repo
For classes being compiled (vs. being loaded from classfiles), keep the
source file path in the bytecode repo. This will allow to keep line
numbers when inlining from one class into another in case the two are
defined in the same compilation unit.
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/InlinerIllegalAccessTest.scala | 2 | ||||
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerIllegalAccessTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerIllegalAccessTest.scala index 3cb1fbdae6..3e0b889e9c 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerIllegalAccessTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerIllegalAccessTest.scala @@ -19,7 +19,7 @@ class InlinerIllegalAccessTest extends BytecodeTesting { import compiler._ import global.genBCode.bTypes._ - def addToRepo(cls: List[ClassNode]): Unit = for (c <- cls) byteCodeRepository.add(c, ByteCodeRepository.Classfile) + def addToRepo(cls: List[ClassNode]): Unit = for (c <- cls) byteCodeRepository.add(c, None) def assertEmpty(ins: Option[AbstractInsnNode]) = for (i <- ins) throw new AssertionError(textify(i)) diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala index 02cd632af1..4023f1fd3a 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala @@ -43,7 +43,7 @@ class InlinerTest extends BytecodeTesting { // Use the class nodes stored in the byteCodeRepository. The ones returned by compileClasses are not the same, // these are created new from the classfile byte array. They are completely separate instances which cannot // be used to look up methods / callsites in the callGraph hash maps for example. - byteCodeRepository.compilingClasses.valuesIterator.toList.sortBy(_.name) + byteCodeRepository.compilingClasses.valuesIterator.map(_._1).toList.sortBy(_.name) } def checkCallsite(callsite: callGraph.Callsite, callee: MethodNode) = { |