summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-22 18:23:44 +0000
committerDevang Patel <dpatel@apple.com>2009-07-22 18:23:44 +0000
commitf03c9bec63da8718b4531db2ba24658609302fe7 (patch)
tree3606af16795e6102a34188c1b1ea9f38d1e9febe /llvm/lib/Analysis/DebugInfo.cpp
parente171bc8ae5cb6ab3d9024aa10e8d49204cbd487b (diff)
downloadbcm5719-llvm-f03c9bec63da8718b4531db2ba24658609302fe7.tar.gz
bcm5719-llvm-f03c9bec63da8718b4531db2ba24658609302fe7.zip
Add replaceAllUsesWith() to FE replace debug info constructs while building complex types.
llvm-svn: 76765
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 437ff03b327..aa012ef8bcb 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -206,6 +206,18 @@ unsigned DIArray::getNumElements() const {
return C->getNumOperands();
}
+/// replaceAllUsesWith - Replace all uses of debug info referenced by
+/// this descriptor. After this completes, the current debug info value
+/// is erased.
+void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) {
+ if (isNull())
+ return;
+
+ assert (D.isNull() && "Can not replace with null");
+ getGV()->replaceAllUsesWith(D.getGV());
+ getGV()->eraseFromParent();
+}
+
/// Verify - Verify that a compile unit is well formed.
bool DICompileUnit::Verify() const {
if (isNull())
OpenPOWER on IntegriCloud