<div dir="ltr">Noticed one copy-pasto:<div><div>/// getPieceOffset - Return the offset of this piece in bytes.</div><div>  uint64_t getPieceOffset() const;</div><div>  /// getPieceOffset - Return the offset of this piece in bytes.</div>
<div>  uint64_t getPieceSize() const;</div></div><div><br></div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 3:41 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Hi David,<br>
<br>
  Here’s the MDNodes for the two variable pieces:<br>
    !20 = metadata !{i32 786689, metadata !4, metadata !"s", metadata !5, i32 16777219, metadata !9, i32 0, i32 0, i32 3, i32 0, i32 8} ; [ DW_TAG_arg_variable ] [s] [line 3]<br>
    !21 = metadata !{i32 786689, metadata !4, metadata !"s", metadata !5, i32 16777219, metadata !9, i32 0, i32 0, i32 3, i32 8, i32 4} ; [ DW_TAG_arg_variable ] [s] [line 3]<br>
<br>
  All the way through ISel and the MC layer those two MDNodes behave like regular DIVariables with complex addresses. In DwarfDebug, we need to treat the pieces as one entity when calculating the Ranges/History. getEntireVariable() simply chops off the last two elements so it can be used as a shared  index into DbgVariables while still indicating that this is a fragmented location. The extra code in the range calculation makes sure that a piece of a variable is not clobbered by a non-overlapping piece.<br>

<br>
  FYI: In a previous design I experimented with introducing a new type MDnode<br>
    !Piece = metadata !{i32 PIECE, metadata !<ref to DIVariable>, metadata !<Offset>, metadata !<Size>}<br>
  but this meant adding an extra case to all the ISel/MC code handling DBG_VALUEs, which is why I ended up with the current design.<br>
<span class="HOEnZb"><font color="#888888"><br>
  —  adrian<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<a href="http://llvm-reviews.chandlerc.com/D2680" target="_blank">http://llvm-reviews.chandlerc.com/D2680</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>