[PATCH] D45463: [AST] Print correct tag decl for tag specifier

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 10 09:26:34 PDT 2018


jdenny updated this revision to Diff 146145.
jdenny edited the summary of this revision.
jdenny added a comment.

I've implemented the suggestion to use ElaboratedType.  See the last paragraph of the revised summary for details.

There might be trouble for CXPrintingPolicyProperty users.  That is, this patch shifts the semantics of IncludeTagDefinition away from the documented semantics and from what the name implies.  Then again, both were already misleading for a tag type without a member list (that is, definition).

I see a few possible paths:

1. Update the documentation for IncludeTagDefinition and assume the new behavior was the expected behavior all along.

2. #1 and rename IncludeTagDefinition to something like OwnedTagDeclaration.

3. Add OwnedTagDeclaration alongside IncludeTagDefinition.  CXPrintingPolicyProperty users could set either.  We'd have to decide which would have precedence.  Internally, we would change Decl::printGroup to set OwnedTagDeclaration instead of IncludeTagDefinition, which otherwise would not be used internally.


https://reviews.llvm.org/D45463

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/Type.h
  include/clang/Sema/Sema.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTImporter.cpp
  lib/AST/TypePrinter.cpp
  lib/Sema/SemaType.cpp
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTWriter.cpp
  test/Misc/ast-print-enum-decl.c
  test/Misc/ast-print-record-decl.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45463.146145.patch
Type: text/x-patch
Size: 22063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180510/d46a40ce/attachment-0001.bin>


More information about the cfe-commits mailing list