This is an archive of the discontinued LLVM Phabricator instance.

[libc][NFC] Clean up clang-tidy warnings for `src/__support` and `src/math`.
ClosedPublic

Authored by lntue on Mar 14 2023, 7:52 AM.

Details

Summary

Clean up some warnings from running libc-lint for these folders.

Diff Detail

Event Timeline

lntue created this revision.Mar 14 2023, 7:52 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 14 2023, 7:52 AM
lntue requested review of this revision.Mar 14 2023, 7:52 AM
lntue updated this revision to Diff 505118.Mar 14 2023, 8:31 AM

Include exp2f.cpp.

This revision is now accepted and ready to land.Mar 15 2023, 11:02 AM

Do you have any resolution on the const local variable naming convention?

lntue updated this revision to Diff 505623.Mar 15 2023, 2:19 PM

Update .clang-tidy rules for local constant cases to accept both lower_case and
UPPER_CASE.

lntue added a comment.Mar 15 2023, 2:20 PM

Do you have any resolution on the const local variable naming convention?

I've updated clang-tidy rules to accept both lower_case and UPPER_CASE for local constants.

sivachandra added inline comments.Mar 15 2023, 3:02 PM
libc/.clang-tidy
12

Why is this (and two more below) changed?

23

I suppose that if you don't add these, then the VariableCase complains about UPPER_CASE names. But, once you add this LocalConstantCase, it complains about const function args also and so you have to add LocalConstantIgnoredRegexp?

lntue updated this revision to Diff 505637.Mar 15 2023, 3:16 PM

Simplify the LocalConstant rules a bit.

libc/.clang-tidy
12

These will make the rule a bit stricter by preventing trailing _'s in the names.

23

I didn't look at VariableCase. I guess I could simplify this a bit by using LocalConstantIngoredRegexp to allow UPPER_CASE, and using VariableCase for lower_case.

sivachandra added inline comments.Mar 15 2023, 3:21 PM
libc/.clang-tidy
23

We already have VariableCase above on line 13, no?

lntue added inline comments.Mar 15 2023, 3:31 PM
libc/.clang-tidy
23

Yes, that's why I removed LocalConstantCase and changed LocalConstantIgnoredRegexp to allow UPPER_CASE instead.

sivachandra accepted this revision.Mar 15 2023, 3:35 PM
sivachandra added inline comments.
libc/.clang-tidy
23

Ah, you mean't you did not "notice" VariableCase.

libc/src/math/generic/log10.cpp