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 | 4d74a8eaaea0a51e22ef12571059b3684b677090 (patch) | |
tree | 553edb39b7139c35d7b59c0c478aa026da24081d /lib/Basic/XRayLists.cpp | |
parent | eb4bbc485efa53f413a482ea7240c4b9918713c3 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/XRayLists.cpp')
-rw-r--r-- | lib/Basic/XRayLists.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Basic/XRayLists.cpp b/lib/Basic/XRayLists.cpp index dccf3baa75..0a439c7af9 100644 --- a/lib/Basic/XRayLists.cpp +++ b/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)) |