[PATCH] D17572: NFC. Introduce Value::getPointerDerferecnceableBytes.

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 19:07:04 PDT 2016


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor comment addressed.


================
Comment at: include/llvm/IR/Value.h:507
@@ +506,3 @@
+  ///
+  /// Sets CanBeNull to true if the pointer is either null or can be
+  /// dereferenceable up to the returned number of bytes.
----------------
This part of the comment is unclear.  Can you reword?

================
Comment at: lib/IR/Value.cpp:522
@@ -521,1 +521,3 @@
 
+unsigned Value::getPointerDereferenceableBytes(bool &CanBeNull) const {
+  assert(getType()->isPointerTy() && "must be pointer");
----------------
As a separate patch, I think it would make sense to just kill the CanBeNull bit entirely.  The cases where we can not check for null are also ones isKnownNonNull can trivially return true for.


http://reviews.llvm.org/D17572





More information about the llvm-commits mailing list