aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-03 03:45:26 +0000
committerChris Lattner <sabre@nondot.org>2008-03-03 03:45:26 +0000
commitf89e88d1278828e43d4a67687ba96af88a66d634 (patch)
tree0072b5af125ffd2a00608ce78946b57c7df1ad8b /CodeGen/CodeGenFunction.cpp
parentddee4231e9bdfbac1e1f5385ff1a17fd0e0b0e39 (diff)
fix codegen support for functions that are nothrow and noreturn.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenFunction.cpp')
-rw-r--r--CodeGen/CodeGenFunction.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp
index 6701b71f09..adbb414cc0 100644
--- a/CodeGen/CodeGenFunction.cpp
+++ b/CodeGen/CodeGenFunction.cpp
@@ -82,18 +82,17 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
// FIXME: else handle -fvisibility
- llvm::ParamAttrsVector ParamAttrsVec;
-
+ unsigned FuncAttrs = 0;
if (FD->getAttr<NoThrowAttr>())
- ParamAttrsVec.push_back(
- llvm::ParamAttrsWithIndex::get(ParamAttrsVec.size(), llvm::ParamAttr::NoUnwind));
+ FuncAttrs |= llvm::ParamAttr::NoUnwind;
if (FD->getAttr<NoReturnAttr>())
- ParamAttrsVec.push_back(
- llvm::ParamAttrsWithIndex::get(ParamAttrsVec.size(), llvm::ParamAttr::NoReturn));
-
- if (!ParamAttrsVec.empty())
+ FuncAttrs |= llvm::ParamAttr::NoReturn;
+
+ if (FuncAttrs) {
+ llvm::ParamAttrsVector ParamAttrsVec;
+ ParamAttrsVec.push_back(llvm::ParamAttrsWithIndex::get(0, FuncAttrs));
CurFn->setParamAttrs(llvm::ParamAttrsList::get(ParamAttrsVec));
-
+ }
llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);