[PATCH] D130666: [InstCombine] Add support for strlcpy folding

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 13:55:52 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:699
+    annotateNonNullNoUndefBasedOnAccess(CI, 0);
+    annotateNonNullNoUndefBasedOnAccess(CI, 1);
+  }
----------------
strlcpy accesses the second argument no matter what the size is (so it can compute the return value).


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:726
+  bool NulTerm = false;
+  if (NBytes > SrcLen + 1) {
+    NBytes = SrcLen + 1;
----------------
`>=`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130666/new/

https://reviews.llvm.org/D130666



More information about the llvm-commits mailing list