[PATCH] D45657: [Instruction, BasicBlock] Add is_none_of and skipInsts helper functions.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 14 15:23:02 PDT 2018


mattd added inline comments.


================
Comment at: include/llvm/IR/BasicBlock.h:185
 
+  /// \brief Return an iterator over the instructions in the block, skipping any
+  /// instances of any of the template arguments.
----------------
I realize \brief is used throughout this header, but I do not think that is necessary anymore, because the Doxygen.cfg has AutoBrief on.


================
Comment at: include/llvm/IR/Instruction.h:703
+
+template <typename T, typename... Ts> struct is_any_of_impl<T, Ts...> {
+  static bool impl(const Instruction &I) {
----------------
I like how you made this a struct instead of just a variadic function. I was exploring a similar solution, as discussed in the aforementioned thread, but had ambiguity issues with the base case.  Looks like you cracked that! I like this.  

I wonder if it makes more sense to push this up into Casting.h since it's as specific as isa<>.


https://reviews.llvm.org/D45657





More information about the llvm-commits mailing list