diff options
author | Dean Michael Berris <dberris@google.com> | 2017-05-24 05:46:36 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-05-24 05:46:36 +0000 |
commit | 170429e2905b3ee19e06f5549960be72183a69ac (patch) | |
tree | 840b140b539e659d431a827d239d16dadceb53da /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 17dfebcc3900dc6de8852f252a52e4fef88abefe (diff) | |
download | bcm5719-llvm-170429e2905b3ee19e06f5549960be72183a69ac.tar.gz bcm5719-llvm-170429e2905b3ee19e06f5549960be72183a69ac.zip |
[XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=
Summary:
This change allows us to add arg1 logging support to functions through
the special case list provided through -fxray-always-instrument=. This
is useful for adding arg1 logging to functions that are either in
headers that users don't have control over (i.e. cannot change the
source) or would rather not do.
It only takes effect when the pattern is matched through the "fun:"
special case, as a category. As in:
fun:*pattern=arg1
Reviewers: pelikan, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33392
llvm-svn: 303719
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9d0f802ece0..db8f8d32abb 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1508,6 +1508,10 @@ bool CodeGenModule::imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc, case ImbueAttr::ALWAYS: Fn->addFnAttr("function-instrument", "xray-always"); break; + case ImbueAttr::ALWAYS_ARG1: + Fn->addFnAttr("function-instrument", "xray-always"); + Fn->addFnAttr("xray-log-args", "1"); + break; case ImbueAttr::NEVER: Fn->addFnAttr("function-instrument", "xray-never"); break; |