This is an archive of the discontinued LLVM Phabricator instance.

Work around an unfortunate macro in the Windows SDK
ClosedPublic

Authored by zahen on May 3 2021, 11:56 AM.

Details

Summary

Rename LLVM's single use of CALLBACK as a template parameter to work around the Windows SDK #define CALLBACK __stdcall

I'm sympathetic to the Michael Bolton argument but these are the only 2 lines affected in all of LLVM.

Once accepted I'll need someone to commit the change on my behalf.

Diff Detail

Event Timeline

zahen requested review of this revision.May 3 2021, 11:56 AM
zahen created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2021, 11:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Once accepted I'll need someone to commit the change on my behalf.

Thanks for mentioning this up front! What email address and name would you like to have used for attribution on the commit?

clang/include/clang/Analysis/CFG.h
1392–1393

Good catch on fixing this! I think a better fix would be to change the name CALLBACK to Callback to more closely match our usual naming conventions (https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly). Keeping it in all caps makes the identifier look like a macro when it isn't one. You might as well address the clang-format issue while you're touching the code, as well.

zahen updated this revision to Diff 342715.May 4 2021, 6:41 AM

Updated the macro based on Aaron's suggestion. clang-formatted the function.

zahen added a comment.May 4 2021, 6:42 AM

Once accepted I'll need someone to commit the change on my behalf.

Thanks for mentioning this up front! What email address and name would you like to have used for attribution on the commit?

Zachary Henkel, zahen@microsoft.com (GitHub username ZacharyHenkel)

zahen marked an inline comment as done.May 4 2021, 6:42 AM
This revision is now accepted and ready to land.May 4 2021, 8:16 AM
aaron.ballman closed this revision.May 4 2021, 8:22 AM

Thank you for the fix! I've committed on your behalf in 54bff1522fc863329894d875d54c2fe4cd1b4f3f