From 306809f292c9dd26e1a901b139f65976cdd5a4b2 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 3 Apr 2019 21:31:22 +0000 Subject: [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 --- lldb/lit/tools/lldb-instr/Inputs/foo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lldb/lit/tools/lldb-instr/Inputs/foo.cpp') diff --git a/lldb/lit/tools/lldb-instr/Inputs/foo.cpp b/lldb/lit/tools/lldb-instr/Inputs/foo.cpp index 36a7323..981b911 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; +}; -- cgit v1.1