aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
diff options
context:
space:
mode:
authorYury Delendik <ydelendik@mozilla.com>2019-01-15 18:14:12 +0000
committerYury Delendik <ydelendik@mozilla.com>2019-01-15 18:14:12 +0000
commitbe24c0200303f04c1db3353d34b83a095387c29e (patch)
treeec3ea96073a5e0c40795d01715e69b828a867c80 /llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
parentd8024371a5eac3fe75a5df75963fb508d9976f60 (diff)
downloadllvm-be24c0200303f04c1db3353d34b83a095387c29e.zip
llvm-be24c0200303f04c1db3353d34b83a095387c29e.tar.gz
llvm-be24c0200303f04c1db3353d34b83a095387c29e.tar.bz2
[WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify
Summary: As described in PR40209, there can be issues in DBG_VALUEs handling when multiple defs present in a BB. This patch adds logic for detection of related to def DBG_VALUEs and localizes register update and movement to found DBG_VALUEs. Reviewers: aheejin Subscribers: mgorny, dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56401 llvm-svn: 351216
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h b/llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
new file mode 100644
index 0000000..73f3172
--- /dev/null
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
@@ -0,0 +1,38 @@
+// WebAssemblyDebugValueManager.h - WebAssembly DebugValue Manager -*- C++ -*-//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains the declaration of the WebAssembly-specific
+/// manager for DebugValues associated with the specific MachineInstr.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H
+#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H
+
+#include "llvm/ADT/SmallVector.h"
+
+namespace llvm {
+
+class MachineInstr;
+
+class WebAssemblyDebugValueManager {
+ SmallVector<MachineInstr *, 2> DbgValues;
+
+public:
+ WebAssemblyDebugValueManager(MachineInstr *Instr);
+
+ void move(MachineInstr *Insert);
+ void updateReg(unsigned Reg);
+ void clone(MachineInstr *Insert, unsigned NewReg);
+};
+
+} // end namespace llvm
+
+#endif