While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131907 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2011-05-23 17:35:08 +00:00
parent 88c62fc1b4
commit 35b6994608
2 changed files with 51 additions and 0 deletions

View File

@@ -5150,6 +5150,9 @@ void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To,
"Cannot replace with this method!");
assert(From != To.getNode() && "Cannot replace uses of with self");
// Transfer debug values.
TransferDbgValues(FromN, To);
// Iterate over all the existing uses of From. New uses will be added
// to the beginning of the use list, which we avoid visiting.
// This specifically avoids visiting uses of From that arise while the