aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-01-13 21:52:01 +0000
committerAnna Zaks <ganna@apple.com>2012-01-13 21:52:01 +0000
commitd9b859a74ecaede23a78d37f364498102ef418c9 (patch)
tree4f63875d9e85449142ebc39904f06dd567ae2e15 /include/clang/AST
parent31cbe684302a5ccb001fa2131c0e4aeaa372f5c0 (diff)
Move identification of memory setting and copying functions (memset,
memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic could be reused in the analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST')
-rw-r--r--include/clang/AST/Decl.h21
1 files changed, 21 insertions, 0 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; }