diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-15 00:18:21 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-15 00:18:21 +0000 |
commit | 112d5ee15a09f15e597037724e006004b3f2f78f (patch) | |
tree | 756ac17e2dfdc26822a03c9b418bad64f02d2b55 /lib/CodeGen/CGException.cpp | |
parent | 18d8b7996b1eb35f3f5fd2d1e6eef3d72843fbeb (diff) |
Revert r127617: "Code generation for noexcept."
The tests fail in a -Asserts build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
-rw-r--r-- | lib/CodeGen/CGException.cpp | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 7fdfe70042..f05bc700b4 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -449,23 +449,19 @@ void CodeGenFunction::EmitStartEHSpec(const Decl *D) { if (Proto == 0) return; - ExceptionSpecificationType EST = Proto->getExceptionSpecType(); - if (isNoexceptExceptionSpec(EST)) { - if (Proto->getNoexceptSpec(getContext()) == FunctionProtoType::NR_Nothrow) { - // noexcept functions are simple terminate scopes. - EHStack.pushTerminate(); - } - } else if (EST == EST_Dynamic || EST == EST_DynamicNone) { - unsigned NumExceptions = Proto->getNumExceptions(); - EHFilterScope *Filter = EHStack.pushFilter(NumExceptions); - - for (unsigned I = 0; I != NumExceptions; ++I) { - QualType Ty = Proto->getExceptionType(I); - QualType ExceptType = Ty.getNonReferenceType().getUnqualifiedType(); - llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(ExceptType, - /*ForEH=*/true); - Filter->setFilter(I, EHType); - } + // FIXME: What about noexcept? + if (!Proto->hasDynamicExceptionSpec()) + return; + + unsigned NumExceptions = Proto->getNumExceptions(); + EHFilterScope *Filter = EHStack.pushFilter(NumExceptions); + + for (unsigned I = 0; I != NumExceptions; ++I) { + QualType Ty = Proto->getExceptionType(I); + QualType ExceptType = Ty.getNonReferenceType().getUnqualifiedType(); + llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(ExceptType, + /*ForEH=*/true); + Filter->setFilter(I, EHType); } } @@ -480,14 +476,10 @@ void CodeGenFunction::EmitEndEHSpec(const Decl *D) { if (Proto == 0) return; - ExceptionSpecificationType EST = Proto->getExceptionSpecType(); - if (isNoexceptExceptionSpec(EST)) { - if (Proto->getNoexceptSpec(getContext()) == FunctionProtoType::NR_Nothrow) { - EHStack.popTerminate(); - } - } else if (EST == EST_Dynamic || EST == EST_DynamicNone) { - EHStack.popFilter(); - } + if (!Proto->hasDynamicExceptionSpec()) + return; + + EHStack.popFilter(); } void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) { |