C++: Fix Operand.getSize()

This commit is contained in:
Dave Bartolomeo
2019-02-11 17:48:59 -08:00
parent bd46c43067
commit c224bbd767
3 changed files with 18 additions and 6 deletions

View File

@@ -21,10 +21,14 @@ class Operand extends TOperand {
result = "Operand"
}
Location getLocation() {
final Location getLocation() {
result = getUseInstruction().getLocation()
}
final FunctionIR getEnclosingFunctionIR() {
result = getUseInstruction().getEnclosingFunctionIR()
}
/**
* Gets the `Instruction` that consumes this operand.
*/
@@ -91,7 +95,7 @@ class Operand extends TOperand {
* a known constant size, this predicate does not hold.
*/
int getSize() {
result = getDefinitionInstruction().getResultSize()
result = getType().getSize()
}
}

View File

@@ -21,10 +21,14 @@ class Operand extends TOperand {
result = "Operand"
}
Location getLocation() {
final Location getLocation() {
result = getUseInstruction().getLocation()
}
final FunctionIR getEnclosingFunctionIR() {
result = getUseInstruction().getEnclosingFunctionIR()
}
/**
* Gets the `Instruction` that consumes this operand.
*/
@@ -91,7 +95,7 @@ class Operand extends TOperand {
* a known constant size, this predicate does not hold.
*/
int getSize() {
result = getDefinitionInstruction().getResultSize()
result = getType().getSize()
}
}

View File

@@ -21,10 +21,14 @@ class Operand extends TOperand {
result = "Operand"
}
Location getLocation() {
final Location getLocation() {
result = getUseInstruction().getLocation()
}
final FunctionIR getEnclosingFunctionIR() {
result = getUseInstruction().getEnclosingFunctionIR()
}
/**
* Gets the `Instruction` that consumes this operand.
*/
@@ -91,7 +95,7 @@ class Operand extends TOperand {
* a known constant size, this predicate does not hold.
*/
int getSize() {
result = getDefinitionInstruction().getResultSize()
result = getType().getSize()
}
}