This is an archive of the discontinued LLVM Phabricator instance.

[AST][JSON] Generate parent context id from Decl* instead of DeclContext*
ClosedPublic

Authored by piscisaureus on Sep 1 2019, 6:14 PM.

Details

Summary

Because of multiple inheritance, a DeclContext pointer does not produce
the same pointer representation as a Decl pointer that references the
same AST Node.

When dumping the parentDeclContextId field of a node, convert the pointer
to Decl* first, so the id can be used to find the AST node it references.

Diff Detail

Event Timeline

piscisaureus created this revision.Sep 1 2019, 6:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2019, 6:14 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Sep 4 2019, 6:11 AM

LGTM aside from a small nit. Thank you for this!

clang/lib/AST/JSONNodeDumper.cpp
118

const auto *

This revision is now accepted and ready to land.Sep 4 2019, 6:11 AM
piscisaureus marked an inline comment as done.Sep 4 2019, 12:49 PM

Fixed nit, this is ready to land IMO.

aaron.ballman closed this revision.Sep 4 2019, 1:28 PM

Fixed nit, this is ready to land IMO.

Thanks! I've commit on your behalf in r370970.