[PATCH] D43704: Utility functions for checked arithmetic

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 13:34:10 PST 2018

vsk added inline comments.

Comment at: include/llvm/Support/CheckedArithmetic.h:31
+                        bool>::type
+    T LHS, T RHS,
Can you move this out of the llvm namespace, into an anonymous namespace?

Comment at: include/llvm/Support/CheckedArithmetic.h:33
+    T LHS, T RHS,
+    std::function<llvm::APInt(llvm::APInt *, const llvm::APInt &, bool &)> Op,
+    T *Res = nullptr) {
I'd rather just have the type of the function be some free template parameter, then, so it's clear the object isn't copied.


More information about the llvm-commits mailing list