From 6379a7a15335e0af543a942efe9cfd514a83dab8 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 11 Aug 2008 17:36:14 +0000 Subject: 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 --- lib/CodeGen/CodeGenModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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(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()) { AddGlobalCtor(Fn, CA->getPriority()); } else if (const DestructorAttr *DA = D->getAttr()) { -- cgit v1.2.3-70-g09d2