<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 20, 2015 at 1:09 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-Mar-20, at 12:55, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Fri, Mar 20, 2015 at 12:13 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br>
> Author: dexonsmith<br>
> Date: Fri Mar 20 14:13:53 2015<br>
> New Revision: 232833<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232833&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232833&view=rev</a><br>
> Log:<br>
> DebugInfoFinder: Check for null imported entities<br>
><br>
> When do we have null imported entities? Can we just disallow them?<br>
<br>
</span>Probably, soon.<br>
<span class=""><br>
><br>
> There used to be a lot of conditionals for null DI* across the debug info handling and in many cases it hid bugs - I've removed any & would like it if we could continue pushing in that direction, rather than going back to the way things were.<br>
><br>
<br>
</span>Hmm, I don't remember which testcase(s) failed.  I'll dig it up; maybe<br>
I can just fix the testcase instead.<br>
<br>
My plan is to add assertions like like this to the Verifier, at which<br>
point it'll be a lot easier to avoid conditionals like this.  Right now<br>
the structure of the debug info part makes that tough though (see<br>
why and a rough plan in r232790).  Once I've fixed the structure, I'll<br>
remove the conditionals from `DebugInfoFinder` (and elsewhere), since we<br>
won't be relying on it for verifying the IR.<br></blockquote><div><br>Sure thing - so long as there's a plan underway for this sort of thing to go away rather than proliferate :)<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
><br>
> Don't use the accessors in `DIImportedEntity` on a null pointer.  (A WIP<br>
> patch to make `DIDescriptor` accessors more strict crashes here<br>
> otherwise.)<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/IR/DebugInfo.cpp<br>
><br>
> Modified: llvm/trunk/lib/IR/DebugInfo.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=232833&r1=232832&r2=232833&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=232833&r1=232832&r2=232833&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/IR/DebugInfo.cpp (original)<br>
> +++ llvm/trunk/lib/IR/DebugInfo.cpp Fri Mar 20 14:13:53 2015<br>
> @@ -674,6 +674,8 @@ void DebugInfoFinder::processModule(cons<br>
>        DIArray Imports = CU.getImportedEntities();<br>
>        for (unsigned i = 0, e = Imports.getNumElements(); i != e; ++i) {<br>
>          DIImportedEntity Import = DIImportedEntity(Imports.getElement(i));<br>
> +        if (!Import)<br>
> +          continue;<br>
>          DIDescriptor Entity = Import.getEntity().resolve(TypeIdentifierMap);<br>
>          if (Entity.isType())<br>
>            processType(DIType(Entity));<br>
><br>
><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>
><br>
<br>
</div></div></blockquote></div><br></div></div>