summaryrefslogtreecommitdiffstats
path: root/lldb/lit/tools/lldb-instr/Inputs
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-03 21:31:22 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-03 21:31:22 +0000
commit306809f292c9dd26e1a901b139f65976cdd5a4b2 (patch)
treeb22cc9af74e85c1ab680b7ad5a8ac035fda72f5e /lldb/lit/tools/lldb-instr/Inputs
parent7c711ccf36e0a818f76d711715956ffe831f53b6 (diff)
downloadbcm5719-llvm-306809f292c9dd26e1a901b139f65976cdd5a4b2.tar.gz
bcm5719-llvm-306809f292c9dd26e1a901b139f65976cdd5a4b2.zip
[Reproducers] Capture return values of functions returning by ptr/ref
For some reason I had convinced myself that functions returning by pointer or reference do not require recording their result. However, after further considering I don't see how that could work, at least not with the current implementation. Interestingly enough, the reproducer instrumentation already (mostly) accounts for this, though the lldb-instr tool did not. This patch adds the missing macros and updates the lldb-instr tool. Differential revision: https://reviews.llvm.org/D60178 llvm-svn: 357639
Diffstat (limited to 'lldb/lit/tools/lldb-instr/Inputs')
-rw-r--r--lldb/lit/tools/lldb-instr/Inputs/foo.cpp8
-rw-r--r--lldb/lit/tools/lldb-instr/Inputs/foo.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/lldb/lit/tools/lldb-instr/Inputs/foo.cpp b/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
index 36a73236a42..981b911eee2 100644
--- a/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
+++ b/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
@@ -16,3 +16,11 @@ Foo Foo::H() { return Foo(); }
void Foo::I() const { MACRO_FOO; }
Bar Foo::J() const { return MACRO_BAR(Bar()); }
Bar Foo::K(void *v) const { return Bar(); }
+Bar &Foo::L() const {
+ Bar *b = new Bar();
+ return *b;
+};
+Bar *Foo::M() const {
+ Bar *b = new Bar();
+ return b;
+};
diff --git a/lldb/lit/tools/lldb-instr/Inputs/foo.h b/lldb/lit/tools/lldb-instr/Inputs/foo.h
index 9e2608e2b9e..fb76e046e02 100644
--- a/lldb/lit/tools/lldb-instr/Inputs/foo.h
+++ b/lldb/lit/tools/lldb-instr/Inputs/foo.h
@@ -14,4 +14,6 @@ struct Foo {
void I() const;
Bar J() const;
Bar K(void *v) const;
+ Bar &L() const;
+ Bar *M() const;
};
OpenPOWER on IntegriCloud