C++: Use the 'StoreInstruction' instead of the 'ReturnValueInstruction' when detecting return expressions.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-09-24 20:02:40 +01:00
parent 26a8a4b3d2
commit a07d03f49b
6 changed files with 39 additions and 8 deletions

View File

@@ -139,7 +139,7 @@ void test_guarded_wrapper() {
int x = source();
if(guarded_wrapper(x)) {
sink(x); // $ SPURIOUS: ast,ir
sink(x); // $ SPURIOUS: ast
} else {
sink(x); // $ ast,ir
}

View File

@@ -158,7 +158,6 @@ irFlow
| BarrierGuard.cpp:49:10:49:15 | call to source | BarrierGuard.cpp:55:13:55:13 | x |
| BarrierGuard.cpp:60:11:60:16 | call to source | BarrierGuard.cpp:64:14:64:14 | x |
| BarrierGuard.cpp:60:11:60:16 | call to source | BarrierGuard.cpp:66:14:66:14 | x |
| BarrierGuard.cpp:139:11:139:16 | call to source | BarrierGuard.cpp:142:10:142:10 | x |
| BarrierGuard.cpp:139:11:139:16 | call to source | BarrierGuard.cpp:144:10:144:10 | x |
| acrossLinkTargets.cpp:19:27:19:32 | call to source | acrossLinkTargets.cpp:12:8:12:8 | x |
| clang.cpp:12:9:12:20 | sourceArray1 | clang.cpp:18:8:18:19 | sourceArray1 |