llvm-project/clang/lib/AST
Steven Watanabe 9359b8fe5d Fix printing of anonymous struct typedefs.
clang -cc1 -ast-print put the struct
definition in the wrong place, like this:

  struct {} typedef S;

The reason that this happens is that the printing code
first prints the struct definition, and then tells the next
declaration to leave out the type. This behavior
is correct for simple variable declarations, but fails for
typedefs (or extern, mutable, etc).

The patch address this problem by skipping the struct
declaration when we first see it, and then telling the first
subsequent declaration that it needs to print out the full
struct definition.

Differential Revision: http://reviews.llvm.org/D17285

llvm-svn: 263836
2016-03-18 21:35:59 +00:00
..
APValue.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
ASTConsumer.cpp Move LocInfoType from Sema to AST. 2016-02-01 17:42:01 +00:00
ASTContext.cpp [OPENMP 4.0] Codegen for 'declare reduction' construct. 2016-03-04 09:22:22 +00:00
ASTDiagnostic.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
ASTDumper.cpp Serialize `#pragma detect_mismatch`. 2016-03-02 19:28:54 +00:00
ASTImporter.cpp Caught and fixed a typo in r262572. 2016-03-03 02:22:05 +00:00
ASTTypeTraits.cpp [AST] Pull simple method inline. 2016-01-30 12:16:23 +00:00
AttrImpl.cpp Devirtualize Attr and all subclasses. 2015-03-19 16:06:49 +00:00
CMakeLists.txt Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
CXXABI.h [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
CXXInheritance.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
Comment.cpp Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. 2014-08-30 16:55:39 +00:00
CommentBriefParser.cpp
CommentCommandTraits.cpp Fix for PR21254 - Assertion in comment parser 2014-10-15 16:18:20 +00:00
CommentLexer.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
CommentParser.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
CommentSema.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
Decl.cpp Implement support for [[nodiscard]] in C++1z that is based off existing support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class. 2016-03-07 22:44:55 +00:00
DeclBase.cpp Sema: Treat 'strict' availability flag like unavailable 2016-03-08 06:12:54 +00:00
DeclCXX.cpp P0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes; these are initialized as if they were data members. 2016-03-08 22:17:41 +00:00
DeclFriend.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclGroup.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclObjC.cpp Fix ObjCMethodDecl::findPropertyDecl for class properties. 2016-03-11 21:14:40 +00:00
DeclOpenMP.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
DeclPrinter.cpp Fix printing of anonymous struct typedefs. 2016-03-18 21:35:59 +00:00
DeclTemplate.cpp ArrayRef-ize TemplateParameterList. NFC 2015-12-27 07:16:27 +00:00
DeclarationName.cpp [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in printing policy. 2016-02-15 01:32:36 +00:00
Expr.cpp [OPENMP 4.0] Fixed support of array sections/array subscripts. 2016-02-04 11:27:03 +00:00
ExprCXX.cpp Only instantiate a default argument once. 2016-01-06 22:34:54 +00:00
ExprClassification.cpp [MSVC] 'property' with an empty array in array subscript expression. 2015-11-25 12:01:00 +00:00
ExprConstant.cpp Update for new argument to scalbn 2016-03-13 05:12:47 +00:00
ExprObjC.cpp [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h" 2015-12-31 06:01:19 +00:00
ExternalASTSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
InheritViz.cpp InheritViz: Hide implementation details 2015-03-09 15:03:20 +00:00
ItaniumCXXABI.cpp [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
ItaniumMangle.cpp Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end 2016-03-16 18:00:46 +00:00
Mangle.cpp Make TargetInfo store an actual DataLayout instead of a string. 2016-03-04 19:00:41 +00:00
MicrosoftCXXABI.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
MicrosoftMangle.cpp [MS ABI] Mangle symbols names longer than 4096 characters correctly 2016-03-07 08:51:17 +00:00
NSAPI.cpp [OpenCL] Add new types for OpenCL 2.0. 2015-09-15 11:18:52 +00:00
NestedNameSpecifier.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
OpenMPClause.cpp [OPENMP 4.5] Codegen for data members in 'linear' clause. 2016-03-09 09:49:00 +00:00
ParentMap.cpp Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
RawCommentList.cpp Allow any comment to be a trailing comment when -fparse-all-comments is on. 2015-07-15 19:13:39 +00:00
RecordLayout.cpp CXXInfo memory should be released after calling the destructor 2014-05-24 07:19:25 +00:00
RecordLayoutBuilder.cpp pr26544: Bitfield layout with pragma pack and attributes "packed" and 2016-02-19 11:23:28 +00:00
SelectorLocationsKind.cpp
Stmt.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
StmtCXX.cpp [coroutines] Creation of promise object, lookup of operator co_await, building 2015-10-27 06:02:45 +00:00
StmtIterator.cpp [ptr-traits] Stop using two bogus types as stand-ins for flags 2015-12-30 02:51:00 +00:00
StmtObjC.cpp Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
StmtOpenMP.cpp [OpenMP] Parsing + sema for target parallel for directive. 2016-02-03 15:46:42 +00:00
StmtPrinter.cpp [OPENMP 4.5] Initial support for data members in 'reduction' clauses. 2016-02-29 05:54:20 +00:00
StmtProfile.cpp [OPENMP 4.5] Codegen for data members in 'linear' clause. 2016-03-09 09:49:00 +00:00
StmtViz.cpp
TemplateBase.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
TemplateName.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
Type.cpp Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end 2016-03-16 18:00:46 +00:00
TypeLoc.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
TypePrinter.cpp Fix printing of anonymous struct typedefs. 2016-03-18 21:35:59 +00:00
VTTBuilder.cpp Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept. 2014-11-19 07:49:47 +00:00
VTableBuilder.cpp Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables"" 2016-02-11 17:49:28 +00:00