This avoids runtime initialization (a global constructor) whenever they appear
in the initializer.
The patch just adds the constexpr keyword to a couple of functions.
Paths
| Differential D121281
[ADT] Make BitmaskEnum operations constant expressions ClosedPublic Authored by labath on Mar 9 2022, 4:12 AM.
Details Summary This avoids runtime initialization (a global constructor) whenever they appear The patch just adds the constexpr keyword to a couple of functions.
Diff Detail
Event Timelinelabath mentioned this in D121161: [lldb] Avoid global constructor in LLDBLog.cpp.Mar 9 2022, 4:13 AM This revision is now accepted and ready to land.Mar 9 2022, 7:28 AM Comment Actions
Nope. This is the real thing. The "just" in the description is there because sprinkling the constexprs is literally the only thing I had to do to make it work. This revision was landed with ongoing or failed builds.Mar 11 2022, 2:12 AM Closed by commit rG161bddf3af09: [ADT] Make BitmaskEnum operations constant expressions (authored by labath). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 414621 llvm/include/llvm/ADT/BitmaskEnum.h
llvm/include/llvm/Support/MathExtras.h
llvm/unittests/ADT/BitmaskEnumTest.cpp
|