mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 19:36:38 +00:00

There are functions where we do not want function instrumentation which is why we have `__attribute__((no_instrument_function))`. Extending this functionality to disable instrumentation for Objective-C methods as well. Objective C methods like `+load` run premain and having instrumentation on them causes runtime errors depending on the implementation of `__cyg_profile_func_enter` etc. functions Reviewed By: rjmccall, aaron.ballman Differential Revision: https://reviews.llvm.org/D111286
23 lines
529 B
Objective-C
23 lines
529 B
Objective-C
// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10.4 -verify -Wno-objc-root-class %s
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -triple x86_64-apple-darwin10.4 -verify -Wno-objc-root-class %s
|
|
|
|
// expected-no-diagnostics
|
|
@interface A
|
|
+ (void)F __attribute__((no_instrument_function)); // no warning
|
|
- (void)f __attribute__((objc_direct, no_instrument_function));
|
|
- (void)g;
|
|
@end
|
|
|
|
@implementation A
|
|
+ (void)F __attribute__((no_instrument_function)) {
|
|
[self F];
|
|
}
|
|
|
|
- (void)f {
|
|
[self g];
|
|
}
|
|
|
|
- (void)g {
|
|
}
|
|
@end
|