diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-02-25 18:49:49 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-02-25 18:49:49 +0000 |
commit | 2907b08219a3cdc0c6c634831c59703be0a8365a (patch) | |
tree | 619f04c83bdd3357d13f761ecbc7eb66bf1de400 /clang/lib/AST/DeclPrinter.cpp | |
parent | dc598febe4b4c51ee7a9a60502fb86d5a7165670 (diff) | |
download | bcm5719-llvm-2907b08219a3cdc0c6c634831c59703be0a8365a.tar.gz bcm5719-llvm-2907b08219a3cdc0c6c634831c59703be0a8365a.zip |
Pretty Printer: Print constexpr and ref qualifiers. Don't print return types on destructors.
llvm-svn: 202181
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 05701a5b061..aa292dbfe1a 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -399,6 +399,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { if (D->isInlineSpecified()) Out << "inline "; if (D->isVirtualAsWritten()) Out << "virtual "; if (D->isModulePrivate()) Out << "__module_private__ "; + if (D->isConstexpr() && !D->isExplicitlyDefaulted()) Out << "constexpr "; if ((CDecl && CDecl->isExplicitSpecified()) || (ConversionDecl && ConversionDecl->isExplicit())) Out << "explicit "; @@ -449,6 +450,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Proto += " volatile"; if (FT->isRestrict()) Proto += " restrict"; + + switch (FT->getRefQualifier()) { + case RQ_None: + break; + case RQ_LValue: + Proto += " &"; + break; + case RQ_RValue: + Proto += " &&"; + break; + } } if (FT && FT->hasDynamicExceptionSpec()) { @@ -537,8 +549,10 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { } } Out << ")"; + if (BMInitializer->isPackExpansion()) + Out << "..."; } - } else if (!ConversionDecl) { + } else if (!ConversionDecl && !isa<CXXDestructorDecl>(D)) { if (FT && FT->hasTrailingReturn()) { Out << "auto " << Proto << " -> "; Proto.clear(); |