<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 24, 2017 at 9:00 AM Jon Eyolfson <<a href="mailto:jon@eyl.io">jon@eyl.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Great, thanks a lot for the reply! That seems to do the trick for now. It's a<br class="gmail_msg">
shame about -gfull though, is there just really no use for it?<br class="gmail_msg"></blockquote><div><br></div><div>Not so far - debug info's pretty big as it is (even without -fstandalone-debug, let alone what it might be with -gfull). I don't think there'd necessarily be a problem with adding the option for users who really want it - I don't think such a change would be terribly intrusive, but I'm not sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm using this information to create a class heirarchy for an LLVM static<br class="gmail_msg">
analysis. I need to use LLVM for the static analysis part but it seems like all<br class="gmail_msg">
of the class heirarchy information from clang is stripped away by then. So I'm<br class="gmail_msg">
using debugging information to re-create the class heirarchy.<br class="gmail_msg"></blockquote><div><br></div><div>Fair enough - I know people have talked about doing analysis at the IR level - but not sure how much success has been had there, owing to the sort of things you're running into in terms of loss of source fidelity/details.<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
Thanks!<br class="gmail_msg">
<br class="gmail_msg">
On Fri, Feb 24, 2017 at 04:15:19PM +0000, David Blaikie wrote:<br class="gmail_msg">
> Note that the TwoVirtual, NoSubOrSuper, and OneSuper types are all emitted<br class="gmail_msg">
> as declarations - so no inheritance information is provided in that case<br class="gmail_msg">
> (nor any member variables/functions, byte size, etc). This is a debug<br class="gmail_msg">
> information size optimization (GCC does a similar one) based on the<br class="gmail_msg">
> assumption that the whole program will be built with debug info, and in<br class="gmail_msg">
> that case some other file (the file with the 'key function' for each type)<br class="gmail_msg">
> so it doesn't need to be duplicated here.<br class="gmail_msg">
><br class="gmail_msg">
> If you want to disable that optimization, you can pass -fstandalone-debug<br class="gmail_msg">
> (this tells the compiler not to assume that any other part of the program<br class="gmail_msg">
> is built with debug info) - but it increases the size of the debug info<br class="gmail_msg">
> quite a bit.<br class="gmail_msg">
><br class="gmail_msg">
> (note that -femit-all-decls doesn't apply to debug info (ie: an unused type<br class="gmail_msg">
> will still not be emitted into the metadata/DWARF) GCC's -gfull would be<br class="gmail_msg">
> the right tool for this but it's not implemented in LLVM/Clang)<br class="gmail_msg">
><br class="gmail_msg">
> What are you trying to do with this information?<br class="gmail_msg">
><br class="gmail_msg">
> On Thu, Feb 23, 2017 at 3:52 PM Jon Eyolfson via cfe-dev <<br class="gmail_msg">
> <a href="mailto:cfe-dev@lists.llvm.org" class="gmail_msg" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> > Hello, I'm trying to understand why I'm not getting all the inheritance<br class="gmail_msg">
> > information for the following example:<br class="gmail_msg">
> ><br class="gmail_msg">
> >     class TwoVirtual {<br class="gmail_msg">
> >     public:<br class="gmail_msg">
> >       virtual void foo();<br class="gmail_msg">
> >       virtual void bar() const;<br class="gmail_msg">
> >     };<br class="gmail_msg">
> ><br class="gmail_msg">
> >     class TwoImpl : public TwoVirtual {<br class="gmail_msg">
> >       TwoImpl() {}<br class="gmail_msg">
> >     public:<br class="gmail_msg">
> >       virtual void foo() {}<br class="gmail_msg">
> >       virtual void bar() const {}<br class="gmail_msg">
> >     };<br class="gmail_msg">
> ><br class="gmail_msg">
> >     class NoSubOrSuper {<br class="gmail_msg">
> >       TwoImpl t;<br class="gmail_msg">
> >       void baz() {}<br class="gmail_msg">
> >     };<br class="gmail_msg">
> ><br class="gmail_msg">
> >     class OneSuper : public TwoImpl {<br class="gmail_msg">
> >       void baz() {}<br class="gmail_msg">
> >     };<br class="gmail_msg">
> ><br class="gmail_msg">
> > I'm generating llvm code with the following command:<br class="gmail_msg">
> ><br class="gmail_msg">
> >     clang++ -std=c++14 -g -O1 -Xclang -disable-llvm-optzns -emit-llvm<br class="gmail_msg">
> >             -femit-all-decls -S -c TestFile.cpp -o TestFile.ll<br class="gmail_msg">
> ><br class="gmail_msg">
> > I'm using -O1 because I need TBAA information present.<br class="gmail_msg">
> ><br class="gmail_msg">
> > What I get is only one DIDerivedType with the DW_TAG_inheritance tag.<br class="gmail_msg">
> > This connects TwoImpl to TwoVirtual. However there isnt an inheritance<br class="gmail_msg">
> > tag between OneSuper and TwoImpl. Is there a reason for this? I'm trying<br class="gmail_msg">
> > to determine in the llvm code that NoSubOrSuper and OneSuper are different<br class="gmail_msg">
> > (on has an inheritance relation and the other doesn't). Thanks!<br class="gmail_msg">
> > _______________________________________________<br class="gmail_msg">
> > cfe-dev mailing list<br class="gmail_msg">
> > <a href="mailto:cfe-dev@lists.llvm.org" class="gmail_msg" target="_blank">cfe-dev@lists.llvm.org</a><br class="gmail_msg">
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="gmail_msg">
> ><br class="gmail_msg">
</blockquote></div></div>