Path: blob/main/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
35266 views
// WebAssemblyDebugValueManager.h - WebAssembly DebugValue Manager -*- C++ -*-//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file contains the declaration of the WebAssembly-specific10/// manager for DebugValues associated with the specific MachineInstr.11/// This pass currently does not handle DBG_VALUE_LISTs; they are assumed to12/// have been set to undef in NullifyDebugValueLists pass.13/// TODO Handle DBG_VALUE_LIST14///15//===----------------------------------------------------------------------===//1617#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H18#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYDEBUGVALUEMANAGER_H1920#include "llvm/ADT/SmallVector.h"21#include "llvm/CodeGen/Register.h"2223namespace llvm {2425class MachineInstr;2627class WebAssemblyDebugValueManager {28MachineInstr *Def;29SmallVector<MachineInstr *, 1> DbgValues;30Register CurrentReg;31SmallVector<MachineInstr *, 1>32getSinkableDebugValues(MachineInstr *Insert) const;33bool isInsertSamePlace(MachineInstr *Insert) const;3435public:36WebAssemblyDebugValueManager(MachineInstr *Def);3738// Sink 'Def', and also sink its eligible DBG_VALUEs to the place before39// 'Insert'. Convert the original DBG_VALUEs into undefs.40void sink(MachineInstr *Insert);41// Clone 'Def' (optionally), and also clone its eligible DBG_VALUEs to the42// place before 'Insert'.43void cloneSink(MachineInstr *Insert, Register NewReg = Register(),44bool CloneDef = true) const;45// Update the register for Def and DBG_VALUEs.46void updateReg(Register Reg);47// Replace the current register in DBG_VALUEs with the given LocalId target48// index.49void replaceWithLocal(unsigned LocalId);50// Remove Def, and set its DBG_VALUEs to undef.51void removeDef();52};5354} // end namespace llvm5556#endif575859