Skip to content

Commit e01552c

Browse files
committed
C++: Remove another DefinitionExt reference.
1 parent c5755ba commit e01552c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,14 +1075,14 @@ module SsaCached {
10751075
}
10761076

10771077
/** Gets the `DefImpl` corresponding to `def`. */
1078-
private DefImpl getDefImpl(SsaImpl::DefinitionExt def) {
1078+
private DefImpl getDefImpl(SsaImpl::Definition def) {
10791079
exists(SourceVariable sv, IRBlock bb, int i |
1080-
def.definesAt(sv, bb, i, _) and
1080+
def.definesAt(sv, bb, i) and
10811081
result.hasIndexInBlock(bb, i, sv)
10821082
)
10831083
}
10841084

1085-
class GlobalDef extends DefinitionExt {
1085+
class GlobalDef extends Definition {
10861086
GlobalDefImpl impl;
10871087

10881088
GlobalDef() { impl = getDefImpl(this) }
@@ -1150,6 +1150,20 @@ class Definition extends SsaImpl::Definition {
11501150
* being written to.
11511151
*/
11521152
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() }
11531167
}
11541168

11551169
/** An static single assignment (SSA) definition. */

0 commit comments

Comments
 (0)