This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget][NFC] Remove constexpr to hide warnings
ClosedPublic

Authored by jhuber6 on Feb 14 2022, 11:05 AM.

Details

Summary

Currently whenever we compile the device runtime we get the following
'Mapping.cpp:32:32: warning: inline function '_OMP::impl::getGridValue'
is not defined [-Wundefined-inline]' warning. This can be silenced by
removing the constexpr attribute for this function. Doing this doesn't
change the generated bitcode at all but prevents the screen from getting
filled with warnings whenver we build the runtime.

Diff Detail

Event Timeline

jhuber6 requested review of this revision.Feb 14 2022, 11:05 AM
jhuber6 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 11:05 AM
This revision is now accepted and ready to land.Feb 14 2022, 12:33 PM
This revision was automatically updated to reflect the committed changes.
JonChesterfield added a comment.EditedFeb 14 2022, 1:59 PM

Nvm, saw the commit message

This is a variant thing iiuc. Can we fix the warning without losing the O0 compile time constant by defining a non-variant version of this function?

Nvm, saw the commit message

This is a variant thing iiuc. Can we fix the warning without losing the O0 compile time constant by defining a non-variant version of this function?

Says so in the commit message Mapping.cpp:32:32: warning: inline function '_OMP::impl::getGridValue' is not defined [-Wundefined-inline]. I'm not sure why it happened here. Might be some weird interaction with variant or something, I just wanted to stop getting these warnings every time I built the runtime and this was the easiest way.