diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-02-18 11:19:02 +0100 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-02-18 11:22:12 +0100 |
commit | 51d8c598331b25568b38691575c39729ae81a059 (patch) | |
tree | b9487f122fdbf98379a9a2ec17030c784e3e87fd /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 00539d8b6425529240d970082c23e6ee1263669b (diff) | |
download | llvm-51d8c598331b25568b38691575c39729ae81a059.zip llvm-51d8c598331b25568b38691575c39729ae81a059.tar.gz llvm-51d8c598331b25568b38691575c39729ae81a059.tar.bz2 |
[lldb] Don't model std::atomic as a transparent data structure in the data formatter
Summary:
Currently the data formatter is treating `std::atomic` variables as transparent wrappers
around their underlying value type. This causes that when printing `std::atomic<A *>`, the data
formatter will forward all requests for the children of the atomic variable to the `A *` pointer type
which will then return the respective members of `A`. If `A` in turn has a member that contains
the original atomic variable, this causes LLDB to infinitely recurse when printing an object with
such a `std::atomic` pointer member.
We could implement a workaround similar to whatever we do for pointer values but this patch
just implements the `std::atomic` formatter in the same way as we already implement other
formatters (e.g. smart pointers or `std::optional`) that just model the contents of the as a child
"Value". This way LLDB knows when it actually prints a pointer and can just use its normal
workaround if "Value" is a recursive pointer.
Fixes rdar://59189235
Reviewers: JDevlieghere, jingham, shafik
Reviewed By: shafik
Subscribers: shafik, christof, jfb, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74310
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions