Replace with a "null" RAUW with an assert since we'd actually like
authorEric Christopher <echristo@gmail.com>
Wed, 24 Jul 2013 01:51:12 +0000 (01:51 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 24 Jul 2013 01:51:12 +0000 (01:51 +0000)
to assume we're replacing. Clarify comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187018 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DebugInfo.cpp

index f0593450ee1a91badda24c625dff9ac5dcdd4429..c7cdb80a6ace901717807e99ce1428f1b42823c4 100644 (file)
@@ -327,11 +327,11 @@ unsigned DIArray::getNumElements() const {
   return DbgNode->getNumOperands();
 }
 
-/// replaceAllUsesWith - Replace all uses of debug info referenced by
-/// this descriptor.
+/// replaceAllUsesWith - Replace all uses of the MDNode used by this
+/// type with the one in the passed descriptor.
 void DIType::replaceAllUsesWith(DIDescriptor &D) {
-  if (!DbgNode)
-    return;
+
+  assert(DbgNode && "Trying to replace an unverified type!");
 
   // Since we use a TrackingVH for the node, its easy for clients to manufacture
   // legitimate situations where they want to replaceAllUsesWith() on something
@@ -347,11 +347,11 @@ void DIType::replaceAllUsesWith(DIDescriptor &D) {
   }
 }
 
-/// replaceAllUsesWith - Replace all uses of debug info referenced by
-/// this descriptor.
+/// replaceAllUsesWith - Replace all uses of the MDNode used by this
+/// type with the one in D.
 void DIType::replaceAllUsesWith(MDNode *D) {
-  if (!DbgNode)
-    return;
+
+  assert(DbgNode && "Trying to replace an unverified type!");
 
   // Since we use a TrackingVH for the node, its easy for clients to manufacture
   // legitimate situations where they want to replaceAllUsesWith() on something