From: Daniel Dunbar Date: Thu, 9 Apr 2009 16:42:50 +0000 (+0000) Subject: Add more builtin definitions, including strcmp. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a0048b3f59b9623e33bda2609c7a9fefc4a65c3;p=clang Add more builtin definitions, including strcmp. - PR3964. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68710 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Builtins.def b/include/clang/AST/Builtins.def index 104c5a8621..9e2e7859ee 100644 --- a/include/clang/AST/Builtins.def +++ b/include/clang/AST/Builtins.def @@ -134,16 +134,33 @@ BUILTIN(__builtin_va_start, "vA.", "n") BUILTIN(__builtin_va_end, "vA", "n") BUILTIN(__builtin_va_copy, "vAA", "n") BUILTIN(__builtin_stdarg_start, "vA.", "n") +BUILTIN(__builtin_bcmp, "iv*v*z", "n") +BUILTIN(__builtin_bcopy, "vv*v*z", "n") BUILTIN(__builtin_bzero, "vv*z", "n") -BUILTIN(__builtin_memcpy, "v*v*vC*z", "n") -BUILTIN(__builtin_memmove, "v*v*vC*z", "n") -BUILTIN(__builtin_memset, "v*v*iz", "n") +BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF") +BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF") +BUILTIN(__builtin_memmove, "v*v*vC*z", "nF") +BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF") +BUILTIN(__builtin_memset, "v*v*iz", "nF") +BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF") +BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF") +BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF") BUILTIN(__builtin_strcat, "c*c*cC*", "nF") -BUILTIN(__builtin_strncat, "c*c*cC*z", "nF") +BUILTIN(__builtin_strchr, "c*cC*i", "nF") +BUILTIN(__builtin_strcmp, "icC*cC*", "nF") BUILTIN(__builtin_strcpy, "c*c*cC*", "nF") +BUILTIN(__builtin_strcspn, "zcC*cC*", "nF") +BUILTIN(__builtin_strdup, "c*cC*", "nF") +BUILTIN(__builtin_strlen, "zcC*", "nF") +BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF") +BUILTIN(__builtin_strncat, "c*c*cC*z", "nF") +BUILTIN(__builtin_strncmp, "icC*cC*z", "nF") BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF") -BUILTIN(__builtin_strchr, "c*cC*i", "nF") +BUILTIN(__builtin_strndup, "c*cC*z", "nF") +BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF") BUILTIN(__builtin_strrchr, "c*cC*i", "nF") +BUILTIN(__builtin_strspn, "zcC*cC*", "nF") +BUILTIN(__builtin_strstr, "c*cC*cC*", "nF") BUILTIN(__builtin_return_address, "v*Ui", "n") BUILTIN(__builtin_frame_address, "v*Ui", "n") BUILTIN(__builtin_flt_rounds, "i", "nc") diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c index d14a29e572..8735cc613b 100644 --- a/test/CodeGen/builtins.c +++ b/test/CodeGen/builtins.c @@ -81,6 +81,7 @@ int main() { int a, b, n = random(); // Avoid optimizing out. char s0[10], s1[] = "Hello"; V(strcat, (s0, s1)); + V(strcmp, (s0, s1)); V(strncat, (s0, s1, n)); V(strchr, (s0, s1[0])); V(strrchr, (s0, s1[0]));