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

Method addDef

chapter06/src/main/java/com/seaofnodes/simple/node/Node.java:182–189  ·  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

180 * @return new_def for flow coding
181 */
182 Node addDef(Node new_def) {
183 // Add use->def edge
184 _inputs.add(new_def);
185 // If new def is not null, add the corresponding def->use edge
186 if( new_def != null )
187 new_def.addUse(this);
188 return new_def;
189 }
190
191 // Breaks the edge invariants, used temporarily
192 protected <N extends Node> void addUse(N n) { _outputs.add(n); }

Callers 3

defineMethod · 0.45
dupMethod · 0.45
addReturnMethod · 0.45

Calls 2

addMethod · 0.45
addUseMethod · 0.45

Tested by

no test coverage detected