Optimize MDNode to coallocate the operand list immediately

after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-12-31 01:05:46 +00:00
parent cc7b011728
commit b76359e36e
3 changed files with 62 additions and 42 deletions
+1 -1
View File
@@ -284,7 +284,7 @@ void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) {
if (getNode() != D.getNode()) {
MDNode *Node = DbgNode;
Node->replaceAllUsesWith(D.getNode());
delete Node;
Node->destroy();
}
}