diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-08-12 21:54:04 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-08-12 21:54:04 +0000 |
| commit | 24b3fed69fd2bb25a0c2d2a62e051f8702e92391 (patch) | |
| tree | afd3519febba5747f556fbf4e08764c6ad30db81 /clang/lib | |
| parent | e2358c1debe988a9ff262cb267c791c93ee04a4a (diff) | |
| download | bcm5719-llvm-24b3fed69fd2bb25a0c2d2a62e051f8702e92391.tar.gz bcm5719-llvm-24b3fed69fd2bb25a0c2d2a62e051f8702e92391.zip | |
Fix pretty-printing for unnamed unions.
This is just a couple of minor fixes to account for the existence
of ElaboratedType.
llvm-svn: 188209
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 10ef28828c4..1e2d9d6e084 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -260,6 +260,8 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { QualType CurDeclType = getDeclType(*D); if (!Decls.empty() && !CurDeclType.isNull()) { QualType BaseType = GetBaseType(CurDeclType); + if (!BaseType.isNull() && isa<ElaboratedType>(BaseType)) + BaseType = cast<ElaboratedType>(BaseType)->getNamedType(); if (!BaseType.isNull() && isa<TagType>(BaseType) && cast<TagType>(BaseType)->getDecl() == Decls[0]) { Decls.push_back(*D); diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 3b917aa33fb..f6fd886e8a4 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1003,6 +1003,8 @@ void TypePrinter::printInjectedClassNameAfter(const InjectedClassNameType *T, void TypePrinter::printElaboratedBefore(const ElaboratedType *T, raw_ostream &OS) { + if (Policy.SuppressTag && isa<TagType>(T->getNamedType())) + return; OS << TypeWithKeyword::getKeywordName(T->getKeyword()); if (T->getKeyword() != ETK_None) OS << " "; |

