summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2019-02-14 12:00:34 +0000
committerClement Courbet <courbet@google.com>2019-02-14 12:00:34 +0000
commit8c3343dfd546ee7e11ff158fbd989e83ac9165a9 (patch)
tree6e739f98cfc1cecccf9b5092516a7601e70bff2e /clang/lib/AST/Decl.cpp
parent5d9b8eed85e5530ce961bbe94709d83d773e46dc (diff)
downloadbcm5719-llvm-8c3343dfd546ee7e11ff158fbd989e83ac9165a9.tar.gz
bcm5719-llvm-8c3343dfd546ee7e11ff158fbd989e83ac9165a9.zip
[Builtins] Treat `bcmp` as a builtin.
Summary: This makes it consistent with `memcmp` and `__builtin_bcmp`. Also see the discussion in https://reviews.llvm.org/D56593. Reviewers: jyknight Subscribers: kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58120 llvm-svn: 354023
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 98962461a7e..4f49bd79878 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -3672,6 +3672,10 @@ unsigned FunctionDecl::getMemoryFunctionKind() const {
case Builtin::BImemcmp:
return Builtin::BImemcmp;
+ case Builtin::BI__builtin_bcmp:
+ case Builtin::BIbcmp:
+ return Builtin::BIbcmp;
+
case Builtin::BI__builtin_strncpy:
case Builtin::BI__builtin___strncpy_chk:
case Builtin::BIstrncpy:
@@ -3712,6 +3716,8 @@ unsigned FunctionDecl::getMemoryFunctionKind() const {
return Builtin::BImemmove;
else if (FnInfo->isStr("memcmp"))
return Builtin::BImemcmp;
+ else if (FnInfo->isStr("bcmp"))
+ return Builtin::BIbcmp;
else if (FnInfo->isStr("strncpy"))
return Builtin::BIstrncpy;
else if (FnInfo->isStr("strncmp"))
OpenPOWER on IntegriCloud