@@ -49,11 +49,7 @@ class Node0Impl extends TIRDataFlowNode0 {
4949 DataFlowType getType ( ) { none ( ) } // overridden in subclasses
5050
5151 /** Gets the instruction corresponding to this node, if any. */
52- Instruction asInstruction ( ) {
53- result = this .( InstructionNode0 ) .getInstruction ( )
54- or
55- result = Ssa:: getIRRepresentationOfOperand ( this .( SingleUseOperandNode0 ) .getOperand ( ) )
56- }
52+ Instruction asInstruction ( ) { result = this .( InstructionNode0 ) .getInstruction ( ) }
5753
5854 /** Gets the operands corresponding to this node, if any. */
5955 Operand asOperand ( ) { result = this .( OperandNode0 ) .getOperand ( ) }
@@ -78,11 +74,9 @@ class Node0Impl extends TIRDataFlowNode0 {
7874/**
7975 * An instruction, viewed as a node in a data flow graph.
8076 */
81- class InstructionNode0 extends Node0Impl , TInstructionNode0 {
77+ abstract class InstructionNode0 extends Node0Impl {
8278 Instruction instr ;
8379
84- InstructionNode0 ( ) { this = TInstructionNode0 ( instr ) }
85-
8680 /** Gets the instruction corresponding to this node. */
8781 Instruction getInstruction ( ) { result = instr }
8882
@@ -101,6 +95,25 @@ class InstructionNode0 extends Node0Impl, TInstructionNode0 {
10195 }
10296}
10397
98+ /**
99+ * An instruction without an operand that is used only once, viewed as a node in a data flow graph.
100+ */
101+ private class InstructionInstructionNode0 extends InstructionNode0 , TInstructionNode0 {
102+ InstructionInstructionNode0 ( ) { this = TInstructionNode0 ( instr ) }
103+ }
104+
105+ /**
106+ * An instruction with an operand that is used only once, viewed as a node in a data flow graph.
107+ */
108+ private class SingleUseOperandInstructionNode0 extends InstructionNode0 , TSingleUseOperandNode0 {
109+ SingleUseOperandInstructionNode0 ( ) {
110+ exists ( Operand op |
111+ this = TSingleUseOperandNode0 ( op ) and
112+ instr = Ssa:: getIRRepresentationOfOperand ( op )
113+ )
114+ }
115+ }
116+
104117/**
105118 * An operand, viewed as a node in a data flow graph.
106119 */
@@ -124,14 +137,14 @@ abstract class OperandNode0 extends Node0Impl {
124137/**
125138 * An operand that is used multiple times, viewed as a node in a data flow graph.
126139 */
127- class MultipleUseOperandNode0 extends OperandNode0 , TMultipleUseOperandNode0 {
140+ private class MultipleUseOperandNode0 extends OperandNode0 , TMultipleUseOperandNode0 {
128141 MultipleUseOperandNode0 ( ) { this = TMultipleUseOperandNode0 ( op ) }
129142}
130143
131144/**
132145 * An operand that is used only once, viewed as a node in a data flow graph.
133146 */
134- class SingleUseOperandNode0 extends OperandNode0 , TSingleUseOperandNode0 {
147+ private class SingleUseOperandNode0 extends OperandNode0 , TSingleUseOperandNode0 {
135148 SingleUseOperandNode0 ( ) { this = TSingleUseOperandNode0 ( op ) }
136149}
137150
0 commit comments