This is an archive of the discontinued LLVM Phabricator instance.

Utilize comparison operation implemented in APInt
ClosedPublic

Authored by SimplyDanny on Mar 27 2022, 7:42 AM.

Diff Detail

Event Timeline

SimplyDanny created this revision.Mar 27 2022, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2022, 7:43 AM
SimplyDanny requested review of this revision.Mar 27 2022, 7:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2022, 7:43 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Mar 28 2022, 5:42 AM

LGTM! Can you also add a release note for the fix?

I'm happy to land this on your behalf if you'd prefer, but given that you've had several quality commits already, you might want to consider asking for your commit privileges: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access.

This revision is now accepted and ready to land.Mar 28 2022, 5:42 AM

LGTM! Can you also add a release note for the fix?

I'm happy to land this on your behalf if you'd prefer, but given that you've had several quality commits already, you might want to consider asking for your commit privileges: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access.

Thank you for the review and the recommendation to become a committer! I have just been granted the privileges and have landed the change on the main branch including a mention of the fix in the release notes. I hope this is all right.

LGTM! Can you also add a release note for the fix?

I'm happy to land this on your behalf if you'd prefer, but given that you've had several quality commits already, you might want to consider asking for your commit privileges: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access.

Thank you for the review and the recommendation to become a committer! I have just been granted the privileges and have landed the change on the main branch including a mention of the fix in the release notes. I hope this is all right.

Congrats!

I double-checked the commit and everything looks correct to me. Thanks for the fix!

Note that __int128_t is not available everywhere, generally only on 64-bit platforms.

clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
175

This causes test failures on 32-bit architectures:

/home/tcwg-buildbot/worker/clang-armv7-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/Output/bugprone-sizeof-expression.cpp.tmp.cpp:175:11: error: unknown type name '__int128_t' [clang-diagnostic-error]
template <__int128_t N> 
          ^

It's probably best to wrap this in #ifdef __SIZEOF_INT128__ lest we disable the entire test on the affected platforms.

dyung added a subscriber: dyung.Mar 29 2022, 1:54 AM
aaron.ballman added inline comments.Mar 29 2022, 4:06 AM
clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
175

Good catch! @SimplyDanny, can you fix up the test?

SimplyDanny added inline comments.Mar 29 2022, 8:42 AM
clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
175

Sure. I will fix it. Sorry for the issue ...

What is the process in this case? Push the fix directly to main or go the normal path via Phabricator review?

aaron.ballman added inline comments.Mar 29 2022, 8:48 AM
clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
175

When fixing a broken test, you can generally push directly to main. (And if the fix requires thought, it's usually best to revert the broken commit from main until you have the test fixed, then push the fixed commit back to main).

SimplyDanny marked 3 inline comments as done.Mar 29 2022, 9:02 AM
SimplyDanny added inline comments.
clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
175

Done. Fix is here.