This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] Allow white spcaes in OMP_TARGET_OFFLOAD value
ClosedPublic

Authored by hbae on May 4 2023, 12:28 PM.

Details

Summary

Remove heading/trailing white spaces when matching OMP_TARGET_OFFLOAD
value.

Diff Detail

Event Timeline

hbae created this revision.May 4 2023, 12:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 12:28 PM
hbae requested review of this revision.May 4 2023, 12:28 PM

Do we trim any other option? I am confused by this.

hbae added a comment.May 9 2023, 1:01 PM

Do we trim any other option? I am confused by this.

Some options have their own logic to skip white spaces, but not all option values are handled like that.

So, your question is why we don't do this for other options?

@jdoerfert , to reiterate what @hbae said, the trimming functionality is there for almost all (if not all) the environment variable parsing routines. It's seen mostly with the SKIP_WS() macro and manual manipulations of char* next, scan. The kmp_trimmed_str_t is supposed to just make it a bit simpler, especially for the case of a one-token environment variable. Is it the way the trimming is performed that you don't like?

jdoerfert accepted this revision.Jun 5 2023, 1:46 PM

typo: spcaes

LG, all I tried to say is that we should be consistent across env vars. Accepting whitespaces around stuff is probably the right choice.

This revision is now accepted and ready to land.Jun 5 2023, 1:46 PM