This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Exempt _MSVC_EXECUTION_CHARACTER_SET from cppcoreguidelines-macro-usage
AbandonedPublic

Authored by zero9178 on Nov 25 2021, 4:09 AM.

Details

Summary

In https://reviews.llvm.org/D114576 I am trying to add an unconditional define to the MSVC cc1 driver which sadly then leads to a test failure in cppcoreguidelines-macro-usage-command-line-macros.cpp with MSVC builds.

The solution is a bit hacky IMO, but there seems to already be a similar workaround for __GCC_HAVE_DWARF2_CFI_ASM. I don't know of any way to differentiate between defines passed on the CLI by users, and ones set by the driver, so this will have to do for now.

Diff Detail

Event Timeline

zero9178 created this revision.Nov 25 2021, 4:09 AM
zero9178 requested review of this revision.Nov 25 2021, 4:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2021, 4:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
lebedev.ri resigned from this revision.Nov 26 2021, 2:03 AM
lebedev.ri added inline comments.
clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp
40

Can that macro be defined elsewhere so this check fires instead of having to special-case the macro here?

zero9178 abandoned this revision.Nov 30 2021, 12:14 AM

Found another solution to the original issue