This is an archive of the discontinued LLVM Phabricator instance.

Fix `-Wsuggest-override` warning when building benchmark with clang-cl on Windows
AbandonedPublic

Authored by SibiSiddharthan on Apr 29 2021, 6:11 AM.

Details

Summary

This patch adds '-Wno-suggest-override' flag to clang-cl.

Currently this flag gets added in the else() block for compilers
other than MSVC. Since CMake evaluates if(MSVC) true for clang-cl
this flag does not get added.

Let me know if it would be better if we move the
if(CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG) block outside if(MSVC).

Diff Detail

Event Timeline

SibiSiddharthan requested review of this revision.Apr 29 2021, 6:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2021, 6:11 AM

For benchmark modifications, we do (see README.md) we typically patch upstream and mention the change here while patching. Is this change something that has been committed to upstream or is this the modification that you came up with yourself?

For benchmark modifications, we do (see README.md) we typically patch upstream and mention the change here while patching. Is this change something that has been committed to upstream or is this the modification that you came up with yourself?

This change has not been committed upstream and I came up with it myself (similar to lines 166-168). I would prefer if that snippet would be moved outside the if(MSVC) block.
Since this is my first commit to the project I wanted to project this issue and suggest a suitable fix for it.

Thank You

kbobyrev requested changes to this revision.Jun 28 2021, 12:07 AM

Hey! If you're still interested in landing it, please make sure to land it into the upstream first and mention the revision here.

This revision now requires changes to proceed.Jun 28 2021, 12:07 AM

Hey! If you're still interested in landing it, please make sure to land it into the upstream first and mention the revision here.

Hey, I have a question. When you say upstream do you mean here https://github.com/google/benchmark ?
If so, do I have to raise a pull request there and reference it here?. I do see that the benchmark under the llvm-project has changes that are not present in https://github.com/google/benchmark

Hey! If you're still interested in landing it, please make sure to land it into the upstream first and mention the revision here.

Hey, I have a question. When you say upstream do you mean here https://github.com/google/benchmark ?

Correct, upstream means the main benchmark repo.

If so, do I have to raise a pull request there and reference it here?.

The process looks as follows: you can open a PR in there, have it approved and landed in the main branch. Then you have the https://github.com/google/benchmark/commit/<YOUR_COMMIT_HASH> and you insert it into the Phabricator revision description, also mentioning it in the file where we have all the modifications.

I do see that the benchmark under the llvm-project has changes that are not present in https://github.com/google/benchmark

Yeah, this is unfortunately true but it isn't really a good practice :( If you open a PR and nobody looks into that and it doesn't get merged reasonably fast then it'd be OK to just land the change here, but I would be happy if you could open a PR. If there won't be any response from the maintainers in several days, we'll just land this here.

Hey! If you're still interested in landing it, please make sure to land it into the upstream first and mention the revision here.

Hey, I have a question. When you say upstream do you mean here https://github.com/google/benchmark ?

Correct, upstream means the main benchmark repo.

If so, do I have to raise a pull request there and reference it here?.

The process looks as follows: you can open a PR in there, have it approved and landed in the main branch. Then you have the https://github.com/google/benchmark/commit/<YOUR_COMMIT_HASH> and you insert it into the Phabricator revision description, also mentioning it in the file where we have all the modifications.

I do see that the benchmark under the llvm-project has changes that are not present in https://github.com/google/benchmark

Yeah, this is unfortunately true but it isn't really a good practice :( If you open a PR and nobody looks into that and it doesn't get merged reasonably fast then it'd be OK to just land the change here, but I would be happy if you could open a PR. If there won't be any response from the maintainers in several days, we'll just land this here.

FWIW i think all such PR's have been merged within hours of being opened.
Tides may change once said library starts depending on abseil though.

Hi there,

Looks like this issue has been fixed now by another commit. Closing this PR.

Thanks

SibiSiddharthan abandoned this revision.Dec 17 2021, 2:02 PM