diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-03 03:45:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-03 03:45:26 +0000 |
commit | 65079bd9be12df19531e07f03eb2c65035a3c104 (patch) | |
tree | a67875cc9b19811d17d3884fbd87004c8d0a7568 /clang/CodeGen/CodeGenFunction.cpp | |
parent | 8496639787688225f99ce518d8870caa08ea0ea6 (diff) | |
download | bcm5719-llvm-65079bd9be12df19531e07f03eb2c65035a3c104.tar.gz bcm5719-llvm-65079bd9be12df19531e07f03eb2c65035a3c104.zip |
fix codegen support for functions that are nothrow and noreturn.
llvm-svn: 47838
Diffstat (limited to 'clang/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/CodeGen/CodeGenFunction.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp index 6701b71f097..adbb414cc09 100644 --- a/clang/CodeGen/CodeGenFunction.cpp +++ b/clang/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); |