diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1979,7 +1979,7 @@ def NoInstrumentFunction : InheritableAttr { let Spellings = [GCC<"no_instrument_function">]; - let Subjects = SubjectList<[Function]>; + let Subjects = SubjectList<[Function, ObjCMethod]>; let Documentation = [Undocumented]; let SimpleHandler = 1; } diff --git a/clang/test/CodeGen/instrument-objc-method.m b/clang/test/CodeGen/instrument-objc-method.m new file mode 100644 --- /dev/null +++ b/clang/test/CodeGen/instrument-objc-method.m @@ -0,0 +1,24 @@ +#import +// RUN: %clang_cc1 -S -triple x86_64-apple-darwin10 -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-functions -disable-llvm-passes | FileCheck %s +// RUN: %clang_cc1 -S -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-function-entry-bare -disable-llvm-passes | FileCheck -check-prefix=BARE %s + + +@interface ObjCClass +@end + +@implementation ObjCClass + +// CHECK: @load +// CHECK: "instrument-function-entry"="__cyg_profile_func_enter" ++ (void)load __attribute__((no_instrument_function)) +{ +} + ++ (void)initialize +{ +} + +-(void)dealloc __attribute__((no_instrument_function)) +{ +} +@end