|
1 | 1 | import python |
2 | 2 |
|
3 | 3 | class RecordedCall extends XMLElement { |
4 | | - RecordedCall() { |
5 | | - this.hasName("recorded_call") |
6 | | - } |
| 4 | + RecordedCall() { this.hasName("recorded_call") } |
7 | 5 |
|
8 | | - string call_filename() { result = this.getAttributeValue("call_filename") } |
| 6 | + string call_filename() { result = this.getAttributeValue("call_filename") } |
9 | 7 |
|
10 | | - int call_linenum() { result = this.getAttributeValue("call_linenum").toInt() } |
| 8 | + int call_linenum() { result = this.getAttributeValue("call_linenum").toInt() } |
11 | 9 |
|
12 | | - int call_inst_index() { result = this.getAttributeValue("call_inst_index").toInt() } |
| 10 | + int call_inst_index() { result = this.getAttributeValue("call_inst_index").toInt() } |
13 | 11 |
|
14 | | - Call getCall() { |
15 | | - // TODO: handle calls spanning multiple lines |
16 | | - result.getLocation().hasLocationInfo(this.call_filename(), this.call_linenum(), _, _, _) |
17 | | - } |
| 12 | + Call getCall() { |
| 13 | + // TODO: handle calls spanning multiple lines |
| 14 | + result.getLocation().hasLocationInfo(this.call_filename(), this.call_linenum(), _, _, _) |
| 15 | + } |
18 | 16 |
|
19 | | - string callee_filename() { result = this.getAttributeValue("callee_filename") } |
| 17 | + string callee_filename() { result = this.getAttributeValue("callee_filename") } |
20 | 18 |
|
21 | | - int callee_linenum() { result = this.getAttributeValue("callee_linenum").toInt() } |
| 19 | + int callee_linenum() { result = this.getAttributeValue("callee_linenum").toInt() } |
22 | 20 |
|
23 | | - string callee_funcname() { result = this.getAttributeValue("callee_funcname") } |
| 21 | + string callee_funcname() { result = this.getAttributeValue("callee_funcname") } |
24 | 22 |
|
25 | | - Function getCallee() { |
26 | | - result.getLocation().hasLocationInfo(this.callee_filename(), this.callee_linenum(), _, _, _) |
27 | | - } |
| 23 | + Function getCallee() { |
| 24 | + result.getLocation().hasLocationInfo(this.callee_filename(), this.callee_linenum(), _, _, _) |
| 25 | + } |
28 | 26 | } |
29 | 27 |
|
30 | 28 | /** |
31 | 29 | * Class of recorded calls where we can uniquely identify both the `call` and the `callee`. |
32 | 30 | */ |
33 | 31 | class ValidRecordedCall extends RecordedCall { |
34 | | - ValidRecordedCall() { |
35 | | - strictcount(this.getCall()) = 1 and |
36 | | - strictcount(this.getCallee()) = 1 |
37 | | - } |
| 32 | + ValidRecordedCall() { |
| 33 | + strictcount(this.getCall()) = 1 and |
| 34 | + strictcount(this.getCallee()) = 1 |
| 35 | + } |
38 | 36 | } |
0 commit comments