[PATCH] D18438: Calculate __builtin_object_size when pointer depends on a condition

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 11:48:44 PDT 2016


george.burgess.iv added inline comments.

================
Comment at: lib/Analysis/MemoryBuiltins.cpp:390
@@ -391,1 +389,3 @@
 
+APInt ObjectSizeOffsetVisitor::getSizeWithOverflow(const SizeOffsetType &Data) {
+  if (Data.second.isNegative() || Data.first.ult(Data.second))
----------------
...But

1. It uses absolutely nothing from `ObjectSizeOffsetVisitor`
2. It's presumably useless outside of MemoryBuiltins.cpp

Because of point 1, it should ideally be a free function. Because of point 2, it should ideally be local to MemoryBuiltins.cpp. So I'm not seeing how it makes more sense to make this a public method.


Repository:
  rL LLVM

http://reviews.llvm.org/D18438





More information about the llvm-commits mailing list