This is an archive of the discontinued LLVM Phabricator instance.

DebugInfo: hoist definition into global context when needed
ClosedPublic

Authored by compnerd on Feb 24 2015, 3:12 PM.

Details

Summary

When generating debug info for a static inline member which is initialized for
the DLLExport storage class, hoist the definition into a non-composite type
context. Otherwise, we would trigger an assertion when generating the DIE for
the associated global value as the debug context has a type association. This
addresses PR22669.

Thanks to David Blakie for help in coming up with a solution to this!

Diff Detail

Event Timeline

abdulras updated this revision to Diff 20631.Feb 24 2015, 3:12 PM
abdulras retitled this revision from to DebugInfo: hoist definition into global context when needed.
abdulras updated this object.
abdulras edited the test plan for this revision. (Show Details)
abdulras added a reviewer: dblaikie.
abdulras set the repository for this revision to rL LLVM.
abdulras added subscribers: compnerd, Unknown Object (MLST).
majnemer added inline comments.
lib/CodeGen/CGDebugInfo.cpp
2381–2382

Shouldn't this be morally equivalent to DC->getEnclosingNamespaceContext()?

friss added a subscriber: friss.Feb 24 2015, 3:37 PM
friss added inline comments.
lib/CodeGen/CGDebugInfo.cpp
2379–2382

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?

abdulras added inline comments.Feb 24 2015, 4:59 PM
lib/CodeGen/CGDebugInfo.cpp
2379–2382

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.

abdulras updated this revision to Diff 20681.Feb 25 2015, 8:33 AM
abdulras removed rL LLVM as the repository for this revision.
compnerd commandeered this revision.Feb 27 2015, 12:23 PM
compnerd updated this revision to Diff 20881.
compnerd added a reviewer: abdulras.

Address comments from David Blakie.

dblaikie edited edge metadata.Feb 27 2015, 1:15 PM

Looks great, please commit.

Thanks!

  • David
compnerd accepted this revision.Feb 27 2015, 4:37 PM
compnerd added a reviewer: compnerd.

(accepting to close)

This revision is now accepted and ready to land.Feb 27 2015, 4:37 PM
compnerd closed this revision.Feb 27 2015, 4:38 PM

Committed in SVN r230816.