Remove support for DIVariable's FlagIndirectVariable and expect

frontends to use a DIExpression with a DW_OP_deref instead.

This is not only a much more natural place for this informationl; there
is also a technical reason: The FlagIndirectVariable is used to mark a
variable that is turned into a reference by virtue of the calling
convention; this happens for example to aggregate return values.
The inliner, for example, may actually need to undo this indirection to
correctly represent the value in its new context. This is impossible to
implement because the DIVariable can't be safely modified. We can however
safely construct a new DIExpression on the fly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-01-19 17:57:29 +00:00
parent 4b96323e81
commit e240cc0b4b
18 changed files with 45 additions and 69 deletions

View File

@ -1683,14 +1683,12 @@ void DwarfDebug::emitLocPieces(ByteStreamer &Streamer,
#ifndef NDEBUG
DIVariable Var = Piece.getVariable();
assert(!Var.isIndirect() && "indirect address for piece");
unsigned VarSize = Var.getSizeInBits(Map);
assert(PieceSize+PieceOffset <= VarSize/SizeOfByte
&& "piece is larger than or outside of variable");
assert(PieceSize*SizeOfByte != VarSize
&& "piece covers entire variable");
#endif
emitDebugLocValue(Streamer, Piece, PieceOffset*SizeOfByte);
}
}
@ -1726,7 +1724,7 @@ void DwarfDebug::emitDebugLocValue(ByteStreamer &Streamer,
DIExpression Expr = Value.getExpression();
if (!Expr || (Expr.getNumElements() == 0))
// Regular entry.
Asm->EmitDwarfRegOp(Streamer, Loc, DV.isIndirect());
Asm->EmitDwarfRegOp(Streamer, Loc);
else {
// Complex address entry.
if (Loc.getOffset()) {
@ -1735,8 +1733,6 @@ void DwarfDebug::emitDebugLocValue(ByteStreamer &Streamer,
} else
DwarfExpr.AddMachineRegExpression(Expr, Loc.getReg(),
PieceOffsetInBits);
if (DV.isIndirect())
DwarfExpr.EmitOp(dwarf::DW_OP_deref);
}
}
// else ... ignore constant fp. There is not any good way to