CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
138 lines
3.2 KiB
Objective-C
138 lines
3.2 KiB
Objective-C
// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=osx.cocoa.UnusedIvars -verify -Wno-objc-root-class %s
|
|
|
|
//===--- BEGIN: Delta-debugging reduced headers. --------------------------===//
|
|
|
|
@protocol NSObject
|
|
- (id)retain;
|
|
- (oneway void)release;
|
|
@end
|
|
@interface NSObject <NSObject> {}
|
|
- (id)init;
|
|
+ (id)alloc;
|
|
@end
|
|
|
|
//===--- END: Delta-debugging reduced headers. ----------------------------===//
|
|
|
|
// This test case tests the basic functionality of the unused ivar test.
|
|
@interface TestA {
|
|
@private
|
|
int x; // expected-warning {{Instance variable 'x' in class 'TestA' is never used}}
|
|
}
|
|
@end
|
|
@implementation TestA @end
|
|
|
|
// This test case tests whether the unused ivar check handles blocks that
|
|
// reference an instance variable.
|
|
@interface TestB : NSObject {
|
|
@private
|
|
id _ivar; // no-warning
|
|
}
|
|
@property (readwrite,retain) id ivar;
|
|
@end
|
|
|
|
@implementation TestB
|
|
- (id)ivar {
|
|
__attribute__((__blocks__(byref))) id value = ((void*)0);
|
|
void (^b)(void) = ^{ value = _ivar; };
|
|
b();
|
|
return value;
|
|
}
|
|
|
|
- (void)setIvar:(id)newValue {
|
|
void (^b)(void) = ^{ [_ivar release]; _ivar = [newValue retain]; };
|
|
b();
|
|
}
|
|
@end
|
|
|
|
// Confirm that the checker respects [[clang::suppress]].
|
|
@interface TestC {
|
|
@private
|
|
[[clang::suppress]] int x; // no-warning
|
|
}
|
|
@end
|
|
@implementation TestC @end
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Detect that ivar is in use, if used in category in the same file as the
|
|
// implementation.
|
|
//===----------------------------------------------------------------------===//
|
|
@protocol Protocol6260004
|
|
- (id) getId;
|
|
@end
|
|
|
|
@interface RDar6260004 {
|
|
@private
|
|
id x; // no-warning
|
|
}
|
|
@end
|
|
@implementation RDar6260004 @end
|
|
@implementation RDar6260004 (Protocol6260004)
|
|
- (id) getId {
|
|
return x;
|
|
}
|
|
@end
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// ivars referenced by lexically nested functions should not be flagged as
|
|
// unused
|
|
//===----------------------------------------------------------------------===//
|
|
@interface RDar7254495 {
|
|
@private
|
|
int x; // no-warning
|
|
}
|
|
@end
|
|
|
|
@implementation RDar7254495
|
|
int radar_7254495(RDar7254495 *a) {
|
|
return a->x;
|
|
}
|
|
@end
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Consult attribute((unused)) to silence warnings about unused instance
|
|
// variables.
|
|
//===----------------------------------------------------------------------===//
|
|
@interface RDar7353683 {
|
|
@private
|
|
id x __attribute__((unused));
|
|
}
|
|
@end
|
|
|
|
@implementation RDar7353683
|
|
@end
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Unused bitfield ivars trigger cause weird diagnostic:
|
|
// "Instance variable '' in class..."
|
|
//===----------------------------------------------------------------------===//
|
|
@interface RDar8481311 {
|
|
@private
|
|
unsigned bitfield:1; // expected-warning {{Instance variable 'bitfield' in class 'RDar8481311' is never used}}
|
|
}
|
|
@end
|
|
|
|
@implementation RDar8481311
|
|
@end
|
|
|
|
@class NSString;
|
|
@interface Radar11059352_1 {
|
|
@private
|
|
NSString *_pathString;
|
|
}
|
|
@property (readonly, strong) NSString *pathString;
|
|
@end
|
|
|
|
@interface Radar11059352 {
|
|
@private
|
|
Radar11059352_1 *_workspacePath;
|
|
}
|
|
@end
|
|
|
|
@implementation Radar11059352
|
|
|
|
- (void)useWorkspace {
|
|
NSString *workspacePathString = _workspacePath.pathString;
|
|
}
|
|
@end
|