diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-11 23:21:39 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-11 23:21:39 +0000 |
commit | e3cd735ea6378e5dd7765828f560ed49be845a95 (patch) | |
tree | 91101427ae598d9ea6ced7a2e44f0f4f209fe4a9 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 796ac80b863ed92c3d8bcc296f678ff416afc8a8 (diff) | |
download | bcm5719-llvm-e3cd735ea6378e5dd7765828f560ed49be845a95.tar.gz bcm5719-llvm-e3cd735ea6378e5dd7765828f560ed49be845a95.zip |
Add a new attribute, fortify_stdlib
This attribute applies to declarations of C stdlib functions
(sprintf, memcpy...) that have known fortified variants
(__sprintf_chk, __memcpy_chk, ...). When applied, clang will emit
calls to the fortified variant functions instead of calls to the
defaults.
In GCC, this is done by adding gnu_inline-style wrapper functions,
but that doesn't work for us for variadic functions because we don't
support __builtin_va_arg_pack (and have no intention to).
This attribute takes two arguments, the first is 'type' argument
passed through to __builtin_object_size, and the second is a flag
argument that gets passed through to the variadic checking variants.
rdar://47905754
Differential revision: https://reviews.llvm.org/D57918
llvm-svn: 353765
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 027ab0d6a20..9452de899fb 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -3697,6 +3697,10 @@ public: RValue EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue); + RValue emitFortifiedStdLibCall(CodeGenFunction &CGF, const CallExpr *CE, + unsigned BuiltinID, unsigned BOSType, + unsigned Flag); + RValue emitRotate(const CallExpr *E, bool IsRotateRight); /// Emit IR for __builtin_os_log_format. |