diff options
author | Dean Michael Berris <dberris@google.com> | 2017-06-16 03:22:09 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-06-16 03:22:09 +0000 |
commit | 7456a281dde89ca1599967b6a2b4328d9a2592a3 (patch) | |
tree | 025ade99b5c11e9b2bb4f8fd82b45fed391df9ba /clang/test/Sema/xray-log-args-class.cpp | |
parent | 6e13ff33c89369a959eef627ae4f9acf956490ad (diff) | |
download | bcm5719-llvm-7456a281dde89ca1599967b6a2b4328d9a2592a3.tar.gz bcm5719-llvm-7456a281dde89ca1599967b6a2b4328d9a2592a3.zip |
[XRay][clang] Support capturing the implicit `this` argument to C++ class member functions
Summary:
Before this change, we couldn't capture the `this` pointer that's
implicitly the first argument of class member functions. There are some
interesting things we can do with capturing even just this single
argument for zero-argument member functions.
Reviewers: rnk, pelikan
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D34052
llvm-svn: 305544
Diffstat (limited to 'clang/test/Sema/xray-log-args-class.cpp')
-rw-r--r-- | clang/test/Sema/xray-log-args-class.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/xray-log-args-class.cpp b/clang/test/Sema/xray-log-args-class.cpp new file mode 100644 index 00000000000..10da93f614f --- /dev/null +++ b/clang/test/Sema/xray-log-args-class.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c++11 -x c++ + +class Class { + [[clang::xray_always_instrument, clang::xray_log_args(1)]] void Method(); + [[clang::xray_log_args(-1)]] void Invalid(); // expected-error {{'xray_log_args' attribute parameter 1 is out of bounds}} + [[clang::xray_log_args("invalid")]] void InvalidStringArg(); // expected-error {{'xray_log_args'}} +}; |