[PATCH] D27156: Add `isRelExprOneOf` helper (alternative to D27145).
Sean Silva via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 29 21:58:19 PST 2016
silvas updated this revision to Diff 79704.
silvas added a comment.
Sadly, it seems like static_assert can't be used on constexpr function arguments, so I've had to rewrite this to pass the set of RelExprs as template arguments. Though the implementation of the mask construction becomes slightly larger, I actually like the template argument approach because the call sites of isRelExprOneOf have the the value to check in the runtime argument list separate from the set of values to check against (which are now in the template arguments).
Just posting this explicitly so that if one of you feels strongly I can go back to the original version with constexpr and use an R_END technique to static assert (that gives a bit less protection though), but the fact that I think the callsites are cleaner for the template version seems worth it to stick with the template. Please let me know if this is good or if I should go back to the original and use R_END.
https://reviews.llvm.org/D27156
Files:
ELF/Relocations.cpp
ELF/Relocations.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27156.79704.patch
Type: text/x-patch
Size: 5303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161130/2cb114e4/attachment.bin>
More information about the llvm-commits
mailing list