Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / WebAssembly / WebAssemblyDebugValueManager.h
blob9ef3da7589477abfb7ff1bba4a4cf5ef0ae729a2
1 // WebAssemblyDebugValueManager.h - WebAssembly DebugValue Manager -*- C++ -*-//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file contains the declaration of the WebAssembly-specific
11 /// manager for DebugValues associated with the specific MachineInstr.
12 /// This pass currently does not handle DBG_VALUE_LISTs; they are assumed to
13 /// have been set to undef in NullifyDebugValueLists pass.
14 /// TODO Handle DBG_VALUE_LIST
15 ///
16 //===----------------------------------------------------------------------===//
18 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H
19 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H
21 #include "llvm/ADT/SmallVector.h"
22 #include "llvm/CodeGen/Register.h"
24 namespace llvm {
26 class MachineInstr;
28 class WebAssemblyDebugValueManager {
29 MachineInstr *Def;
30 SmallVector<MachineInstr *, 1> DbgValues;
31 Register CurrentReg;
32 SmallVector<MachineInstr *, 1>
33 getSinkableDebugValues(MachineInstr *Insert) const;
34 bool isInsertSamePlace(MachineInstr *Insert) const;
36 public:
37 WebAssemblyDebugValueManager(MachineInstr *Def);
39 // Sink 'Def', and also sink its eligible DBG_VALUEs to the place before
40 // 'Insert'. Convert the original DBG_VALUEs into undefs.
41 void sink(MachineInstr *Insert);
42 // Clone 'Def' (optionally), and also clone its eligible DBG_VALUEs to the
43 // place before 'Insert'.
44 void cloneSink(MachineInstr *Insert, Register NewReg = Register(),
45 bool CloneDef = true) const;
46 // Update the register for Def and DBG_VALUEs.
47 void updateReg(Register Reg);
48 // Replace the current register in DBG_VALUEs with the given LocalId target
49 // index.
50 void replaceWithLocal(unsigned LocalId);
51 // Remove Def, and set its DBG_VALUEs to undef.
52 void removeDef();
55 } // end namespace llvm
57 #endif