-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove usages of K source and location classes (#1002)
Part of: #999 We are currently working on removing the reverse dependency that the LLVM backend has on the K frontend's data structures; this PR takes a step towards that goal by removing the backend's use of the K Source and Location classes. These classes are only ever used in the matching compiler as simple PODs that carry around data, so they can be replaced trivially with Java classes here. This PR needs a matching change to the K frontend to work, along with appropriate lockstep merging. Also contains a minor fix in 4b644b0 for an edge case in the exhaustiveness checker for rules with no location; we want to propagate an empty optional here rather than `null`.
- Loading branch information
Showing
6 changed files
with
50 additions
and
17 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
matching/src/main/java/org/kframework/backend/llvm/matching/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.kframework.backend.llvm.matching; | ||
|
||
public class Location { | ||
int startLine; | ||
int endLine; | ||
int startColumn; | ||
int endColumn; | ||
|
||
public Location(int startLine, int endLine, int startColumn, int endColumn) { | ||
this.startLine = startLine; | ||
this.endLine = endLine; | ||
this.startColumn = startColumn; | ||
this.endColumn = endColumn; | ||
} | ||
|
||
public int getStartLine() { | ||
return startLine; | ||
} | ||
|
||
public int getEndLine() { | ||
return endLine; | ||
} | ||
|
||
public int getStartColumn() { | ||
return startColumn; | ||
} | ||
|
||
public int getEndColumn() { | ||
return endColumn; | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
matching/src/main/java/org/kframework/backend/llvm/matching/MatchingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
matching/src/main/java/org/kframework/backend/llvm/matching/Source.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.kframework.backend.llvm.matching; | ||
|
||
public class Source { | ||
String source; | ||
|
||
public Source(String source) { | ||
this.source = source; | ||
} | ||
|
||
public String getSource() { | ||
return source; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
matching/src/main/scala/org/kframework/backend/llvm/matching/pattern/SortCategory.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters