[PATCH] D27454: Extract LaneBitmask into a separate type

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 12:12:54 PST 2016


kparzysz added inline comments.


================
Comment at: include/llvm/Support/LaneBitmask.h:42
+    typedef unsigned Type;
+    enum : unsigned { BitWidth = 8*sizeof(Type) };
+
----------------
Just to explain the use of enum: using "static const unsigned" has in the past caused problems with Debug vs Release builds. Release builds treated the constant as literal, while Debug builds treated it as a constant object, thus requiring a definition (i.e. "const Type Class::Member = val"). Release builds, in turn, didn't like that definition, so there was no satisfactory way to keep both happy.


Repository:
  rL LLVM

https://reviews.llvm.org/D27454





More information about the llvm-commits mailing list