summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2019-12-11 21:30:10 +0100
committerserge-sans-paille <sguelton@redhat.com>2020-01-09 17:31:00 +0100
commitcee4a1c957426e9477c8579ff960c8c2bd4af9e2 (patch)
tree6ae81e86924a355e2ce2fe41118af4f2b71a035a /clang/lib/AST/Decl.cpp
parentd27a15fed79c8e8484825ce6c3ce1682daeb1547 (diff)
downloadbcm5719-llvm-cee4a1c957426e9477c8579ff960c8c2bd4af9e2.tar.gz
bcm5719-llvm-cee4a1c957426e9477c8579ff960c8c2bd4af9e2.zip
Improve support of GNU mempcpy
- Lower to the memcpy intrinsic - Raise warnings when size/bounds are known Differential Revision: https://reviews.llvm.org/D71374
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index e760fff2ff6..be59d88b73f 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -3879,6 +3879,11 @@ unsigned FunctionDecl::getMemoryFunctionKind() const {
case Builtin::BImemcpy:
return Builtin::BImemcpy;
+ case Builtin::BI__builtin_mempcpy:
+ case Builtin::BI__builtin___mempcpy_chk:
+ case Builtin::BImempcpy:
+ return Builtin::BImempcpy;
+
case Builtin::BI__builtin_memmove:
case Builtin::BI__builtin___memmove_chk:
case Builtin::BImemmove:
@@ -3936,6 +3941,8 @@ unsigned FunctionDecl::getMemoryFunctionKind() const {
return Builtin::BImemset;
else if (FnInfo->isStr("memcpy"))
return Builtin::BImemcpy;
+ else if (FnInfo->isStr("mempcpy"))
+ return Builtin::BImempcpy;
else if (FnInfo->isStr("memmove"))
return Builtin::BImemmove;
else if (FnInfo->isStr("memcmp"))
OpenPOWER on IntegriCloud