]> granicus.if.org Git - clang/commit
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)
commit9ff46a3fe18a95a18b540a5f448bf6f8ad1e7912
tree7258fb4396c0c62fff2885ee898358b808efd885
parent11911b2d6ccf63ef73966cda90c68bf0de78358c
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370970 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/JSONNodeDumper.cpp
test/AST/ast-dump-decl-context-json.cpp [new file with mode: 0644]
test/AST/ast-dump-decl-json.c
test/AST/ast-dump-funcs-json.cpp
test/AST/ast-dump-template-decls-json.cpp