diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-11-08 22:04:43 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-11-08 22:04:43 +0000 |
commit | a8e56458e6689c25e647664ea9d9c09459a0ade9 (patch) | |
tree | 36c3e066bcd397b2b97a42861b4dca585b455028 /llvm/lib/IR/DIBuilder.cpp | |
parent | 2c74fe977daf8d1d4c8b64cdd6d3a9999a4b4655 (diff) | |
download | bcm5719-llvm-a8e56458e6689c25e647664ea9d9c09459a0ade9.tar.gz bcm5719-llvm-a8e56458e6689c25e647664ea9d9c09459a0ade9.zip |
Let replaceVTableHolder accept any type.
In Rust, a trait can be implemented for any type, and if a trait
object pointer is used for the type, then a virtual table will be
emitted for that trait/type combination.
We would like debuggers to be able to inspect trait objects, which
requires finding the concrete type associated with a given vtable.
This patch changes LLVM so that any type can be passed to
replaceVTableHolder. This allows the Rust compiler to emit the needed
debug info -- associating a vtable with the concrete type for which it
was emitted.
This is a DWARF extension: DWARF only specifies the meaning of
DW_AT_containing_type in one specific situation. This style of DWARF
extension is routine, though, and LLVM already has one such case for
DW_AT_containing_type.
Patch by Tom Tromey!
Differential Revision: https://reviews.llvm.org/D39503
llvm-svn: 317730
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 18979a8d5cf..837b1ec5857 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -874,7 +874,7 @@ Instruction *DIBuilder::insertDbgValueIntrinsic( } void DIBuilder::replaceVTableHolder(DICompositeType *&T, - DICompositeType *VTableHolder) { + DIType *VTableHolder) { { TypedTrackingMDRef<DICompositeType> N(T); N->replaceVTableHolder(VTableHolder); |