aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Decl.h21
-rw-r--r--include/clang/Sema/Sema.h17
2 files changed, 23 insertions, 15 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 3b04c25ce5..7e9e9bfb3a 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -1968,6 +1968,27 @@ 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();
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classof(const FunctionDecl *D) { return true; }
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index d570a77936..61d3022d52 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -6311,21 +6311,8 @@ private:
unsigned format_idx, unsigned firstDataArg,
bool isPrintf);
- /// \brief Enumeration used to describe which of the memory setting or copying
- /// functions is being checked by \c CheckMemaccessArguments().
- enum CheckedMemoryFunction {
- CMF_Memset,
- CMF_Memcpy,
- CMF_Memmove,
- CMF_Memcmp,
- CMF_Strncpy,
- CMF_Strncmp,
- CMF_Strncasecmp,
- CMF_Strncat,
- CMF_Strndup
- };
-
- void CheckMemaccessArguments(const CallExpr *Call, CheckedMemoryFunction CMF,
+ void CheckMemaccessArguments(const CallExpr *Call,
+ FunctionDecl::MemoryFunctionKind CMF,
IdentifierInfo *FnName);
void CheckStrlcpycatArguments(const CallExpr *Call,