Loop Hoisting
Detect opportunities to hoist function calls that are invariant outside of loop bodies for efficiency.
Activate with --loop-hoisting
.
Supported languages:
- C/C++/ObjC: Yes
- C#/.Net: No
- Erlang: No
- Hack: No
- Java: Yes
- Python: No
This checker detects opportunities to hoist function calls that are invariant to outside of loop bodies. The hoisting analysis relies on purity analysis to determine whether a function is pure or not.
It has an additional mode that reports loop-invariant functions that are expensive (i.e. at least linear). This is enabled by the flag --hoisting-report-only-expensive
.
List of Issue Typesβ
The following issue types are reported by this checker: