diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-12 19:51:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-12 19:51:18 +0000 |
commit | 6700415542121e2cb7d867728046ffa21e402019 (patch) | |
tree | c45b4afdda68460a0ca4054cd8180fe78c605ab2 /lib/AST/DeclPrinter.cpp | |
parent | d768150ef57f617c8d9fef48f3c92e8f21698024 (diff) |
Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclPrinter.cpp')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 73f5cdb122..4f3e8ad2d5 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -468,6 +468,10 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { if (D->hasAttr<NoReturnAttr>()) Proto += " __attribute((noreturn))"; + + if (D->hasAttr<ReturnsTwiceAttr>()) + Proto += " __attribute((returns_twice))"; + if (CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D)) { bool HasInitializerList = false; for (CXXConstructorDecl::init_const_iterator B = CDecl->init_begin(), |