[cfe-commits] r143139 - in /cfe/trunk: lib/Sema/SemaStmt.cpp test/CodeGenObjC/arc-cond-stmt.m
Fariborz Jahanian
fjahanian at apple.com
Thu Oct 27 13:06:32 PDT 2011
Author: fjahanian
Date: Thu Oct 27 15:06:32 2011
New Revision: 143139
URL: http://llvm.org/viewvc/llvm-project?rev=143139&view=rev
Log:
objc: fix an ir-gen crash caused by recent
property refactoring. // rdar://10327068
Added:
cfe/trunk/test/CodeGenObjC/arc-cond-stmt.m
Modified:
cfe/trunk/lib/Sema/SemaStmt.cpp
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=143139&r1=143138&r2=143139&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Oct 27 15:06:32 2011
@@ -497,7 +497,7 @@
return StmtError();
CondResult
- = ConvertToIntegralOrEnumerationType(SwitchLoc, Cond,
+ = ConvertToIntegralOrEnumerationType(SwitchLoc, CondResult.take(),
PDiag(diag::err_typecheck_statement_requires_integer),
PDiag(diag::err_switch_incomplete_class_type)
<< Cond->getSourceRange(),
Added: cfe/trunk/test/CodeGenObjC/arc-cond-stmt.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-cond-stmt.m?rev=143139&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-cond-stmt.m (added)
+++ cfe/trunk/test/CodeGenObjC/arc-cond-stmt.m Thu Oct 27 15:06:32 2011
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -o - %s
+// rdar://10327068
+
+ at class NSString;
+
+ at interface NSAssertionHandler {
+}
+
++ (NSAssertionHandler *)currentHandler;
+
+- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(int)line ,...;
+
+ at end
+
+typedef enum
+{
+ MWRaceOrder_MeetName,
+ MWRaceOrder_MeetPosition,
+ MWRaceOrder_MeetDistance,
+ MWRaceOrder_Name,
+ MWRaceOrder_Position,
+ MWRaceOrder_Distance,
+ MWRaceOrder_Default = MWRaceOrder_Name,
+ MWRaceOrder_MeetDefault = MWRaceOrder_MeetName,
+} MWRaceOrder;
+
+ at interface MWViewMeetController
+ at property (nonatomic, assign) MWRaceOrder raceOrder;
+ at end
+
+ at implementation MWViewMeetController
+
+- (int)orderSegment
+{
+ switch (self.raceOrder)
+ {
+
+ default:
+ { [(NSAssertionHandler *)0 handleFailureInMethod:_cmd object:self file:(NSString*)0 lineNumber:192 ]; };
+ break;
+ }
+
+ return 0;
+}
+
+ at synthesize raceOrder;
+
+ at end
More information about the cfe-commits
mailing list