MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / addDef

Method addDef

chapter04/src/main/java/com/seaofnodes/simple/node/Node.java:161–168  ·  view source on GitHub ↗

Add a new def to an existing Node. Keep the edges correct by adding the corresponding def->use edge. @param new_def the new definition, appended to the end of existing definitions @return new_def for flow coding

(Node new_def)

Source from the content-addressed store, hash-verified

159 _type=null; // Flag as dead
160 assert isDead(); // Really dead now
161 }
162
163 // Mostly used for asserts and printing.
164 public boolean isDead() { return isUnused() && nIns()==0 && _type==null; }
165
166 // Shortcuts to stop DCE mid-parse
167 // Add bogus null use to keep node alive
168 public <N extends Node> N keep() { addUse(null); return (N)this; }
169 // Remove bogus null.
170 public <N extends Node> N unkeep() { delUse(null); return (N)this; }
171 // ------------------------------------------------------------------------

Callers 1

defineMethod · 0.45

Calls 2

addMethod · 0.45
addUseMethod · 0.45

Tested by

no test coverage detected