[PATCH] standardize {pred, succ, use, user}_{size, empty} like in MBB

Ahmed Bougacha ahmed.bougacha at gmail.com
Mon Jan 12 18:31:31 PST 2015


================
Comment at: include/llvm/IR/CFG.h:103
@@ +102,3 @@
+inline bool pred_empty(const BasicBlock *BB) {
+  return !pred_size(BB);
+}
----------------
This is needlessly expensive when there are preds. How about checking for _end directly? (same for succ)

================
Comment at: include/llvm/IR/Value.h:290
@@ +289,3 @@
+    unsigned Count = 0;
+    for (auto I = use_begin(), E = use_end(); I != E; I++)
+      Count++;
----------------
Nit: range-based for? (user_size as well)

http://reviews.llvm.org/D6944

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list