summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 04:12:02 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 04:12:02 +0000
commit8d33fdc3bfb2efa1116caa693138e03718eec238 (patch)
tree7adc15d4f96322d71cce125e036c75bef332a228 /llvm/lib/IR/DIBuilder.cpp
parentd5e6a153ad0449dc019cb6a7ce41f71478d8e491 (diff)
downloadbcm5719-llvm-8d33fdc3bfb2efa1116caa693138e03718eec238.tar.gz
bcm5719-llvm-8d33fdc3bfb2efa1116caa693138e03718eec238.zip
DebugInfo: Remove DICompositeType mutation API
Change `DIBuilder` to mutate `MDCompositeTypeBase` directly, and remove the wrapping API in `DICompositeType`. llvm-svn: 234289
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index ba314b45462..fd863810068 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -835,7 +835,11 @@ Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V, uint64_t Offset,
}
void DIBuilder::replaceVTableHolder(DICompositeType &T, DICompositeType VTableHolder) {
- T.setContainingType(VTableHolder);
+ {
+ TypedTrackingMDRef<MDCompositeTypeBase> N(T);
+ N->replaceVTableHolder(MDTypeRef::get(VTableHolder));
+ T = N.get();
+ }
// If this didn't create a self-reference, just return.
if (T != VTableHolder)
@@ -851,7 +855,14 @@ void DIBuilder::replaceVTableHolder(DICompositeType &T, DICompositeType VTableHo
void DIBuilder::replaceArrays(DICompositeType &T, DIArray Elements,
DIArray TParams) {
- T.setArrays(Elements, TParams);
+ {
+ TypedTrackingMDRef<MDCompositeTypeBase> N(T);
+ if (Elements)
+ N->replaceElements(cast<MDTuple>(Elements.get()));
+ if (TParams)
+ N->replaceTemplateParams(cast<MDTuple>(TParams.get()));
+ T = N.get();
+ }
// If T isn't resolved, there's no problem.
if (!T->isResolved())
OpenPOWER on IntegriCloud