diff options
author | Anna Zaks <ganna@apple.com> | 2012-01-13 21:52:01 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-01-13 21:52:01 +0000 |
commit | d9b859a74ecaede23a78d37f364498102ef418c9 (patch) | |
tree | 4f63875d9e85449142ebc39904f06dd567ae2e15 /include/clang/AST/Decl.h | |
parent | 31cbe684302a5ccb001fa2131c0e4aeaa372f5c0 (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/Decl.h')
-rw-r--r-- | include/clang/AST/Decl.h | 21 |
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; } |