belonging to a single DBG_VALUE instruction.
NFC
llvm-svn: 261167
const MachineLocation &Location) {
DIELoc *Loc = new (DIEValueAllocator) DIELoc;
DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
- assert(DV.getExpression().size() == 1);
- const DIExpression *Expr = DV.getExpression().back();
+ const DIExpression *Expr = DV.getSingleExpression();
bool ValidReg;
if (Location.getOffset()) {
ValidReg = DwarfExpr.AddMachineRegIndirect(Location.getReg(),
const DILocalVariable *getVariable() const { return Var; }
const DILocation *getInlinedAt() const { return IA; }
ArrayRef<const DIExpression *> getExpression() const { return Expr; }
+ const DIExpression *getSingleExpression() const {
+ assert(MInsn && Expr.size() <= 1);
+ return Expr.size() ? Expr[0] : nullptr;
+ }
void setDIE(DIE &D) { TheDIE = &D; }
DIE *getDIE() const { return TheDIE; }
void setDebugLocListIndex(unsigned O) { DebugLocListIndex = O; }