Revert r127617: "Code generation for noexcept."

The tests fail in a -Asserts build.

llvm-svn: 127635
This commit is contained in:
Jakob Stoklund Olesen 2011-03-15 00:18:21 +00:00
parent fb0b7583a7
commit fcaa2e1ba4
3 changed files with 16 additions and 55 deletions

View File

@ -449,13 +449,10 @@ 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) {
// FIXME: What about noexcept?
if (!Proto->hasDynamicExceptionSpec())
return;
unsigned NumExceptions = Proto->getNumExceptions();
EHFilterScope *Filter = EHStack.pushFilter(NumExceptions);
@ -467,7 +464,6 @@ void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
Filter->setFilter(I, EHType);
}
}
}
void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
if (!CGM.getLangOptions().CXXExceptions)
@ -480,15 +476,11 @@ 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) {
if (!Proto->hasDynamicExceptionSpec())
return;
EHStack.popFilter();
}
}
void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
EnterCXXTryStmt(S);

View File

@ -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

View File

@ -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();
}