diff options
author | Chris Lattner <sabre@nondot.org> | 2011-03-01 00:24:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-03-01 00:24:51 +0000 |
commit | d3e768ecabf76859e2224f4509a94325ec5ab7c7 (patch) | |
tree | 48afe6f1278f1abffa90b38794e4fb9ea98b07d7 | |
parent | 918de31976a7c40b9b292e2ed491213743aaab5d (diff) | |
download | external_llvm-d3e768ecabf76859e2224f4509a94325ec5ab7c7.zip external_llvm-d3e768ecabf76859e2224f4509a94325ec5ab7c7.tar.gz external_llvm-d3e768ecabf76859e2224f4509a94325ec5ab7c7.tar.bz2 |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126719 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index e01df01..45da3dd 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -1325,6 +1325,21 @@ codegen. //===---------------------------------------------------------------------===// +simplifylibcalls should turn these snprintf idioms into memcpy (GCC PR47917) + +char buf1[6], buf2[6], buf3[4], buf4[4]; +int i; + +int foo (void) { + int ret = snprintf (buf1, sizeof buf1, "abcde"); + ret += snprintf (buf2, sizeof buf2, "abcdef") * 16; + ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256; + ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh")*4096; + return ret; +} + +//===---------------------------------------------------------------------===// + "gas" uses this idiom: else if (strchr ("+-/*%|&^:[]()~", *intel_parser.op_string)) .. |