[cfe-commits] r172091 - in /cfe/trunk: lib/CodeGen/CGException.cpp lib/CodeGen/CGObjCGNU.cpp lib/CodeGen/CGObjCMac.cpp lib/CodeGen/CGObjCRuntime.h test/CodeGenObjCXX/exceptions.mm

Jean-Daniel Dupas devlists at shadowlab.org
Thu Jan 10 14:10:10 PST 2013


Le 10 janv. 2013 à 20:02, Fariborz Jahanian <fjahanian at apple.com> a écrit :

> Author: fjahanian
> Date: Thu Jan 10 13:02:56 2013
> New Revision: 172091
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=172091&view=rev
> Log:
> objectiveC++: When throwing c++ exception of 
> an objectiveC object, use objc_exception_throw
> to raise the exception. // rdar://12605907

…

> Modified: cfe/trunk/test/CodeGenObjCXX/exceptions.mm
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/exceptions.mm?rev=172091&r1=172090&r2=172091&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenObjCXX/exceptions.mm (original)
> +++ cfe/trunk/test/CodeGenObjCXX/exceptions.mm Thu Jan 10 13:02:56 2013
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -o - %s | FileCheck %s
> +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -fobjc-exceptions -o - %s | FileCheck %s
> 
> @interface OCType @end
> void opaque();
> @@ -16,3 +16,19 @@
>     }
>   }
> }
> +
> +// rdar://12605907
> + at interface NSException
> +  - new;
> + at end


Just nitpick, but should it be +new instead of -new ? 


> +namespace test1 {
> +
> +  void bar() {
> +    @try {
> +      throw [NSException new];
> +    } @catch (id i) {
> +    }
> +  }
> +// CHECK: invoke void @objc_exception_throw(i8* [[CALL:%.*]]) noreturn
> +// CHECK:          to label [[INVOKECONT1:%.*]] unwind label [[LPAD:%.*]]
> +}
> 

-- Jean-Daniel








More information about the cfe-commits mailing list