diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-11 17:36:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-11 17:36:14 +0000 |
commit | 6379a7a15335e0af543a942efe9cfd514a83dab8 (patch) | |
tree | a8636980d6c00dd64e11ac146bbdf6f35d1889fb /lib/CodeGen/CodeGenModule.cpp | |
parent | 58bf6101062867ca4b3028f9e77e4ae642f09b44 (diff) |
Add -fexceptions to Driver
- Maps to LangOptions.Exceptions
- Currently always off, should autoselect based on language.
Update CodeGen to set unwind attribute on functions definitions based
on LangOptions.Exceptions.
- Still need to set attributes appropriately on calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index c77dfa6a81..b3e721308d 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -751,6 +751,12 @@ void CodeGenModule::EmitGlobalFunctionDefinition(const FunctionDecl *D) { llvm::Function *Fn = cast<llvm::Function>(Entry); CodeGenFunction(*this).GenerateCode(D, Fn); + // Set attributes specific to definition. + // FIXME: This needs to be cleaned up by clearly emitting the + // declaration / definition at separate times. + if (!Features.Exceptions) + Fn->addParamAttr(0, llvm::ParamAttr::NoUnwind); + if (const ConstructorAttr *CA = D->getAttr<ConstructorAttr>()) { AddGlobalCtor(Fn, CA->getPriority()); } else if (const DestructorAttr *DA = D->getAttr<DestructorAttr>()) { |