summaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-20 22:02:26 +0000
committerDan Gohman <gohman@apple.com>2010-08-20 22:02:26 +0000
commit489b29b0a4ee4526e3d50ad88d3d48745baf5042 (patch)
tree6602f14da364b9d6e0714e7b327adf14d7ffac23 /lib/Bitcode
parent95c79302259c03aa99010bbbc7d8ffeae3fa9740 (diff)
downloadllvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.gz
llvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.bz2
llvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.xz
Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd. This replaces a variety of alternate mechanisms for achieving the same effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 8f999a6875..2010468824 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -333,9 +333,9 @@ void BitcodeReaderMDValueList::AssignValue(Value *V, unsigned Idx) {
}
// If there was a forward reference to this value, replace it.
- Value *PrevVal = OldV;
+ MDNode *PrevVal = cast<MDNode>(OldV);
OldV->replaceAllUsesWith(V);
- delete PrevVal;
+ MDNode::deleteTemporary(PrevVal);
// Deleting PrevVal sets Idx value in MDValuePtrs to null. Set new
// value for Idx.
MDValuePtrs[Idx] = V;
@@ -351,7 +351,7 @@ Value *BitcodeReaderMDValueList::getValueFwdRef(unsigned Idx) {
}
// Create and return a placeholder, which will later be RAUW'd.
- Value *V = new Argument(Type::getMetadataTy(Context));
+ Value *V = MDNode::getTemporary(Context, 0, 0);
MDValuePtrs[Idx] = V;
return V;
}