LLVM  4.0.0
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/IR/DebugInfo.h"
26 
27 namespace llvm {
28 
29 template <typename T> class ArrayRef;
30 class LiveInterval;
31 class LiveIntervals;
32 class VirtRegMap;
33 
35  void *pImpl;
36 
37 public:
38  static char ID; // Pass identification, replacement for typeid
39 
41  ~LiveDebugVariables() override;
42 
43  /// renameRegister - Move any user variables in OldReg to NewReg:SubIdx.
44  /// @param OldReg Old virtual register that is going away.
45  /// @param NewReg New register holding the user variables.
46  /// @param SubIdx If NewReg is a virtual register, SubIdx may indicate a sub-
47  /// register.
48  void renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx);
49 
50  /// splitRegister - Move any user variables in OldReg to the live ranges in
51  /// NewRegs where they are live. Mark the values as unavailable where no new
52  /// register is live.
53  void splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs,
54  LiveIntervals &LIS);
55 
56  /// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
57  /// that happened during register allocation.
58  /// @param VRM Rename virtual registers according to map.
59  void emitDebugValues(VirtRegMap *VRM);
60 
61  /// dump - Print data structures to dbgs().
62  void dump();
63 
64 private:
65 
66  bool runOnMachineFunction(MachineFunction &) override;
67  void releaseMemory() override;
68  void getAnalysisUsage(AnalysisUsage &) const override;
69  bool doInitialization(Module &) override;
70 
71 };
72 
73 } // namespace llvm
74 
75 #endif
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:52
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:105