@@ -1079,10 +1079,18 @@ module SsaCached {
1079
1079
predicate variableWrite = SsaInput:: variableWrite / 4 ;
1080
1080
}
1081
1081
1082
+ /** Gets the `DefImpl` corresponding to `def`. */
1083
+ private DefImpl getDefImpl ( SsaImpl:: DefinitionExt def ) {
1084
+ exists ( SourceVariable sv , IRBlock bb , int i |
1085
+ def .definesAt ( sv , bb , i , _) and
1086
+ result .hasIndexInBlock ( bb , i , sv )
1087
+ )
1088
+ }
1089
+
1082
1090
class GlobalDef extends DefinitionExt {
1083
1091
GlobalDefImpl impl ;
1084
1092
1085
- GlobalDef ( ) { impl = this . getImpl ( ) }
1093
+ GlobalDef ( ) { impl = getDefImpl ( this ) }
1086
1094
1087
1095
/**
1088
1096
* Gets the global (or `static` local) variable written to by this SSA
@@ -1142,38 +1150,30 @@ class DefinitionExt extends SsaImpl::DefinitionExt {
1142
1150
not result instanceof PhiNode
1143
1151
}
1144
1152
1145
- /** INTERNAL: Do not use. */
1146
- DefImpl getImpl ( ) {
1147
- exists ( SourceVariable sv , IRBlock bb , int i |
1148
- this .definesAt ( sv , bb , i , _) and
1149
- result .hasIndexInBlock ( bb , i , sv )
1150
- )
1151
- }
1152
-
1153
1153
/**
1154
1154
* INTERNAL: Do not use.
1155
1155
*/
1156
- Node0Impl getValue ( ) { result = this . getImpl ( ) .getValue ( ) }
1156
+ Node0Impl getValue ( ) { result = getDefImpl ( this ) .getValue ( ) }
1157
1157
1158
1158
/** Gets the indirection index of this definition. */
1159
- int getIndirectionIndex ( ) { result = this . getImpl ( ) .getIndirectionIndex ( ) }
1159
+ int getIndirectionIndex ( ) { result = getDefImpl ( this ) .getIndirectionIndex ( ) }
1160
1160
1161
1161
/** Gets the indirection of this definition. */
1162
- int getIndirection ( ) { result = this . getImpl ( ) .getIndirection ( ) }
1162
+ int getIndirection ( ) { result = getDefImpl ( this ) .getIndirection ( ) }
1163
1163
1164
1164
/**
1165
1165
* Holds if this definition is guaranteed to totally overwrite the buffer
1166
1166
* being written to.
1167
1167
*/
1168
- predicate isCertain ( ) { this . getImpl ( ) .isCertain ( ) }
1168
+ predicate isCertain ( ) { getDefImpl ( this ) .isCertain ( ) }
1169
1169
1170
1170
/**
1171
1171
* Gets the enclosing declaration of this definition.
1172
1172
*
1173
1173
* Note that this may be a variable when this definition defines a global, or
1174
1174
* a static local, variable.
1175
1175
*/
1176
- Declaration getFunction ( ) { result = this . getImpl ( ) .getBlock ( ) .getEnclosingFunction ( ) }
1176
+ Declaration getFunction ( ) { result = getDefImpl ( this ) .getBlock ( ) .getEnclosingFunction ( ) }
1177
1177
1178
1178
/** Gets the underlying type of the variable being defined by this definition. */
1179
1179
Type getUnderlyingType ( ) { result = this .getSourceVariable ( ) .getType ( ) }
0 commit comments