LLVM  8.0.1
LiveDebugVariables.h
Go to the documentation of this file.
1 //===- LiveDebugVariables.h - Tracking debug info variables -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides the interface to the LiveDebugVariables analysis.
11 //
12 // The analysis removes DBG_VALUE instructions for virtual registers and tracks
13 // live user variables in a data structure that can be updated during register
14 // allocation.
15 //
16 // After register allocation new DBG_VALUE instructions are emitted to reflect
17 // the new locations of user variables.
18 //
19 //===----------------------------------------------------------------------===//
20 
21 #ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
22 #define LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
23 
25 #include "llvm/Support/Compiler.h"
26 
27 namespace llvm {
28 
29 template <typename T> class ArrayRef;
30 class LiveIntervals;
31 class VirtRegMap;
32 
34  void *pImpl = nullptr;
35 
36 public:
37  static char ID; // Pass identification, replacement for typeid
38 
40  ~LiveDebugVariables() override;
41 
42  /// splitRegister - Move any user variables in OldReg to the live ranges in
43  /// NewRegs where they are live. Mark the values as unavailable where no new
44  /// register is live.
45  void splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs,
46  LiveIntervals &LIS);
47 
48  /// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
49  /// that happened during register allocation.
50  /// @param VRM Rename virtual registers according to map.
51  void emitDebugValues(VirtRegMap *VRM);
52 
53  /// dump - Print data structures to dbgs().
54  void dump() const;
55 
56 private:
57  bool runOnMachineFunction(MachineFunction &) override;
58  void releaseMemory() override;
59  void getAnalysisUsage(AnalysisUsage &) const override;
60  bool doInitialization(Module &) override;
61 };
62 
63 } // end namespace llvm
64 
65 #endif // LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
Represent the analysis usage information of a pass.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
Definition: Compiler.h:108