<div dir="ltr">Yeah, I'm punting on the language lawyering to Richard, hopefully... <br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 9:25 AM, Frédéric Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">ping?<div><br><div><blockquote type="cite"><div><div class="h5"><div>On Jan 27, 2015, at 6:43 PM, Frédéric Riss <<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite"><div><br>On Jan 27, 2015, at 4:11 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><br><br style="font-family:Menlo-Regular;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Menlo-Regular;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Tue, Jan 27, 2015 at 2:08 PM, Frederic Riss<span> </span><span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This update removes the limitation to a fixed maximum number of<br>attributes per DIE. The patch is very similar to the first one that<br>I sent for discussion. It only adds a pointer to a vector of DIEs<br>as arguement to DIE::addValue(). If a DIE overflows its inline storage<br>for attributes, it is added to the vector. The vector is then iterated<br>just before the BumpPtrAllocator is destroyed to call the destructors<br>of all these DIEs.<br><br>This approach gives the most flexibilty as it doesn't impose the<br>memory management upon the user (for example DIEHashTest.cpp continues<br>to use stack allocated DIEs and it works fine).<br><br>I've been playing with this for the last few days, and I have quite<br>a few different implementations lying around (for example using<br>std::vectors with a custom stateful allocator). They are all more<br>complicated and don't perform as well as this patch.<br><br>There's one point that I'd like to mention: the patch unifies the<br>existing bookkeeping of the DIEBlock and DIELoc objects and treats<br>them the same as standard DIEs. This means that we will call ~DIE<br>on DIEBlock and DIELoc objects which will result in a 'partial'<br>destruction (DIEBlock inherits both from DIEValue and from DIE).<br>I think this is fine. It should do exactly what we want and just<br>call the destructors of the SmallVectors in the DIE part of the<br>object, but I wanted to mention it in case someone thinks its not<br>legal to do that.<br></blockquote><div><br>Pretty sure that's not valid C++ (not sure quite which cracks the bump allocator objects fall in general in terms of not running dtors, reusing memory, etc - and whether this would be worse than that or not, though).<br></div></div></div></blockquote><div><br></div><div>What exactly do you think the issue would be from a language standpoint? Calling a destructor on a ‘partial’ object? I would expect that it is ok to do so. AFAIK, explicit destructor calls follow the same rules as other function calls. I have a pointer to a DIE object, thus I can call the destructor on it. The object stops to ‘exist’ at that point, and thus its enclosing object is in an undefined state, but this doesn’t really matter as it won’t be touched anymore.</div><div><br></div><div>I’m very bad at language lawyering though, thus I’d really appreciate a authoritative answer :-)</div><div><br></div><div>Fred </div><div><br></div><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Menlo-Regular;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><br><br><a href="http://reviews.llvm.org/D7072" target="_blank">http://reviews.llvm.org/D7072</a><br><br>Files:<br> <span> </span>include/llvm/CodeGen/DIE.h<br> <span> </span>lib/CodeGen/AsmPrinter/DIE.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DIEHash.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfFile.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br> <span> </span>lib/CodeGen/AsmPrinter/DwarfUnit.h<br> <span> </span>unittests/CodeGen/DIEHashTest.cpp<br><br>EMAIL PREFERENCES<br> <span> </span><a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a></div></div></blockquote></div></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></div><span class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">llvm-commits mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:llvm-commits@cs.uiuc.edu" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-commits@cs.uiuc.edu</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></span></div></blockquote></div><br></div></div></blockquote></div><br></div></div>