This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][NFC] Cleanup: silence warnings on unused variables.
ClosedPublic

Authored by AndreyChurbanov on Jul 22 2021, 3:29 PM.

Details

Summary

Put declarations/definitions of unused variables under corresponding macros to silence clang warnings.

Diff Detail

Event Timeline

AndreyChurbanov requested review of this revision.Jul 22 2021, 3:29 PM
hbae accepted this revision.Jul 29 2021, 1:02 PM

LGTM

This revision is now accepted and ready to land.Jul 29 2021, 1:02 PM
This revision was landed with ongoing or failed builds.Jul 30 2021, 7:05 AM
This revision was automatically updated to reflect the committed changes.

i don’t understand why you find this set of changes preferable to decorating some variable declarations with attribute((unused))

i don’t understand why you find this set of changes preferable to decorating some variable declarations with attribute((unused))

I feel this is pretty tricky to declare a variable unused in a portable way in general. Some compilers don't accept the attribute.

Note also that the variables are actually used in some builds and not used in a other builds (debug/release, Linux/Windows, etc.),
and conditions are different for different variables.