Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
Context not available. | |||||
#include "llvm/ADT/SmallVector.h" | #include "llvm/ADT/SmallVector.h" | ||||
#include "llvm/CodeGen/MachineBasicBlock.h" | #include "llvm/CodeGen/MachineBasicBlock.h" | ||||
#include "llvm/CodeGen/MachineFunction.h" | #include "llvm/CodeGen/MachineFunction.h" | ||||
#include "llvm/IR/DebugInfo.h" | |||||
#include "llvm/Support/Debug.h" | #include "llvm/Support/Debug.h" | ||||
#include "llvm/Target/TargetRegisterInfo.h" | #include "llvm/Target/TargetRegisterInfo.h" | ||||
#include <algorithm> | #include <algorithm> | ||||
Context not available. | |||||
const MachineInstr &MI) { | const MachineInstr &MI) { | ||||
// Instruction range should start with a DBG_VALUE instruction for the | // Instruction range should start with a DBG_VALUE instruction for the | ||||
// variable. | // variable. | ||||
assert(MI.isDebugValue() && MI.getDebugVariable() == Var); | assert(MI.isDebugValue() && getEntireVariable(MI.getDebugVariable()) == Var); | ||||
auto &Ranges = VarInstrRanges[Var]; | auto &Ranges = VarInstrRanges[Var]; | ||||
if (!Ranges.empty() && Ranges.back().second == nullptr && | if (!Ranges.empty() && Ranges.back().second == nullptr && | ||||
Ranges.back().first->isIdenticalTo(&MI)) { | Ranges.back().first->isIdenticalTo(&MI)) { | ||||
Context not available. | |||||
} | } | ||||
assert(MI.getNumOperands() > 1 && "Invalid DBG_VALUE instruction!"); | assert(MI.getNumOperands() > 1 && "Invalid DBG_VALUE instruction!"); | ||||
const MDNode *Var = MI.getDebugVariable(); | // Use the base variable (without any DW_OP_piece expressions) | ||||
// as index into History. The full variables including the | |||||
// piece expressions are attached to the MI. | |||||
DIVariable Var = getEntireVariable(MI.getDebugVariable()); | |||||
if (unsigned PrevReg = Result.getRegisterForVar(Var)) | if (unsigned PrevReg = Result.getRegisterForVar(Var)) | ||||
dropRegDescribedVar(RegVars, PrevReg, Var); | dropRegDescribedVar(RegVars, PrevReg, Var); | ||||
Context not available. |