Skip to content

Commit

Permalink
chore(gnovm): remove unused attributes (#3492)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl authored Jan 13, 2025
1 parent 36c8f0e commit ddfff60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 2 additions & 4 deletions gnovm/pkg/gnolang/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ const (
ATTR_TYPE_VALUE GnoAttribute = "ATTR_TYPE_VALUE"
ATTR_TYPEOF_VALUE GnoAttribute = "ATTR_TYPEOF_VALUE"
ATTR_IOTA GnoAttribute = "ATTR_IOTA"
ATTR_LOCATIONED GnoAttribute = "ATTR_LOCATIONE" // XXX DELETE
ATTR_GOTOLOOP_STMT GnoAttribute = "ATTR_GOTOLOOP_STMT" // XXX delete?
ATTR_LOOP_DEFINES GnoAttribute = "ATTR_LOOP_DEFINES" // []Name defined within loops.
ATTR_LOOP_USES GnoAttribute = "ATTR_LOOP_USES" // []Name loop defines actually used.
ATTR_LOOP_DEFINES GnoAttribute = "ATTR_LOOP_DEFINES" // []Name defined within loops.
ATTR_LOOP_USES GnoAttribute = "ATTR_LOOP_USES" // []Name loop defines actually used.
ATTR_SHIFT_RHS GnoAttribute = "ATTR_SHIFT_RHS"
ATTR_LAST_BLOCK_STMT GnoAttribute = "ATTR_LAST_BLOCK_STMT"
)
Expand Down
12 changes: 1 addition & 11 deletions gnovm/pkg/gnolang/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -2723,17 +2723,10 @@ func findGotoLoopDefines(ctx BlockNode, bn BlockNode) {
// Otherwise mark stmt as gotoloop.
case Stmt:
// we're done if we
// re-encounter origGotoStmtm.
// re-encounter origGotoStmt.
if n == origGoto {
n.SetAttribute(
ATTR_GOTOLOOP_STMT,
true)
return n, TRANS_EXIT // done
}
// otherwise set attribute.
n.SetAttribute(
ATTR_GOTOLOOP_STMT,
true)
return n, TRANS_CONTINUE
// Special case, maybe convert
// NameExprTypeDefine to
Expand Down Expand Up @@ -4804,9 +4797,6 @@ func setNodeLines(n Node) {
// based on sparse expectations on block nodes, and ensures uniqueness of BlockNode.Locations.
// Ensures uniqueness of BlockNode.Locations.
func setNodeLocations(pkgPath string, fileName string, n Node) {
if n.GetAttribute(ATTR_LOCATIONED) == true {
return // locations already set (typically n is a filenode).
}
if pkgPath == "" || fileName == "" {
panic("missing package path or file name")
}
Expand Down

0 comments on commit ddfff60

Please sign in to comment.