[PATCH] DebugInfo: hoist definition into global context when needed
David Blaikie
dblaikie at gmail.com
Tue Feb 24 17:12:17 PST 2015
On Tue, Feb 24, 2015 at 4:59 PM, Saleem Abdulrasool <abdulras at fb.com> wrote:
> REPOSITORY
> rL LLVM
>
> ================
> Comment at: lib/CodeGen/CGDebugInfo.cpp:2379-2382
> @@ -2378,4 +2378,6 @@
> // we have support for emitting declarations of (non-member) global
> variables.
> - VDContext = getContextDescriptor(
> - dyn_cast<Decl>(VD->isStaticDataMember() ?
> VD->getLexicalDeclContext()
> - : VD->getDeclContext()));
> + const DeclContext *DC = VD->isStaticDataMember() ?
> VD->getLexicalDeclContext()
> + : VD->getDeclContext();
> + while (DC->isRecord())
> + DC = DC->getParent();
> + VDContext = getContextDescriptor(dyn_cast<Decl>(DC));
> ----------------
> friss wrote:
> > The message makes it look like this change addresses a very particular
> case related to dllexport, yet the logic makes no mention of it. Care to
> elaborate why this doesn't change anything is other cases?
> The dllexport simply makes it easier to expose the issue as the member
> will be forcefully instantiated, and thus force the materialization of the
> debug info.
>
You reckon this behavior could be tickled without dllexport? I think in any
other case you'd need an explicit external definition - only in dllexport
have I seen a definition manifested without one written outside the class.
>
> http://reviews.llvm.org/D7872
>
> EMAIL PREFERENCES
> http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150224/f7b8044b/attachment.html>
More information about the cfe-commits
mailing list