summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/XRayLists.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-05-24 05:46:36 +0000
committerDean Michael Berris <dberris@google.com>2017-05-24 05:46:36 +0000
commit170429e2905b3ee19e06f5549960be72183a69ac (patch)
tree840b140b539e659d431a827d239d16dadceb53da /clang/lib/Basic/XRayLists.cpp
parent17dfebcc3900dc6de8852f252a52e4fef88abefe (diff)
downloadbcm5719-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/Basic/XRayLists.cpp')
-rw-r--r--clang/lib/Basic/XRayLists.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/XRayLists.cpp b/clang/lib/Basic/XRayLists.cpp
index dccf3baa75e..0a439c7af90 100644
--- a/clang/lib/Basic/XRayLists.cpp
+++ b/clang/lib/Basic/XRayLists.cpp
@@ -26,6 +26,8 @@ XRayFunctionFilter::ImbueAttribute
XRayFunctionFilter::shouldImbueFunction(StringRef FunctionName) const {
// First apply the always instrument list, than if it isn't an "always" see
// whether it's treated as a "never" instrument function.
+ if (AlwaysInstrument->inSection("fun", FunctionName, "arg1"))
+ return ImbueAttribute::ALWAYS_ARG1;
if (AlwaysInstrument->inSection("fun", FunctionName))
return ImbueAttribute::ALWAYS;
if (NeverInstrument->inSection("fun", FunctionName))
OpenPOWER on IntegriCloud