HomePhabricator

[SLC] sprintf(dst, "%s", str) -> strcpy(dst, str)

Authored by xbolva00 on Aug 14 2020, 2:48 PM.

Description

[SLC] sprintf(dst, "%s", str) -> strcpy(dst, str)

Transform sprintf(dst, "%s", str) -> strcpy(dst, str) if result is unused
Avoid sprintf(dest, "%s", str) -> llvm.memcpy(align 1 dest, align 1 str, strlen(str)+1) if optimizing for size.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85963