Skip to content

Commit 4e279af

Browse files
committed
Fix locs
1 parent 6011e74 commit 4e279af

File tree

4 files changed

+274
-7
lines changed

4 files changed

+274
-7
lines changed

cpp/ql/test/library-tests/ir/ir/PrintAST.expected

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18883,6 +18883,12 @@ temp.cpp:
1888318883
# 17| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object
1888418884
# 17| Type = [Class] ClassWithDestructor2
1888518885
# 17| ValueCategory = prvalue(load)
18886+
# 18| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
18887+
# 18| Type = [VoidType] void
18888+
# 18| ValueCategory = prvalue
18889+
# 18| getQualifier(): [ReuseExpr] reuse of temporary object
18890+
# 18| Type = [Class] ClassWithDestructor2
18891+
# 18| ValueCategory = prvalue(load)
1888618892
# 21| [TopLevelFunction] char temp_test2()
1888718893
# 21| <params>:
1888818894
# 21| getEntryPoint(): [BlockStmt] { ... }
@@ -19081,18 +19087,18 @@ temp.cpp:
1908119087
# 45| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object
1908219088
# 45| Type = [Class] ClassWithDestructor2
1908319089
# 45| ValueCategory = prvalue(load)
19084-
# 47| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
19090+
# 46| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
19091+
# 46| Type = [VoidType] void
19092+
# 46| ValueCategory = prvalue
19093+
# 46| getQualifier(): [ReuseExpr] reuse of temporary object
19094+
# 46| Type = [Class] ClassWithDestructor2
19095+
# 46| ValueCategory = prvalue(load)
19096+
# 47| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor2
1908519097
# 47| Type = [VoidType] void
1908619098
# 47| ValueCategory = prvalue
1908719099
# 47| getQualifier(): [VariableAccess] c
1908819100
# 47| Type = [Class] ClassWithDestructor2
1908919101
# 47| ValueCategory = lvalue
19090-
# 45| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
19091-
# 45| Type = [VoidType] void
19092-
# 45| ValueCategory = prvalue
19093-
# 45| getQualifier(): [ReuseExpr] reuse of temporary object
19094-
# 45| Type = [Class] ClassWithDestructor2
19095-
# 45| ValueCategory = prvalue(load)
1909619102
# 47| getStmt(2): [ReturnStmt] return ...
1909719103
# 47| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
1909819104
# 47| Type = [VoidType] void
@@ -19141,6 +19147,12 @@ temp.cpp:
1914119147
# 52| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
1914219148
# 52| Type = [VoidType] void
1914319149
# 52| ValueCategory = prvalue
19150+
# 52| getQualifier(): [ReuseExpr] reuse of temporary object
19151+
# 52| Type = [Class] ClassWithDestructor2
19152+
# 52| ValueCategory = prvalue(load)
19153+
# 52| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor2
19154+
# 52| Type = [VoidType] void
19155+
# 52| ValueCategory = prvalue
1914419156
# 52| getQualifier(): [VariableAccess] c
1914519157
# 52| Type = [Class] ClassWithDestructor2
1914619158
# 52| ValueCategory = lvalue
@@ -19178,6 +19190,71 @@ temp.cpp:
1917819190
# 52| getQualifier(): [VariableAccess] c
1917919191
# 52| Type = [Class] ClassWithDestructor2
1918019192
# 52| ValueCategory = lvalue
19193+
# 54| [TopLevelFunction] void temp_test8(bool)
19194+
# 54| <params>:
19195+
# 54| getParameter(0): [Parameter] b
19196+
# 54| Type = [BoolType] bool
19197+
# 54| getEntryPoint(): [BlockStmt] { ... }
19198+
# 55| getStmt(0): [ExprStmt] ExprStmt
19199+
# 55| getExpr(): [ConditionalExpr] ... ? ... : ...
19200+
# 55| Type = [Class] ClassWithDestructor2
19201+
# 55| ValueCategory = prvalue(load)
19202+
# 55| getCondition(): [VariableAccess] b
19203+
# 55| Type = [BoolType] bool
19204+
# 55| ValueCategory = prvalue(load)
19205+
# 55| getThen(): [ThrowExpr] throw ...
19206+
# 55| Type = [Class] ClassWithConstructor
19207+
# 55| ValueCategory = prvalue
19208+
# 55| getExpr(): [ConstructorCall] call to ClassWithConstructor
19209+
# 55| Type = [VoidType] void
19210+
# 55| ValueCategory = prvalue
19211+
# 55| getArgument(0): [CharLiteral] 120
19212+
# 55| Type = [PlainCharType] char
19213+
# 55| Value = [CharLiteral] 120
19214+
# 55| ValueCategory = prvalue
19215+
# 55| getArgument(1): [FunctionCall] call to get_x
19216+
# 55| Type = [PlainCharType] char
19217+
# 55| ValueCategory = prvalue
19218+
# 55| getQualifier(): [ConstructorCall] call to ClassWithDestructor2
19219+
# 55| Type = [VoidType] void
19220+
# 55| ValueCategory = prvalue
19221+
# 55| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object
19222+
# 55| Type = [Class] ClassWithDestructor2
19223+
# 55| ValueCategory = prvalue(load)
19224+
# 56| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
19225+
# 56| Type = [VoidType] void
19226+
# 56| ValueCategory = prvalue
19227+
# 56| getQualifier(): [ReuseExpr] reuse of temporary object
19228+
# 56| Type = [Class] ClassWithDestructor2
19229+
# 56| ValueCategory = prvalue(load)
19230+
# 55| getElse(): [ConstructorCall] call to ClassWithDestructor2
19231+
# 55| Type = [VoidType] void
19232+
# 55| ValueCategory = prvalue
19233+
# 55| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor2
19234+
# 55| Type = [VoidType] void
19235+
# 55| ValueCategory = prvalue
19236+
# 55| getQualifier(): [ReuseExpr] reuse of temporary object
19237+
# 55| Type = [Class] ClassWithDestructor2
19238+
# 55| ValueCategory = prvalue
19239+
# 55| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor2
19240+
# 55| Type = [VoidType] void
19241+
# 55| ValueCategory = prvalue
19242+
# 55| getQualifier(): [ReuseExpr] reuse of temporary object
19243+
# 55| Type = [Class] ClassWithDestructor2
19244+
# 55| ValueCategory = prvalue(load)
19245+
# 55| getImplicitDestructorCall(2): [DestructorCall] call to ~ClassWithDestructor2
19246+
# 55| Type = [VoidType] void
19247+
# 55| ValueCategory = prvalue
19248+
# 55| getQualifier(): [ReuseExpr] reuse of temporary object
19249+
# 55| Type = [Class] ClassWithDestructor2
19250+
# 55| ValueCategory = prvalue(load)
19251+
# 55| getElse().getFullyConverted(): [TemporaryObjectExpr] temporary object
19252+
# 55| Type = [Class] ClassWithDestructor2
19253+
# 55| ValueCategory = prvalue(load)
19254+
# 55| getExpr().getFullyConverted(): [TemporaryObjectExpr] temporary object
19255+
# 55| Type = [Class] ClassWithDestructor2
19256+
# 55| ValueCategory = prvalue
19257+
# 56| getStmt(1): [ReturnStmt] return ...
1918119258
try_except.c:
1918219259
# 3| [TopLevelFunction] void ProbeFunction()
1918319260
# 3| <params>:

