aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Decl.h25
-rw-r--r--include/clang/Basic/Builtins.def5
-rw-r--r--include/clang/Sema/Sema.h2
3 files changed, 11 insertions, 21 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 5c6b447f91..4016c2085f 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -1986,26 +1986,11 @@ public:
/// definition of a member function.
virtual bool isOutOfLine() const;
- /// \brief Enumeration used to identify memory setting or copying functions
- /// identified by getMemoryFunctionKind().
- enum MemoryFunctionKind {
- MFK_Memset,
- MFK_Memcpy,
- MFK_Memmove,
- MFK_Memcmp,
- MFK_Strncpy,
- MFK_Strncmp,
- MFK_Strncasecmp,
- MFK_Strncat,
- MFK_Strndup,
- MFK_Strlcpy,
- MFK_Strlcat,
- MFK_Invalid
- };
-
- /// \brief If the given function is a memory copy or setting function, return
- /// it's kind. If the function is not a memory function, returns MFK_Invalid.
- MemoryFunctionKind getMemoryFunctionKind();
+ /// \brief Identify a memory copying or setting function.
+ /// If the given function is a memory copy or setting function, returns
+ /// the corresponding Builtin ID. If the function is not a memory function,
+ /// returns 0.
+ unsigned getMemoryFunctionKind();
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def
index 5942e53eaf..e3e2d7c26b 100644
--- a/include/clang/Basic/Builtins.def
+++ b/include/clang/Basic/Builtins.def
@@ -631,9 +631,12 @@ LIBBUILTIN(malloc, "v*z", "f", "stdlib.h", ALL_LANGUAGES)
LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h", ALL_LANGUAGES)
// C99 string.h
LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES)
+LIBBUILTIN(memcmp, "ivC*vC*z", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(memmove, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES)
+LIBBUILTIN(strcmp, "icC*cC*", "f", "string.h", ALL_LANGUAGES)
+LIBBUILTIN(strncmp, "icC*cC*z", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(strcat, "c*c*cC*", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(strxfrm, "zc*cC*z", "f", "string.h", ALL_LANGUAGES)
@@ -678,6 +681,8 @@ LIBBUILTIN(strndup, "c*cC*z", "f", "string.h", ALL_LANGUAGES)
LIBBUILTIN(index, "c*cC*i", "f", "strings.h", ALL_LANGUAGES)
LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h", ALL_LANGUAGES)
LIBBUILTIN(bzero, "vv*z", "f", "strings.h", ALL_LANGUAGES)
+LIBBUILTIN(strcasecmp, "icC*cC*", "f", "strings.h", ALL_LANGUAGES)
+LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_LANGUAGES)
// POSIX unistd.h
LIBBUILTIN(_exit, "vi", "fr", "unistd.h", ALL_LANGUAGES)
LIBBUILTIN(vfork, "i", "fj", "unistd.h", ALL_LANGUAGES)
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index c4af62530a..242af88c89 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -6315,7 +6315,7 @@ private:
bool isPrintf);
void CheckMemaccessArguments(const CallExpr *Call,
- FunctionDecl::MemoryFunctionKind CMF,
+ unsigned BId,
IdentifierInfo *FnName);
void CheckStrlcpycatArguments(const CallExpr *Call,