summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-15 00:18:21 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-15 00:18:21 +0000
commitfcaa2e1ba492845cbb613ff5d39f16b1e323e89b (patch)
tree9fff24712c804121ccf34612cffd3de7fe655cb5
parentfb0b7583a783723762840172c251fe57b67eb3a6 (diff)
downloadbcm5719-llvm-fcaa2e1ba492845cbb613ff5d39f16b1e323e89b.tar.gz
bcm5719-llvm-fcaa2e1ba492845cbb613ff5d39f16b1e323e89b.zip
Revert r127617: "Code generation for noexcept."
The tests fail in a -Asserts build. llvm-svn: 127635
-rw-r--r--clang/lib/CodeGen/CGException.cpp42
-rw-r--r--clang/test/CXX/except/except.spec/p9-dynamic.cpp12
-rw-r--r--clang/test/CXX/except/except.spec/p9-noexcept.cpp19
3 files changed, 17 insertions, 56 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) {
diff --git a/clang/test/CXX/except/except.spec/p9-dynamic.cpp b/clang/test/CXX/except/except.spec/p9-dynamic.cpp
deleted file mode 100644
index 3e7f931e5d8..00000000000
--- a/clang/test/CXX/except/except.spec/p9-dynamic.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
-
-void external();
-
-void target() throw(int)
-{
- // CHECK: invoke void @_Z8externalv()
- external();
-}
-// CHECK: %eh.selector = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i32 2, i8* bitcast (i8** @_ZTIi to i8*), i8* null) nounwind
-// CHECK: ehspec.unexpected:
-// CHECK: call void @__cxa_call_unexpected(i8* %1) noreturn
diff --git a/clang/test/CXX/except/except.spec/p9-noexcept.cpp b/clang/test/CXX/except/except.spec/p9-noexcept.cpp
deleted file mode 100644
index 71a8dee1eda..00000000000
--- a/clang/test/CXX/except/except.spec/p9-noexcept.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %clang_cc1 %s -std=c++0x -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
-
-void external();
-
-void target() noexcept
-{
- // CHECK: invoke void @_Z8externalv()
- external();
-}
-// CHECK: terminate.lpad:
-// CHECK: %eh.selector = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null) nounwind
-// CHECK-NEXT: call void @_ZSt9terminatev() noreturn nounwind
-// CHECK-NEXT: unreachable
-
-void reverse() noexcept(false)
-{
- // CHECK: call void @_Z8externalv()
- external();
-}
OpenPOWER on IntegriCloud