[PATCH] D107378: Make enum iteration with seq safe by default

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 05:02:53 PDT 2021


nikic added a comment.

For what it's worth, I really don't like this change. Seems like unnecessary complexity for very little gain.

Case in point, while `CmpInst::Predicate` is marked as safe to iterate by this change, this is not actually correct. It's safe to iterate all FCMP predicates and it's safe to iterate all ICMP predicates, but it's not safe to cross between those -- there is an unassigned range between them.



================
Comment at: llvm/include/llvm/IR/InstrTypes.h:22
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/Sequence.h"
 #include "llvm/ADT/StringMap.h"
----------------
Should forward declare the template instead?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107378/new/

https://reviews.llvm.org/D107378



More information about the llvm-commits mailing list