diff options
author | Anna Zaks <ganna@apple.com> | 2012-01-17 00:37:07 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-01-17 00:37:07 +0000 |
commit | 0a151a137a68bb656acbcce7ff2407613bb80cfc (patch) | |
tree | 129f7d790b7cec9541c6d152fd876f451dd2c131 /include/clang/AST/Decl.h | |
parent | 022b3f4490bbdcde7b3f18ce0498f9a73b6cbf53 (diff) |
Use Builtin ID as the return value
for FunctionDecl::getMemoryFunctionKind().
This is a follow up on the Chris's review for r148142: We don't want to
pollute FunctionDecl with an extra enum. (To make this work, added
memcmp and family to the library builtins.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Decl.h')
-rw-r--r-- | include/clang/AST/Decl.h | 25 |
1 files changed, 5 insertions, 20 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()); } |