[PATCH] D45418: [SimplifyLibcalls] Atoi, strtol replacements

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 17:20:13 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1685
+
+  return ConstantInt::get(CI->getType(), atoi(Str.str().c_str()));
+}
----------------
xbolva00 wrote:
> efriedma wrote:
> > I'm worried about host behavior leaking through here; specifically, the "undefined" values for overflow might vary. Could you use some function with more predictable behavior here?  (Maybe something based on llvm::consumeSignedInteger()?)
> We should call that function when we can call strtol directly?
I guess we can just call strtol, sure.


https://reviews.llvm.org/D45418





More information about the llvm-commits mailing list