This is an archive of the discontinued LLVM Phabricator instance.

[clang] Make guard(nocf) attribute available only for Windows
ClosedPublic

Authored by alvinhochun on Aug 25 2022, 7:19 AM.

Details

Summary

Control Flow Guard is only supported on Windows target, therefore there
is no point to make it an accepted attribute for other targets.

Diff Detail

Event Timeline

alvinhochun created this revision.Aug 25 2022, 7:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 7:19 AM
alvinhochun requested review of this revision.Aug 25 2022, 7:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 7:19 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks for this! Can you also add test coverage for the change?

clang/include/clang/Basic/Attr.td
402

How about we name this one TargetWindows instead of making it specific to just one attribute?

rnk added inline comments.Aug 25 2022, 9:51 AM
clang/include/clang/Basic/Attr.td
373–375

Do we need customcode? Can we not use the OS list here?

Applied suggestions and added test coverage.

aaron.ballman accepted this revision.Aug 26 2022, 4:45 AM

LGTM, thank you!

clang/include/clang/Basic/Attr.td
373–375

Great catch!

This revision is now accepted and ready to land.Aug 26 2022, 4:45 AM
rnk accepted this revision.Aug 26 2022, 11:18 AM

+1

This revision was automatically updated to reflect the committed changes.