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 | fcaa2e1ba492845cbb613ff5d39f16b1e323e89b (patch) | |
tree | 9fff24712c804121ccf34612cffd3de7fe655cb5 /clang/lib/CodeGen/CGException.cpp | |
parent | fb0b7583a783723762840172c251fe57b67eb3a6 (diff) | |
download | bcm5719-llvm-fcaa2e1ba492845cbb613ff5d39f16b1e323e89b.tar.gz bcm5719-llvm-fcaa2e1ba492845cbb613ff5d39f16b1e323e89b.zip |
Revert r127617: "Code generation for noexcept."
The tests fail in a -Asserts build.
llvm-svn: 127635
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 7fdfe700421..f05bc700b4f 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/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) { |