diff options
| author | Dominic Chen <d.c.ddcc@gmail.com> | 2016-08-17 23:42:27 +0000 |
|---|---|---|
| committer | Dominic Chen <d.c.ddcc@gmail.com> | 2016-08-17 23:42:27 +0000 |
| commit | a8a638292ced193f5e00dd1e087b46790cf540cb (patch) | |
| tree | 25956cc962bdbe63f26a3ec8f6e3713ba99bbc0f /llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | |
| parent | 334ac36e667273c641eaf22e39511eddd6432752 (diff) | |
| download | bcm5719-llvm-a8a638292ced193f5e00dd1e087b46790cf540cb.tar.gz bcm5719-llvm-a8a638292ced193f5e00dd1e087b46790cf540cb.zip | |
[WebAssembly] Handle debug information and virtual registers without crashing (reland r278967)
Summary: Currently, enabling debug information when compiling for WebAssembly crashes the backend. This commit fixes these by skipping debug values in backend passes.
Reviewers: jfb, aprantl, dschuff, echristo
Subscribers: llvm-commits, dschuff, jfb, MatzeB, dexonsmith, yurydelendik, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23635
llvm-svn: 279011
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp index aa40098f246..fba1fdab140 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp @@ -255,7 +255,7 @@ static bool HasOneUse(unsigned Reg, MachineInstr *Def, const VNInfo *DefVNI = LI.getVNInfoAt( LIS.getInstructionIndex(*Def).getRegSlot()); assert(DefVNI); - for (auto I : MRI.use_nodbg_operands(Reg)) { + for (auto &I : MRI.use_nodbg_operands(Reg)) { const auto &Result = LI.Query(LIS.getInstructionIndex(*I.getParent())); if (Result.valueIn() == DefVNI) { if (!Result.isKill()) @@ -360,7 +360,7 @@ static bool OneUseDominatesOtherUses(unsigned Reg, const MachineOperand &OneUse, const MachineInstr *OneUseInst = OneUse.getParent(); VNInfo *OneUseVNI = LI.getVNInfoBefore(LIS.getInstructionIndex(*OneUseInst)); - for (const MachineOperand &Use : MRI.use_operands(Reg)) { + for (const MachineOperand &Use : MRI.use_nodbg_operands(Reg)) { if (&Use == &OneUse) continue; |

