1 //===- LiveDebugVariables.h - Tracking debug info variables ----*- c++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides the interface to the LiveDebugVariables analysis.
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
16 // After register allocation new DBG_VALUE instructions are emitted to reflect
17 // the new locations of user variables.
19 //===----------------------------------------------------------------------===//
21 #ifndef LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
22 #define LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
24 #include "llvm/CodeGen/MachineFunctionPass.h"
28 class LiveDebugVariables : public MachineFunctionPass {
31 static char ID; // Pass identification, replacement for typeid
34 ~LiveDebugVariables();
36 /// renameRegister - Move any user variables in OldReg to NewReg:SubIdx.
37 /// @param OldReg Old virtual register that is going away.
38 /// @param NewReg New register holding the user variables.
39 /// @param SubIdx If NewReg is a virtual register, SubIdx may indicate a sub-
41 void renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx);
43 /// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
44 /// that happened during register allocation.
45 void emitDebugValues();
49 virtual bool runOnMachineFunction(MachineFunction &);
50 virtual void releaseMemory();
51 virtual void getAnalysisUsage(AnalysisUsage &) const;
57 #endif // LLVM_CODEGEN_LIVEDEBUGVARIABLES_H