This is an archive of the discontinued LLVM Phabricator instance.

Add no_instrument_function attribute to Objective C methods as well
ClosedPublic

Authored by hiraditya on Oct 6 2021, 9:43 PM.

Details

Summary

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

Diff Detail

Event Timeline

hiraditya created this revision.Oct 6 2021, 9:43 PM
hiraditya requested review of this revision.Oct 6 2021, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 9:43 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Still working on adding the testcase.

hiraditya updated this revision to Diff 377751.Oct 6 2021, 11:25 PM

Testcase ready.

hiraditya updated this revision to Diff 377752.Oct 6 2021, 11:26 PM
hiraditya edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Oct 7 2021, 12:27 AM

CI is currently broken, so there's a test here that needs updating: https://reviews.llvm.org/harbormaster/unit/view/1389113/

Also, this should have at least one SemaObjC test to demonstrate that we no longer diagnose this as an unknown attribute in that case.

hiraditya updated this revision to Diff 377895.Oct 7 2021, 10:06 AM

Added SemaObjc test case.

aaron.ballman accepted this revision.Oct 7 2021, 10:28 AM

LGTM, thanks!

hiraditya updated this revision to Diff 377934.Oct 7 2021, 11:47 AM

clang-format