HaxeFoundation / HaxeFoundation/haxe
[analyzer] @:pure meta lost in CFG building
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
If we have the following:
```haxe
class Main {
@:pure inline static function f() trace("hi");
@:analyzer(full_debug)
static function main() {
f();
}
}
```
The inlined call to `f()` is not being eliminated even though it's `@:pure`, because the `TMeta` is lost when building control flow graph basic blocks:
```
While analyzing Main.main
function() {
@:pure `trace<535>("hi", {fileName : "Main.hx", lineNumber : 2, className : "Main", methodName : "f"});
}
function() {
@:pure `trace<535>("hi", {fileName : "Main.hx", lineNumber : 2, className : "Main", methodName : "f"});
}
function() {
`trace<535>("hi", {fileName : "Main.hx", lineNumber : 2, className : "Main", methodName : "f"});
}
function() {
`trace<535>("hi", {fileName : "Main.hx", lineNumber : 2, className : "Main", methodName : "f"});
}
function() {
`trace<535>("hi", {fileName : "Main.hx", lineNumber : 2, className : "Main", methodName : "f"});
}
```
Contributor guide
Assessment
This issue has not been assessed yet.