Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
Context not available. | |||||
Streamer.EmitInt8(dwarf::DW_OP_deref, "DW_OP_deref"); | Streamer.EmitInt8(dwarf::DW_OP_deref, "DW_OP_deref"); | ||||
} | } | ||||
/// Emit a dwarf register operation for describing | void AsmPrinter::EmitDwarfOpPiece(ByteStreamer &Streamer, unsigned SizeInBits, | ||||
/// - a small value occupying only part of a register or | unsigned OffsetInBits) const { | ||||
/// - a small register representing only part of a value. | |||||
static void emitDwarfOpPiece(ByteStreamer &Streamer, unsigned SizeInBits, | |||||
unsigned OffsetInBits) { | |||||
assert(SizeInBits > 0 && "zero-sized piece"); | assert(SizeInBits > 0 && "zero-sized piece"); | ||||
unsigned SizeOfByte = 8; | unsigned SizeOfByte = 8; | ||||
if (OffsetInBits > 0 || SizeInBits % SizeOfByte) { | if (OffsetInBits > 0 || SizeInBits % SizeOfByte) { | ||||
echristo: Text here explaining the why of the assert. | |||||
Not Done ReplyInline ActionsOdd formatting plus some text, i.e. "DW_OP_piece wants byte sized offsets". echristo: Odd formatting plus some text, i.e. "DW_OP_piece wants byte sized offsets". | |||||
Not Done ReplyInline ActionsWe do this in so many places throughout llvm that it's, unfortunately, probably not a useful comment. echristo: We do this in so many places throughout llvm that it's, unfortunately, probably not a useful… | |||||
Context not available. | |||||
// If this is a valid register number, emit it. | // If this is a valid register number, emit it. | ||||
if (Reg >= 0) { | if (Reg >= 0) { | ||||
emitDwarfRegOp(Streamer, Reg); | emitDwarfRegOp(Streamer, Reg); | ||||
emitDwarfOpPiece(Streamer, PieceSizeInBits, PieceOffsetInBits); | EmitDwarfOpPiece(Streamer, PieceSizeInBits, PieceOffsetInBits); | ||||
Not Done ReplyInline ActionsThis seems to be the only function you've changed the capitalization on? echristo: This seems to be the only function you've changed the capitalization on? | |||||
Not Done ReplyInline ActionsYes, I promoted it from being a static function to a method and adopted what appears to be the spelling convention in AsmPrinter (although it's not terribly consistent). aprantl: Yes, I promoted it from being a static function to a method and adopted what appears to be the… | |||||
return; | return; | ||||
} | } | ||||
Context not available. | |||||
OutStreamer.AddComment("super-register"); | OutStreamer.AddComment("super-register"); | ||||
emitDwarfRegOp(Streamer, Reg); | emitDwarfRegOp(Streamer, Reg); | ||||
if (PieceOffsetInBits == Offset) { | if (PieceOffsetInBits == Offset) { | ||||
emitDwarfOpPiece(Streamer, Size, Offset); | EmitDwarfOpPiece(Streamer, Size, Offset); | ||||
} else { | } else { | ||||
// If this is part of a variable in a sub-register at a | // If this is part of a variable in a sub-register at a | ||||
// non-zero offset, we need to manually shift the value into | // non-zero offset, we need to manually shift the value into | ||||
// place, since the DW_OP_piece describes the part of the | // place, since the DW_OP_piece describes the part of the | ||||
// variable, not the position of the subregister. | // variable, not the position of the subregister. | ||||
emitDwarfOpPiece(Streamer, Size, PieceOffsetInBits); | EmitDwarfOpPiece(Streamer, Size, PieceOffsetInBits); | ||||
if (Offset) | if (Offset) | ||||
emitDwarfOpShr(Streamer, Offset); | emitDwarfOpShr(Streamer, Offset); | ||||
} | } | ||||
Context not available. | |||||
if (Reg >= 0 && Intersection.any()) { | if (Reg >= 0 && Intersection.any()) { | ||||
OutStreamer.AddComment("sub-register"); | OutStreamer.AddComment("sub-register"); | ||||
emitDwarfRegOp(Streamer, Reg); | emitDwarfRegOp(Streamer, Reg); | ||||
emitDwarfOpPiece(Streamer, Size, Offset == CurPos ? 0 : Offset); | EmitDwarfOpPiece(Streamer, Size, Offset == CurPos ? 0 : Offset); | ||||
CurPos = Offset + Size; | CurPos = Offset + Size; | ||||
// Mark it as emitted. | // Mark it as emitted. | ||||
Context not available. | |||||
Not Done ReplyInline ActionsEmitDwarfReg perhaps instead since we've got a 0 offset? echristo: EmitDwarfReg perhaps instead since we've got a 0 offset? | |||||
Not Done ReplyInline ActionsNo, we specifically want the sub/super-register magic here. I clarified the doxygen comment for EmitDwarfRegOpPiece() in 207372 to make this more obvious. aprantl: No, we specifically want the sub/super-register magic here. I clarified the doxygen comment for… |
Text here explaining the why of the assert.