[PATCH] D16204: ValueTracking: Use fixed array for assumption exclude set in Query; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 10:28:42 PST 2016


sanjoy added a comment.

Minor drive-by comments inline.


================
Comment at: lib/Analysis/ValueTracking.cpp:102
@@ +101,3 @@
+  /// on.
+  const Value *Excluded[MaxDepth];
+  unsigned NumExcluded;
----------------
Why not `std::array`?

================
Comment at: lib/Analysis/ValueTracking.cpp:117
@@ +116,3 @@
+  bool isExcluded(const Value *Value) const {
+    for (unsigned I = 0; I < NumExcluded; ++I) {
+      if (Excluded[I] == Value)
----------------
This can be a call to `find` or `any_of` from `STLExtras.h` if you use an `std::array` for `Excluded`.


Repository:
  rL LLVM

http://reviews.llvm.org/D16204





More information about the llvm-commits mailing list