cpp/ql/test/library-tests/ir/ir/aliased_ir.expected

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15513,6 +15513,77 @@ temp.cpp:
1551315513
# 49| v49_11(void) = ReturnVoid :
1551415514
#-----| Goto -> Block 1
1551515515

15516+
# 54| void temp_test8(bool)
15517+
# 54| Block 0
15518+
# 54| v54_1(void) = EnterFunction :
15519+
# 54| m54_2(unknown) = AliasedDefinition :
15520+
# 54| m54_3(unknown) = InitializeNonLocal :
15521+
# 54| m54_4(unknown) = Chi : total:m54_2, partial:m54_3
15522+
# 54| r54_5(glval<bool>) = VariableAddress[b] :
15523+
# 54| m54_6(bool) = InitializeParameter[b] : &:r54_5
15524+
# 55| r55_1(glval<ClassWithDestructor2>) = VariableAddress[#temp55:5] :
15525+
# 55| r55_2(glval<bool>) = VariableAddress[b] :
15526+
# 55| r55_3(bool) = Load[b] : &:r55_2, m54_6
15527+
# 55| v55_4(void) = ConditionalBranch : r55_3
15528+
#-----| False -> Block 4
15529+
#-----| True -> Block 3
15530+
15531+
# 54| Block 1
15532+
# 54| m54_7(unknown) = Phi : from 2:~m55_26, from 4:~m55_35
15533+
# 54| v54_8(void) = AliasedUse : ~m54_7
15534+
# 54| v54_9(void) = ExitFunction :
15535+
15536+
# 54| Block 2
15537+
# 54| v54_10(void) = Unwind :
15538+
#-----| Goto -> Block 1
15539+
15540+
# 55| Block 3
15541+
# 55| r55_5(glval<ClassWithConstructor>) = VariableAddress[#throw55:9] :
15542+
# 55| m55_6(ClassWithConstructor) = Uninitialized[#throw55:9] : &:r55_5
15543+
# 55| r55_7(glval<unknown>) = FunctionAddress[ClassWithConstructor] :
15544+
# 55| r55_8(char) = Constant[120] :
15545+
# 55| r55_9(glval<ClassWithDestructor2>) = VariableAddress[#temp55:41] :
15546+
# 55| m55_10(ClassWithDestructor2) = Uninitialized[#temp55:41] : &:r55_9
15547+
# 55| r55_11(glval<unknown>) = FunctionAddress[ClassWithDestructor2] :
15548+
# 55| v55_12(void) = Call[ClassWithDestructor2] : func:r55_11, this:r55_9
15549+
# 55| m55_13(unknown) = ^CallSideEffect : ~m54_4
15550+
# 55| m55_14(unknown) = Chi : total:m54_4, partial:m55_13
15551+
# 55| m55_15(ClassWithDestructor2) = ^IndirectMayWriteSideEffect[-1] : &:r55_9
15552+
# 55| m55_16(ClassWithDestructor2) = Chi : total:m55_10, partial:m55_15
15553+
# 55| r55_17(glval<unknown>) = FunctionAddress[get_x] :
15554+
# 55| r55_18(char) = Call[get_x] : func:r55_17, this:r55_9
15555+
# 55| m55_19(unknown) = ^CallSideEffect : ~m55_14
15556+
# 55| m55_20(unknown) = Chi : total:m55_14, partial:m55_19
15557+
# 55| v55_21(void) = ^IndirectReadSideEffect[-1] : &:r55_9, m55_16
15558+
# 55| m55_22(ClassWithDestructor2) = ^IndirectMayWriteSideEffect[-1] : &:r55_9
15559+
# 55| m55_23(ClassWithDestructor2) = Chi : total:m55_16, partial:m55_22
15560+
# 55| v55_24(void) = Call[ClassWithConstructor] : func:r55_7, this:r55_5, 0:r55_8, 1:r55_18
15561+
# 55| m55_25(unknown) = ^CallSideEffect : ~m55_20
15562+
# 55| m55_26(unknown) = Chi : total:m55_20, partial:m55_25
15563+
# 55| m55_27(ClassWithConstructor) = ^IndirectMayWriteSideEffect[-1] : &:r55_5
15564+
# 55| m55_28(ClassWithConstructor) = Chi : total:m55_6, partial:m55_27
15565+
# 55| v55_29(void) = ThrowValue : &:r55_5, m55_28
15566+
#-----| Exception -> Block 2
15567+
15568+
# 55| Block 4
15569+
# 55| r55_30(glval<ClassWithDestructor2>) = VariableAddress[#temp55:75] :
15570+
# 55| m55_31(ClassWithDestructor2) = Uninitialized[#temp55:75] : &:r55_30
15571+
# 55| r55_32(glval<unknown>) = FunctionAddress[ClassWithDestructor2] :
15572+
# 55| v55_33(void) = Call[ClassWithDestructor2] : func:r55_32, this:r55_30
15573+
# 55| m55_34(unknown) = ^CallSideEffect : ~m54_4
15574+
# 55| m55_35(unknown) = Chi : total:m54_4, partial:m55_34
15575+
# 55| m55_36(ClassWithDestructor2) = ^IndirectMayWriteSideEffect[-1] : &:r55_30
15576+
# 55| m55_37(ClassWithDestructor2) = Chi : total:m55_31, partial:m55_36
15577+
# 55| r55_38(ClassWithDestructor2) = Load[#temp55:75] : &:r55_30, m55_37
15578+
# 55| r55_39(glval<ClassWithDestructor2>) = VariableAddress[#temp55:5] :
15579+
# 55| m55_40(ClassWithDestructor2) = Store[#temp55:5] : &:r55_39, r55_38
15580+
# 55| r55_41(glval<ClassWithDestructor2>) = VariableAddress[#temp55:5] :
15581+
# 55| r55_42(ClassWithDestructor2) = Load[#temp55:5] : &:r55_41, m55_40
15582+
# 55| m55_43(ClassWithDestructor2) = Store[#temp55:5] : &:r55_1, r55_42
15583+
# 56| v56_1(void) = NoOp :
15584+
# 54| v54_11(void) = ReturnVoid :
15585+
#-----| Goto -> Block 1
15586+
1551615587
try_except.c:
1551715588
# 6| void f()
1551815589
# 6| Block 0

