mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the
intermediate representation. This - increases consistency by using the same granularity everywhere - allows for pieces < 1 byte - DW_OP_piece didn't actually allow storing an offset. Part of PR22495. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4175,15 +4175,15 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) {
|
||||
// Create a piece expression describing the new partition or reuse AI's
|
||||
// expression if there is only one partition.
|
||||
DIExpression PieceExpr = Expr;
|
||||
if (IsSplit || Expr.isVariablePiece()) {
|
||||
if (IsSplit || Expr.isBitPiece()) {
|
||||
// If this alloca is already a scalar replacement of a larger aggregate,
|
||||
// Piece.Offset describes the offset inside the scalar.
|
||||
unsigned Offset = Expr.isVariablePiece() ? Expr.getPieceOffset() : 0;
|
||||
unsigned Offset = Expr.isBitPiece() ? Expr.getBitPieceOffset() : 0;
|
||||
assert((Offset == 0 ||
|
||||
Offset+Piece.Offset+Piece.Size <=
|
||||
Expr.getPieceOffset()+Expr.getPieceSize()) &&
|
||||
Offset+Piece.Offset+Piece.Size*8 <=
|
||||
Expr.getBitPieceOffset()+Expr.getBitPieceSize()) &&
|
||||
"inner piece is not inside original alloca");
|
||||
PieceExpr = DIB.createPieceExpression(Offset+Piece.Offset, Piece.Size);
|
||||
PieceExpr = DIB.createBitPieceExpression(Offset+Piece.Offset*8, Piece.Size*8);
|
||||
}
|
||||
|
||||
// Remove any existing dbg.declare intrinsic describing the same alloca.
|
||||
|
||||
Reference in New Issue
Block a user