@@ -1075,14 +1075,14 @@ module SsaCached {
1075
1075
}
1076
1076
1077
1077
/** Gets the `DefImpl` corresponding to `def`. */
1078
- private DefImpl getDefImpl ( SsaImpl:: DefinitionExt def ) {
1078
+ private DefImpl getDefImpl ( SsaImpl:: Definition def ) {
1079
1079
exists ( SourceVariable sv , IRBlock bb , int i |
1080
- def .definesAt ( sv , bb , i , _ ) and
1080
+ def .definesAt ( sv , bb , i ) and
1081
1081
result .hasIndexInBlock ( bb , i , sv )
1082
1082
)
1083
1083
}
1084
1084
1085
- class GlobalDef extends DefinitionExt {
1085
+ class GlobalDef extends Definition {
1086
1086
GlobalDefImpl impl ;
1087
1087
1088
1088
GlobalDef ( ) { impl = getDefImpl ( this ) }
@@ -1150,6 +1150,20 @@ class Definition extends SsaImpl::Definition {
1150
1150
* being written to.
1151
1151
*/
1152
1152
predicate isCertain ( ) { getDefImpl ( this ) .isCertain ( ) }
1153
+
1154
+ /**
1155
+ * Gets the enclosing declaration of this definition.
1156
+ *
1157
+ * Note that this may be a variable when this definition defines a global, or
1158
+ * a static local, variable.
1159
+ */
1160
+ Declaration getFunction ( ) { result = getDefImpl ( this ) .getBlock ( ) .getEnclosingFunction ( ) }
1161
+
1162
+ /** Gets the underlying type of the variable being defined by this definition. */
1163
+ Type getUnderlyingType ( ) { result = this .getSourceVariable ( ) .getType ( ) }
1164
+
1165
+ /** Gets the unspecified type of the variable being defined by this definition. */
1166
+ Type getUnspecifiedType ( ) { result = this .getUnderlyingType ( ) .getUnspecifiedType ( ) }
1153
1167
}
1154
1168
1155
1169
/** An static single assignment (SSA) definition. */
0 commit comments