r200797 - Debug info: fix a crasher when when emitting debug info for

David Blaikie dblaikie at gmail.com
Tue Feb 4 15:53:16 PST 2014


On Tue, Feb 4, 2014 at 1:59 PM, Adrian Prantl <aprantl at apple.com> wrote:

>
> On Feb 4, 2014, at 13:48, David Blaikie <dblaikie at gmail.com> wrote:
>
> >
> >
> >
> > On Tue, Feb 4, 2014 at 1:29 PM, Adrian Prantl <aprantl at apple.com> wrote:
> > Author: adrian
> > Date: Tue Feb  4 15:29:50 2014
> > New Revision: 200797
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=200797&view=rev
> > Log:
> > Debug info: fix a crasher when when emitting debug info for
> > not-yet-completed templated types. getTypeSize() needs a complete type.
> >
> > I assume this test case could be simplified further - is that not the
> case? Could you explain the sequence of steps that lead to the incomplete
> type being used here and why the test case tests for a definition when the
> code causes more cases to be handled as declarations?
>
> It's a test for a crasher, so the CHECK line is somewhat arbitrary. But
> since the fix for the crash involves emitting a (temporary) forward
> declaration for a type, I decided to at least test that the fwd decl
> doesn't end up in the debug info.
>

Seems reasonable/not very arbitrary. I considered other ways to avoid the
temporary-ness, but nothing springs immediately to mind.


> > (things in the test case that seem overly complicated - two template
> parameters in Derived/Base, rather than one. A ctor (and out of line at
> that) in Foo, a recursive call in 'all', etc... )
> >
> > That said, I have encountered some fairly convoluted test cases - I'm
> not ruling it out, just want to better understand the potentially necessary
> complexity here.
> done in r200798.


 I've further simplified and annotated this a bit in r200805 (ensuring that
it still reproduces the problem). I think this is more legible/obvious and
explains the issue being addressed. Let me know what you think.

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140204/62f05477/attachment.html>


More information about the cfe-commits mailing list