aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-10-12 19:51:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-10-12 19:51:18 +0000
commit6700415542121e2cb7d867728046ffa21e402019 (patch)
treec45b4afdda68460a0ca4054cd8180fe78c605ab2 /lib/AST/DeclPrinter.cpp
parentd768150ef57f617c8d9fef48f3c92e8f21698024 (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.cpp4
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(),