LLVM 19.0.0git
LiveDebugVariables.h
Go to the documentation of this file.
1//===- LiveDebugVariables.h - Tracking debug info variables -----*- 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// This file provides the interface to the LiveDebugVariables analysis.
10//
11// The analysis removes DBG_VALUE instructions for virtual registers and tracks
12// live user variables in a data structure that can be updated during register
13// allocation.
14//
15// After register allocation new DBG_VALUE instructions are emitted to reflect
16// the new locations of user variables.
17//
18//===----------------------------------------------------------------------===//
19
20#ifndef LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
21#define LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
22
25
26namespace llvm {
27
28template <typename T> class ArrayRef;
29class LiveIntervals;
30class VirtRegMap;
31
33 void *pImpl = nullptr;
34
35public:
36 static char ID; // Pass identification, replacement for typeid
37
39 ~LiveDebugVariables() override;
40
41 /// splitRegister - Move any user variables in OldReg to the live ranges in
42 /// NewRegs where they are live. Mark the values as unavailable where no new
43 /// register is live.
44 void splitRegister(Register OldReg, ArrayRef<Register> NewRegs,
45 LiveIntervals &LIS);
46
47 /// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
48 /// that happened during register allocation.
49 /// @param VRM Rename virtual registers according to map.
50 void emitDebugValues(VirtRegMap *VRM);
51
52 /// dump - Print data structures to dbgs().
53 void dump() const;
54
55private:
56 bool runOnMachineFunction(MachineFunction &) override;
57 void releaseMemory() override;
58 void getAnalysisUsage(AnalysisUsage &) const override;
59
60 MachineFunctionProperties getSetProperties() const override {
63 }
64};
65
66} // end namespace llvm
67
68#endif // LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
Represent the analysis usage information of a pass.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
void dump() const
dump - Print data structures to dbgs().
void splitRegister(Register OldReg, ArrayRef< Register > NewRegs, LiveIntervals &LIS)
splitRegister - Move any user variables in OldReg to the live ranges in NewRegs where they are live.
void emitDebugValues(VirtRegMap *VRM)
emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes that happened during registe...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & set(Property P)
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ArrayRef(const T &OneElt) -> ArrayRef< T >