summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/strndup.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] Annotate strndup calls with dereferenceable_or_nullDavid Bolvansky2019-09-231-1/+1
| | | | | | "Implementations are free to malloc() a buffer containing either (size + 1) bytes or (strnlen(s, size) + 1) bytes. Applications should not assume that strndup() will allocate (size + 1) bytes when strlen(s) is smaller than size." llvm-svn: 372647
* [SLC] Convert some strndup calls to strdup callsDavid Bolvansky2019-09-231-0/+67
Summary: Motivation: - If we can fold it to strdup, we should (strndup does more things than strdup). - Annotation mechanism. (Works for strdup well). strdup and strndup are part of C 20 (currently posix fns), so we should optimize them. Reviewers: efriedma, jdoerfert Reviewed By: jdoerfert Subscribers: lebedev.ri, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67679 llvm-svn: 372636
OpenPOWER on IntegriCloud