annotate clang/test/Analysis/NSPanel.m @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // BEGIN delta-debugging reduced header stuff
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 typedef struct objc_selector *SEL;
anatofuz
parents:
diff changeset
7 typedef signed char BOOL;
anatofuz
parents:
diff changeset
8 typedef unsigned int NSUInteger;
anatofuz
parents:
diff changeset
9 typedef struct _NSZone NSZone;
anatofuz
parents:
diff changeset
10 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
anatofuz
parents:
diff changeset
11 @protocol NSObject
anatofuz
parents:
diff changeset
12 - (BOOL)isEqual:(id)object;
anatofuz
parents:
diff changeset
13 - (oneway void)release;
anatofuz
parents:
diff changeset
14 @end
anatofuz
parents:
diff changeset
15 @protocol NSCopying
anatofuz
parents:
diff changeset
16 - (id)copyWithZone:(NSZone *)zone;
anatofuz
parents:
diff changeset
17 @end
anatofuz
parents:
diff changeset
18 @protocol NSMutableCopying
anatofuz
parents:
diff changeset
19 - (id)mutableCopyWithZone:(NSZone *)zone;
anatofuz
parents:
diff changeset
20 @end
anatofuz
parents:
diff changeset
21 @protocol NSCoding
anatofuz
parents:
diff changeset
22 - (void)encodeWithCoder:(NSCoder *)aCoder;
anatofuz
parents:
diff changeset
23 @end
anatofuz
parents:
diff changeset
24 @interface NSObject <NSObject> {}
anatofuz
parents:
diff changeset
25 + (id)alloc;
anatofuz
parents:
diff changeset
26 @end
anatofuz
parents:
diff changeset
27 typedef float CGFloat;
anatofuz
parents:
diff changeset
28 typedef struct _NSPoint {} NSRect;
anatofuz
parents:
diff changeset
29 static __inline__ __attribute__((always_inline)) NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) { NSRect r; return r; }
anatofuz
parents:
diff changeset
30 typedef struct {} NSFastEnumerationState;
anatofuz
parents:
diff changeset
31 @protocol NSFastEnumeration
anatofuz
parents:
diff changeset
32 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
anatofuz
parents:
diff changeset
33 @end
anatofuz
parents:
diff changeset
34 @class NSString;
anatofuz
parents:
diff changeset
35 @interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
anatofuz
parents:
diff changeset
36 - (NSUInteger)count;
anatofuz
parents:
diff changeset
37 @end
anatofuz
parents:
diff changeset
38 @interface NSMutableArray : NSArray
anatofuz
parents:
diff changeset
39 - (void)addObject:(id)anObject;
anatofuz
parents:
diff changeset
40 @end @class NSAppleEventDescriptor;
anatofuz
parents:
diff changeset
41 enum { NSBackingStoreRetained = 0, NSBackingStoreNonretained = 1, NSBackingStoreBuffered = 2 };
anatofuz
parents:
diff changeset
42 typedef NSUInteger NSBackingStoreType;
anatofuz
parents:
diff changeset
43 @interface NSResponder : NSObject <NSCoding> {} @end
anatofuz
parents:
diff changeset
44 @protocol NSAnimatablePropertyContainer
anatofuz
parents:
diff changeset
45 - (id)animator;
anatofuz
parents:
diff changeset
46 @end
anatofuz
parents:
diff changeset
47 @protocol NSValidatedUserInterfaceItem
anatofuz
parents:
diff changeset
48 - (SEL)action;
anatofuz
parents:
diff changeset
49 @end
anatofuz
parents:
diff changeset
50 @protocol NSUserInterfaceValidations
anatofuz
parents:
diff changeset
51 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
anatofuz
parents:
diff changeset
52 @end @class NSDate, NSDictionary, NSError, NSException, NSNotification;
anatofuz
parents:
diff changeset
53 enum { NSBorderlessWindowMask = 0, NSTitledWindowMask = 1 << 0, NSClosableWindowMask = 1 << 1, NSMiniaturizableWindowMask = 1 << 2, NSResizableWindowMask = 1 << 3 };
anatofuz
parents:
diff changeset
54 @interface NSWindow : NSResponder <NSAnimatablePropertyContainer, NSUserInterfaceValidations> {}
anatofuz
parents:
diff changeset
55 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag;
anatofuz
parents:
diff changeset
56 @end
anatofuz
parents:
diff changeset
57 extern NSString *NSWindowDidBecomeKeyNotification;
anatofuz
parents:
diff changeset
58 @interface NSPanel : NSWindow {}
anatofuz
parents:
diff changeset
59 @end
anatofuz
parents:
diff changeset
60 @class NSTableHeaderView;
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 // END delta-debugging reduced header stuff
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 @interface MyClass
anatofuz
parents:
diff changeset
65 {
anatofuz
parents:
diff changeset
66 NSMutableArray *panels;
anatofuz
parents:
diff changeset
67 }
anatofuz
parents:
diff changeset
68 - (void)myMethod;
anatofuz
parents:
diff changeset
69 - (void)myMethod2;
anatofuz
parents:
diff changeset
70 @end
anatofuz
parents:
diff changeset
71
anatofuz
parents:
diff changeset
72 @implementation MyClass // no-warning
anatofuz
parents:
diff changeset
73 - (void)myMethod
anatofuz
parents:
diff changeset
74 {
anatofuz
parents:
diff changeset
75 NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 200, 200) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:(BOOL)1];
anatofuz
parents:
diff changeset
76
anatofuz
parents:
diff changeset
77 [panels addObject:panel];
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 [panel release]; // no-warning
anatofuz
parents:
diff changeset
80 }
anatofuz
parents:
diff changeset
81 - (void)myMethod2
anatofuz
parents:
diff changeset
82 {
anatofuz
parents:
diff changeset
83 NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 200, 200) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:(BOOL)1]; // no-warning
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 [panels addObject:panel];
anatofuz
parents:
diff changeset
86 }
anatofuz
parents:
diff changeset
87 @end
anatofuz
parents:
diff changeset
88