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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 06:50:18 PDT 2018


xbolva00 marked an inline comment as done.
xbolva00 added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1685
+
+  return ConstantInt::get(CI->getType(), atoi(Str.str().c_str()));
+}
----------------
efriedma wrote:
> 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.
So now is this patch good to go? 


https://reviews.llvm.org/D45418





More information about the llvm-commits mailing list