GlobalExtensions is dereferenced twice, once for iteration and then a check if it is empty.
As a ManagedStatic this dereference forces it's construction which is unnecessary.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM with an inline comment
lib/Transforms/IPO/PassManagerBuilder.cpp | ||
---|---|---|
172 ↗ | (On Diff #99678) | It took me some time to understand the comment here, because the function looks like a simple predicate. I'd write something like: /// Check if GlobalExtensions is constructed and not empty. /// Since GlobalExtensions is a managed static, just calling `empty()` /// would trigger the construction of the object. |