OLD | NEW |
1 //===-- ExpandUtils.cpp - Helper functions for expansion passes -----------===// | 1 //===-- ExpandUtils.cpp - Helper functions for expansion passes -----------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 | 9 |
10 #include "llvm/IR/BasicBlock.h" | 10 #include "llvm/IR/BasicBlock.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // incoming value. | 31 // incoming value. |
32 BasicBlock *BB = PN->getIncomingBlock(*U); | 32 BasicBlock *BB = PN->getIncomingBlock(*U); |
33 for (unsigned I = 0; I < PN->getNumIncomingValues(); ++I) { | 33 for (unsigned I = 0; I < PN->getNumIncomingValues(); ++I) { |
34 if (PN->getIncomingBlock(I) == BB) | 34 if (PN->getIncomingBlock(I) == BB) |
35 PN->setIncomingValue(I, NewVal); | 35 PN->setIncomingValue(I, NewVal); |
36 } | 36 } |
37 } else { | 37 } else { |
38 U->getUser()->replaceUsesOfWith(U->get(), NewVal); | 38 U->getUser()->replaceUsesOfWith(U->get(), NewVal); |
39 } | 39 } |
40 } | 40 } |
| 41 |
| 42 Instruction *llvm::CopyDebug(Instruction *NewInst, Instruction *Original) { |
| 43 NewInst->setDebugLoc(Original->getDebugLoc()); |
| 44 return NewInst; |
| 45 } |
OLD | NEW |