summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-11 17:36:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-11 17:36:14 +0000
commitfb3043d62708f182b7387924456c2282d374a9ef (patch)
tree9fdcbf6f3068d69a02d0a3290bf793fb083ecc52 /clang/lib/CodeGen/CodeGenModule.cpp
parent48595de6979d6965e1ae6a97ed3cf68d69bfc41d (diff)
downloadbcm5719-llvm-fb3043d62708f182b7387924456c2282d374a9ef.tar.gz
bcm5719-llvm-fb3043d62708f182b7387924456c2282d374a9ef.zip
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. llvm-svn: 54643
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c77dfa6a813..b3e721308d6 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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>()) {
OpenPOWER on IntegriCloud