Generate parent context id from Decl* instead of DeclContext*.
authorAaron Ballman <aaron@aaronballman.com>
Wed, 4 Sep 2019 20:30:00 +0000 (20:30 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 4 Sep 2019 20:30:00 +0000 (20:30 +0000)
commit40e3760472eae18919f4be8906869701db8f8f03
treeb1baa20526f6e91d6cd1221f969f2a2ceb37df6c
parent41adc374086d69082a1cef48ebea771833564afa
Generate parent context id from Decl* instead of DeclContext*.

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.

Patch by Bert Belder.

llvm-svn: 370970
clang/lib/AST/JSONNodeDumper.cpp
clang/test/AST/ast-dump-decl-context-json.cpp [new file with mode: 0644]
clang/test/AST/ast-dump-decl-json.c
clang/test/AST/ast-dump-funcs-json.cpp
clang/test/AST/ast-dump-template-decls-json.cpp