[PATCH] D13612: [IR] Add a `makeNoWrapRegion` method to `ConstantRange`

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 15:38:03 PDT 2015


sanjoy added inline comments.

================
Comment at: lib/IR/ConstantRange.cpp:138-139
@@ +137,4 @@
+
+  assert((NoWrapKind == OBO::NoSignedWrap ||
+          NoWrapKind == OBO::NoUnsignedWrap) && "NoWrapKind invalid!");
+
----------------
nlewycky wrote:
> Please sink this below the test for BinOp being Add. It's not a misuse of the API to call it with OBO::Exact or some other flag if the BinOp is not an add.
But the API is called `makeNoWrapRegion`, so I'd say calling it with `OBO::Exact` or other flags unrelated to wrapping is a misuse.

(I don't have a very strong opinion on this, and will change it if you insist.


http://reviews.llvm.org/D13612





More information about the llvm-commits mailing list