Skip to content

Commit 5c8f0eb

Browse files
authored
Remove misleading CommonInst::method, remove unused common InstList (#333)
1 parent 4ba634a commit 5c8f0eb

File tree

6 files changed

+3
-49
lines changed

6 files changed

+3
-49
lines changed

jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/CommonInst.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ import org.jacodb.api.common.CommonMethod
2020

2121
interface CommonInst {
2222
val location: CommonInstLocation
23-
24-
val method: CommonMethod
25-
get() = location.method
2623
}
2724

2825
interface CommonInstLocation {

jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/InstList.kt

Lines changed: 0 additions & 38 deletions
This file was deleted.

jacodb-api-jvm/src/main/kotlin/org/jacodb/api/jvm/cfg/JcInst.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ interface JcInst : CommonInst {
5555
override val location: JcInstLocation
5656
val operands: List<JcExpr>
5757

58-
override val method: JcMethod
59-
get() = location.method
6058
val lineNumber: Int
6159
get() = location.lineNumber
6260

jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/JcBlockGraphImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class JcBlockGraphImpl(
109109
(block.start.index..block.end.index).map { jcGraph.instructions[it] }
110110

111111
override fun block(inst: JcInst): JcBasicBlock {
112-
assert(inst.method == jcGraph.method) {
113-
"required method of instruction ${jcGraph.method} but got ${inst.method}"
112+
assert(inst.location.method == jcGraph.method) {
113+
"required method of instruction ${jcGraph.method} but got ${inst.location.method}"
114114
}
115115
for (basicBlock in entries) {
116116
if (basicBlock.contains(inst)) {

jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Stmt.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ import org.jacodb.api.common.cfg.CommonReturnInst
2525
interface EtsStmt : CommonInst {
2626
override val location: EtsStmtLocation
2727

28-
override val method: EtsMethod
29-
get() = location.method
30-
3128
interface Visitor<out R> {
3229
fun visit(stmt: EtsNopStmt): R
3330
fun visit(stmt: EtsAssignStmt): R

jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/BlockCfgToDot.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fun InterproceduralCfg.toHighlightedDotWithCalls(
154154
val h = sanitize(stmt.hashCode())
155155
val clusterName = "cluster_${h}_B${parentBlock}"
156156
// method signature label
157-
val methodSig = cfg.entries.first().method.signature
157+
val methodSig = cfg.entries.first().location.method.signature
158158
// open subgraph
159159
lines += " subgraph \"$clusterName\" {"
160160
lines += " label=\"$methodSig\";"

0 commit comments

Comments
 (0)