summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2011-08-20 20:55:40 +0000
committerJordy Rose <jediknil@belkadan.com>2011-08-20 20:55:40 +0000
commit5a3c9ff3a35a1d1768fd711e334bc3f704d37a4e (patch)
tree94c9e5abdb493b823a4c024815568bf7600f16f6 /clang/test/Analysis
parentbd16424f91457040945a1c757aaeeae35bce435a (diff)
downloadbcm5719-llvm-5a3c9ff3a35a1d1768fd711e334bc3f704d37a4e.tar.gz
bcm5719-llvm-5a3c9ff3a35a1d1768fd711e334bc3f704d37a4e.zip
[analyzer] Move handling of hardcoded noreturn ("panic") methods from CFRefCount to NoReturnFunctionChecker. No functionality change intended.
llvm-svn: 138210
Diffstat (limited to 'clang/test/Analysis')
-rw-r--r--clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m b/clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m
index 6466993a3b7..35461dd0dbf 100644
--- a/clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m
+++ b/clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m
@@ -20,6 +20,7 @@ extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
@interface NSAssertionHandler : NSObject {}
+ (NSAssertionHandler *)currentHandler;
- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...;
+- (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...;
@end
extern NSString * const NSConnectionReplyMode;
@@ -63,3 +64,10 @@ extern NSString * const NSConnectionReplyMode;
}
@end
+
+void pointerFunction (int *x) {
+ // Manual expansion of NSCAssert( x != 0, @"")
+ do { if (!((x != 0))) { [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] file:[NSString stringWithUTF8String:__FILE__] lineNumber:__LINE__ description:((@""))]; } } while(0);
+
+ *x = 1; // no-warning
+}
OpenPOWER on IntegriCloud