cpp/ql/test/library-tests/ir/ir/operand_locations.expected

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12878,6 +12878,64 @@
1287812878
| temp.cpp:52:1:52:1 | ChiTotal | total:m51_35 |
1287912879
| temp.cpp:52:1:52:1 | SideEffect | m50_8 |
1288012880
| temp.cpp:52:1:52:1 | SideEffect | ~m51_35 |
12881+
| temp.cpp:54:6:54:15 | ChiPartial | partial:m54_3 |
12882+
| temp.cpp:54:6:54:15 | ChiTotal | total:m54_2 |
12883+
| temp.cpp:54:6:54:15 | Phi | from 2:~m55_26 |
12884+
| temp.cpp:54:6:54:15 | Phi | from 4:~m55_35 |
12885+
| temp.cpp:54:6:54:15 | SideEffect | ~m54_7 |
12886+
| temp.cpp:54:22:54:22 | Address | &:r54_5 |
12887+
| temp.cpp:55:5:55:5 | Address | &:r55_2 |
12888+
| temp.cpp:55:5:55:5 | Address | &:r55_39 |
12889+
| temp.cpp:55:5:55:5 | Address | &:r55_41 |
12890+
| temp.cpp:55:5:55:5 | Condition | r55_3 |
12891+
| temp.cpp:55:5:55:5 | Load | m54_6 |
12892+
| temp.cpp:55:5:55:5 | Load | m55_40 |
12893+
| temp.cpp:55:5:55:5 | StoreValue | r55_42 |
12894+
| temp.cpp:55:5:55:96 | Address | &:r55_1 |
12895+
| temp.cpp:55:9:55:71 | Address | &:r55_5 |
12896+
| temp.cpp:55:9:55:71 | Address | &:r55_5 |
12897+
| temp.cpp:55:9:55:71 | Address | &:r55_5 |
12898+
| temp.cpp:55:9:55:71 | Arg(this) | this:r55_5 |
12899+
| temp.cpp:55:9:55:71 | CallTarget | func:r55_7 |
12900+
| temp.cpp:55:9:55:71 | ChiPartial | partial:m55_25 |
12901+
| temp.cpp:55:9:55:71 | ChiPartial | partial:m55_27 |
12902+
| temp.cpp:55:9:55:71 | ChiTotal | total:m55_6 |
12903+
| temp.cpp:55:9:55:71 | ChiTotal | total:m55_20 |
12904+
| temp.cpp:55:9:55:71 | Load | m55_28 |
12905+
| temp.cpp:55:9:55:71 | SideEffect | ~m55_20 |
12906+
| temp.cpp:55:36:55:38 | Arg(0) | 0:r55_8 |
12907+
| temp.cpp:55:41:55:62 | Address | &:r55_9 |
12908+
| temp.cpp:55:41:55:62 | Address | &:r55_9 |
12909+
| temp.cpp:55:41:55:62 | Address | &:r55_9 |
12910+
| temp.cpp:55:41:55:62 | Address | &:r55_9 |
12911+
| temp.cpp:55:41:55:62 | Arg(this) | this:r55_9 |
12912+
| temp.cpp:55:41:55:62 | Arg(this) | this:r55_9 |
12913+
| temp.cpp:55:41:55:62 | CallTarget | func:r55_11 |
12914+
| temp.cpp:55:41:55:62 | ChiPartial | partial:m55_13 |
12915+
| temp.cpp:55:41:55:62 | ChiPartial | partial:m55_15 |
12916+
| temp.cpp:55:41:55:62 | ChiPartial | partial:m55_22 |
12917+
| temp.cpp:55:41:55:62 | ChiTotal | total:m54_4 |
12918+
| temp.cpp:55:41:55:62 | ChiTotal | total:m55_10 |
12919+
| temp.cpp:55:41:55:62 | ChiTotal | total:m55_16 |
12920+
| temp.cpp:55:41:55:62 | SideEffect | m55_16 |
12921+
| temp.cpp:55:41:55:62 | SideEffect | ~m54_4 |
12922+
| temp.cpp:55:64:55:68 | Arg(1) | 1:r55_18 |
12923+
| temp.cpp:55:64:55:68 | CallTarget | func:r55_17 |
12924+
| temp.cpp:55:64:55:68 | ChiPartial | partial:m55_19 |
12925+
| temp.cpp:55:64:55:68 | ChiTotal | total:m55_14 |
12926+
| temp.cpp:55:64:55:68 | SideEffect | ~m55_14 |
12927+
| temp.cpp:55:75:55:96 | Address | &:r55_30 |
12928+
| temp.cpp:55:75:55:96 | Address | &:r55_30 |
12929+
| temp.cpp:55:75:55:96 | Address | &:r55_30 |
12930+
| temp.cpp:55:75:55:96 | Arg(this) | this:r55_30 |
12931+
| temp.cpp:55:75:55:96 | CallTarget | func:r55_32 |
12932+
| temp.cpp:55:75:55:96 | ChiPartial | partial:m55_34 |
12933+
| temp.cpp:55:75:55:96 | ChiPartial | partial:m55_36 |
12934+
| temp.cpp:55:75:55:96 | ChiTotal | total:m54_4 |
12935+
| temp.cpp:55:75:55:96 | ChiTotal | total:m55_31 |
12936+
| temp.cpp:55:75:55:96 | Load | m55_37 |
12937+
| temp.cpp:55:75:55:96 | SideEffect | ~m54_4 |
12938+
| temp.cpp:55:75:55:96 | StoreValue | r55_38 |
1288112939
| try_except.c:6:6:6:6 | ChiPartial | partial:m6_3 |
1288212940
| try_except.c:6:6:6:6 | ChiTotal | total:m6_2 |
1288312941
| try_except.c:6:6:6:6 | SideEffect | ~m11_5 |

0 commit comments

Comments
 (0)