summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.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
commit2d21ab024ed371ce2a45c8691d0676a4ed855cc1 (patch)
tree41ec69341bd6b739149021a3287d76aa530ea02b /clang/lib/CodeGen/CGCall.cpp
parenta35d67dfd927191a16cf24931981d79901938381 (diff)
downloadbcm5719-llvm-2d21ab024ed371ce2a45c8691d0676a4ed855cc1.tar.gz
bcm5719-llvm-2d21ab024ed371ce2a45c8691d0676a4ed855cc1.zip
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. llvm-svn: 141803
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index f52abef3306..6ae2d0c9677 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -729,6 +729,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
// FIXME: handle sseregparm someday...
if (TargetDecl) {
+ if (TargetDecl->hasAttr<ReturnsTwiceAttr>())
+ FuncAttrs |= llvm::Attribute::ReturnsTwice;
if (TargetDecl->hasAttr<NoThrowAttr>())
FuncAttrs |= llvm::Attribute::NoUnwind;
else if (const FunctionDecl *Fn = dyn_cast<FunctionDecl>(TargetDecl)) {
OpenPOWER on IntegriCloud