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

Method addDef

chapter24/src/main/java/com/seaofnodes/simple/node/Node.java:221–229  ·  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

219 * @return new_def for flow coding
220 */
221 public Node addDef(Node new_def) {
222 unlock();
223 // Add use->def edge
224 _inputs.add(new_def);
225 // If new def is not null, add the corresponding def->use edge
226 if( new_def != null )
227 new_def.addUse(this);
228 return new_def;
229 }
230
231 // Breaks the edge invariants, used temporarily
232 protected <N extends Node> void addUse(N n) { _outputs.add(n); }

Callers 15

drop_same_opMethod · 0.95
setDefXMethod · 0.95
parseFunctionBodyMethod · 0.45
parseStructMethod · 0.45
functionCallMethod · 0.45
removeCallGraphMethod · 0.45
makeRPCMethod · 0.45
regAllocMethod · 0.45
anti_depMethod · 0.45
linkMethod · 0.45
mergeMethod · 0.45
aliasMethod · 0.45

Calls 3

unlockMethod · 0.95
addMethod · 0.45
addUseMethod · 0.45

Tested by

no test coverage detected