1 //===- LiveDebugVariables.cpp - Tracking debug info variables -------------===// 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 implements the LiveDebugVariables analysis. 11 // 12 // Remove all DBG_VALUE instructions referencing virtual registers and replace 13 // them with a data structure tracking where live user variables are kept - in a 14 // virtual register or in a stack slot. 15 // 16 // Allow the data structure to be updated during register allocation when values 17 // are moved between registers and stack slots. Finally emit new DBG_VALUE 18 // instructions after register allocation is complete. 19 // 20 //===----------------------------------------------------------------------===// 21 22 #include "LiveDebugVariables.h" 23 #include "llvm/CodeGen/LiveIntervalAnalysis.h" 24 #include "llvm/CodeGen/MachineFunction.h" 25 #include "llvm/CodeGen/Passes.h" 26 #include "llvm/Target/TargetMachine.h" 27 28 using namespace llvm; 29 30 char LiveDebugVariables::ID = 0; 31 32 INITIALIZE_PASS_BEGIN(LiveDebugVariables, "livedebugvars", 33 "Debug Variable Analysis", false, false) 34 INITIALIZE_PASS_DEPENDENCY(LiveIntervals) 35 INITIALIZE_PASS_END(LiveDebugVariables, "livedebugvars", 36 "Debug Variable Analysis", false, false) 37 38 void LiveDebugVariables::getAnalysisUsage(AnalysisUsage &AU) const { 39 AU.addRequiredTransitive<LiveIntervals>(); 40 AU.setPreservesAll(); 41 MachineFunctionPass::getAnalysisUsage(AU); 42 } 43 44 LiveDebugVariables::LiveDebugVariables() : MachineFunctionPass(ID) { 45 initializeLiveDebugVariablesPass(*PassRegistry::getPassRegistry()); 46 } 47 48 bool LiveDebugVariables::runOnMachineFunction(MachineFunction &mf) { 49 return false; 50 } 51