[PATCH] D27156: Add `isRelExprOneOf` helper (alternative to D27145).

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 07:09:59 PST 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

Ah, so there's a new patch. This looks nice. LGTM.

Before submitting, please update the commit message so that you'll keep the message you wrote for https://reviews.llvm.org/D27145 in our commit history.



================
Comment at: ELF/Relocations.h:78
+constexpr uint64_t buildRelExprMask() { return 0; }
+// Build a bitmask with one bit set for each RelExpr.
+template <typename... RelExprs>
----------------
nit: add a blank line.


================
Comment at: ELF/Relocations.h:90
+bool isRelExprOneOf(RelExpr Expr, RelExprs... Exprs) {
+  return (uint64_t(1) << Expr) & buildRelExprMask(Exprs...);
+}
----------------
joerg wrote:
> ...and a run-time assert for for 0<=Expr < 64 here.
Maybe we should instead define `R_END` at end of `RelExpr` and statically assert R_END < 64;


https://reviews.llvm.org/D27156





More information about the llvm-commits mailing list