C++: Replace getResultType() with getResultIRType() in IR dataflow

This commit is contained in:
Mathias Vorreiter Pedersen
2020-07-09 15:54:15 +02:00
parent 7029739691
commit 85a8280b30
2 changed files with 10 additions and 10 deletions

View File

@@ -234,20 +234,20 @@ predicate clearsContent(Node n, Content c) {
}
/** Gets the type of `n` used for type pruning. */
Type getNodeType(Node n) {
IRType getNodeType(Node n) {
suppressUnusedNode(n) and
result instanceof VoidType // stub implementation
result instanceof IRVoidType // stub implementation
}
/** Gets a string representation of a type returned by `getNodeType`. */
string ppReprType(Type t) { none() } // stub implementation
string ppReprType(IRType t) { none() } // stub implementation
/**
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
* a node of type `t1` to a node of type `t2`.
*/
pragma[inline]
predicate compatibleTypes(Type t1, Type t2) {
predicate compatibleTypes(IRType t1, IRType t2) {
any() // stub implementation
}
@@ -271,7 +271,7 @@ class DataFlowCallable = Declaration;
class DataFlowExpr = Expr;
class DataFlowType = Type;
class DataFlowType = IRType;
/** A function call relevant for data flow. */
class DataFlowCall extends CallInstruction {

View File

@@ -33,7 +33,7 @@ class Node extends TIRDataFlowNode {
Function getFunction() { none() } // overridden in subclasses
/** Gets the type of this node. */
Type getType() { none() } // overridden in subclasses
IRType getType() { none() } // overridden in subclasses
/** Gets the instruction corresponding to this node, if any. */
Instruction asInstruction() { result = this.(InstructionNode).getInstruction() }
@@ -88,7 +88,7 @@ class Node extends TIRDataFlowNode {
/**
* Gets an upper bound on the type of this node.
*/
Type getTypeBound() { result = getType() }
IRType getTypeBound() { result = getType() }
/** Gets the location of this element. */
Location getLocation() { none() } // overridden by subclasses
@@ -125,7 +125,7 @@ class InstructionNode extends Node, TInstructionNode {
override Function getFunction() { result = instr.getEnclosingFunction() }
override Type getType() { result = instr.getResultType() }
override IRType getType() { result = instr.getResultIRType() }
override Location getLocation() { result = instr.getLocation() }
@@ -151,7 +151,7 @@ class OperandNode extends Node, TOperandNode {
override Function getFunction() { result = op.getUse().getEnclosingFunction() }
override Type getType() { result = op.getType() }
override IRType getType() { result = op.getIRType() }
override Location getLocation() { result = op.getLocation() }
@@ -449,7 +449,7 @@ class VariableNode extends Node, TVariableNode {
result = v
}
override Type getType() { result = v.getType() }
override IRType getType() { result.getCanonicalLanguageType().hasUnspecifiedType(v.getType(), _) }
override Location getLocation() { result = v.getLocation() }