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

Method addDef

chapter15/src/main/java/com/seaofnodes/simple/node/Node.java:196–204  ·  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

194 * @return new_def for flow coding
195 */
196 public Node addDef(Node new_def) {
197 unlock();
198 // Add use->def edge
199 _inputs.add(new_def);
200 // If new def is not null, add the corresponding def->use edge
201 if( new_def != null )
202 new_def.addUse(this);
203 return new_def;
204 }
205
206 // Breaks the edge invariants, used temporarily
207 protected <N extends Node> void addUse(N n) { _outputs.add(n); }

Callers 7

anti_depMethod · 0.45
defineMethod · 0.45
dupMethod · 0.45
addReturnMethod · 0.45
forceExitMethod · 0.45
ReturnNodeMethod · 0.45
MemOpNodeMethod · 0.45

Calls 3

unlockMethod · 0.95
addMethod · 0.45
addUseMethod · 0.45

Tested by

no test coverage detected