Package com.tonic.analysis.dataflow
Class DataFlowNode.Builder
- java.lang.Object
-
- com.tonic.analysis.dataflow.DataFlowNode.Builder
-
- Enclosing class:
- DataFlowNode
public static class DataFlowNode.Builder extends Object
Mutable accumulator for the immutable fields of aDataFlowNode.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataFlowNodebuild()Creates the node from the values collected so far.DataFlowNode.Builderdescription(String description)DataFlowNode.Builderid(int id)DataFlowNode.Builderinstruction(IRInstruction instruction)Sets the IR instruction this node stands for.DataFlowNode.Builderlocation(int blockId, int instructionIndex)Sets the block and instruction position the node came from.DataFlowNode.Buildername(String name)DataFlowNode.BuilderssaValue(SSAValue value)Sets the SSA value this node stands for, defaulting the name to the value's name.DataFlowNode.Buildertype(DataFlowNodeType type)
-
-
-
Method Detail
-
id
public DataFlowNode.Builder id(int id)
- Parameters:
id- identity used for equality and hashing- Returns:
- this builder
-
type
public DataFlowNode.Builder type(DataFlowNodeType type)
- Parameters:
type- node kind, defaulting to LOCAL- Returns:
- this builder
-
name
public DataFlowNode.Builder name(String name)
- Parameters:
name- display name, overriding the one derived from an SSA value- Returns:
- this builder
-
description
public DataFlowNode.Builder description(String description)
- Parameters:
description- free-form detail text- Returns:
- this builder
-
ssaValue
public DataFlowNode.Builder ssaValue(SSAValue value)
Sets the SSA value this node stands for, defaulting the name to the value's name.- Parameters:
value- backing SSA value, may be null- Returns:
- this builder
-
instruction
public DataFlowNode.Builder instruction(IRInstruction instruction)
Sets the IR instruction this node stands for.- Parameters:
instruction- backing instruction, may be null- Returns:
- this builder
-
location
public DataFlowNode.Builder location(int blockId, int instructionIndex)
Sets the block and instruction position the node came from.- Parameters:
blockId- owning basic block idinstructionIndex- index within that block- Returns:
- this builder
-
build
public DataFlowNode build()
Creates the node from the values collected so far.- Returns:
- the built node
-
-