This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add CLANG_TIDY_CONFUSABLE_CHARS_GEN cmake setting to avoid building when cross compiling
ClosedPublic

Authored by mstorsjo on Jul 14 2022, 1:26 PM.

Details

Summary

This is similar to the LLVM_TABLEGEN, CLANG_TABLEGEN and CLANG_PSEUDO_GEN settings.

Diff Detail

Event Timeline

mstorsjo created this revision.Jul 14 2022, 1:26 PM
mstorsjo requested review of this revision.Jul 14 2022, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 1:26 PM

As the name of the tool becomes somewhat public and stable at this point, feel free to suggest shorter/neater names in D129798 too.

Ping @serge-sans-paille @sammccall - does this seem reasonable, and would you like to tweak the name of the tool before cementing it into a public cmake option (that at least I would be setting while cross compiling)?

sammccall accepted this revision.Jul 26 2022, 11:34 PM

Mechanics definitely seem reasonable.

I don't have a strong opinion about the name. I don't find it very clear, the missing info being that it's part of clang-tidy and it relates to confusable unicode characters, but clang-tidy-make-confusable-characters-table is probably too much of a mouthful.

I'd be tempted by clang-tidy-confusable-chars-gen or so but I'm really just painting the bikeshed at this point - up to you.

This revision is now accepted and ready to land.Jul 26 2022, 11:34 PM

I'd be tempted by clang-tidy-confusable-chars-gen or so but I'm really just painting the bikeshed at this point - up to you.

That sounds like a clearer name to me, thanks! I’ll update D129798 and this patch with that name, run some test builds with it, push them, and then file backport requests for them, as they missed the branch.

mstorsjo updated this revision to Diff 448163.Jul 27 2022, 2:30 PM

Updated with the new tool name, and renamed the cmake variable accordingly

mstorsjo retitled this revision from [clang-tidy] Add CLANG_MAKE_CONFUSABLE_TABLE cmake cache variable to avoid building when cross compiling to [clang-tidy] Add CLANG_TIDY_CONFUSABLE_CHARS_GEN cmake setting to avoid building when cross compiling.Jul 27 2022, 2:30 PM
mstorsjo edited the summary of this revision. (Show Details)
sammccall accepted this revision.Jul 28 2022, 1:57 AM
sammccall added inline comments.
clang-tools-extra/clang-tidy/misc/CMakeLists.txt
13

Should make_confusable_table and make_confusable_table_target also be renamed?

trcrsired added a subscriber: trcrsired.EditedJul 30 2022, 9:32 AM

Hi i have a question. Does llvm provide a general toggle to set all those things with a directory? It becomes unmanagable since the end of llvm 15 for Canadian compilation.

like LLVM_NATIVE_TOOL_DIR some thing like that?

BTW how to force LLVM to install all of them. It is just ridiculous why llvm does not install them by default. I need Canadian compilation all the time.

Hi i have a question. Does llvm provide a general toggle to set all those things with a directory? It becomes unmanagable since the end of llvm 15 for Canadian compilation.

like LLVM_NATIVE_TOOL_DIR some thing like that?

Not that I know of, but that would indeed be quite convenient - sounds like a good idea to me.