C++: Fix ThisParameterNode after IR changes

This commit is contained in:
Robert Marsh
2020-05-26 13:35:08 -07:00
parent 7ad45d50c0
commit fb46002332
5 changed files with 9 additions and 10 deletions

View File

@@ -162,11 +162,7 @@ class ExprNode extends InstructionNode {
* as `x` in `f(x)` and implicit parameters such as `this` in `x.f()`
*/
class ParameterNode extends InstructionNode {
ParameterNode() {
instr instanceof InitializeParameterInstruction
or
instr instanceof InitializeThisInstruction
}
override InitializeParameterInstruction instr;
/**
* Holds if this node is the parameter of `c` at the specified (zero-based)
@@ -180,7 +176,9 @@ class ParameterNode extends InstructionNode {
* flow graph.
*/
private class ExplicitParameterNode extends ParameterNode {
override InitializeParameterInstruction instr;
ExplicitParameterNode() {
exists(instr.getParameter())
}
override predicate isParameterOf(Function f, int i) { f.getParameter(i) = instr.getParameter() }
@@ -191,7 +189,9 @@ private class ExplicitParameterNode extends ParameterNode {
}
private class ThisParameterNode extends ParameterNode {
override InitializeThisInstruction instr;
ThisParameterNode() {
instr.getIRVariable() instanceof IRThisVariable
}
override predicate isParameterOf(Function f, int i) {
i = -1 and instr.getEnclosingFunction() = f

View File

@@ -19,9 +19,7 @@ uniqueNodeLocation
missingLocation
| Nodes without location: 4 |
uniqueNodeToString
| lambdas.cpp:2:6:2:9 | (no string representation) | Node should have one toString but has 0. |
missingToString
| Nodes without toString: 1 |
parameterCallable
localFlowIsLocal
compatibleTypesReflexive

View File

@@ -40,7 +40,6 @@
| test.cpp:347:17:347:22 | test.cpp:349:10:349:18 | AST only |
| test.cpp:359:13:359:18 | test.cpp:365:10:365:14 | AST only |
| test.cpp:373:13:373:18 | test.cpp:369:10:369:14 | AST only |
| test.cpp:373:13:373:18 | test.cpp:375:10:375:14 | AST only |
| test.cpp:399:7:399:9 | test.cpp:401:8:401:10 | AST only |
| test.cpp:405:7:405:9 | test.cpp:408:8:408:10 | AST only |
| test.cpp:416:7:416:11 | test.cpp:418:8:418:12 | AST only |

View File

@@ -65,6 +65,7 @@
| test.cpp:266:12:266:12 | x | test.cpp:265:22:265:27 | call to source |
| test.cpp:289:14:289:14 | x | test.cpp:305:17:305:22 | call to source |
| test.cpp:318:7:318:7 | x | test.cpp:314:4:314:9 | call to source |
| test.cpp:375:10:375:14 | field | test.cpp:373:13:373:18 | call to source |
| test.cpp:385:8:385:10 | tmp | test.cpp:382:48:382:54 | source1 |
| test.cpp:392:8:392:10 | tmp | test.cpp:388:53:388:59 | source1 |
| test.cpp:394:10:394:12 | tmp | test.cpp:388:53:388:59 | source1 |

View File

@@ -2,6 +2,7 @@ uniqueEnclosingCallable
uniqueTypeBound
| by_reference.cpp:106:21:106:41 | Chi | Node should have one type bound but has 2. |
| by_reference.cpp:126:21:126:40 | Chi | Node should have one type bound but has 2. |
| file://:0:0:0:0 | Chi | Node should have one type bound but has 2. |
uniqueTypeRepr
uniqueNodeLocation
| D.cpp:1:17:1:17 | o | Node should have one location but has 3. |