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

Method addDef

chapter17/src/main/java/com/seaofnodes/simple/node/Node.java:203–211  ·  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

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

Callers 10

anti_depMethod · 0.45
parseMethod · 0.45
parseStructMethod · 0.45
aliasMethod · 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