The offloading toolchain makes heavy use of options beginning with
--o. This is problematic when combined with the joined -o flag. In
the following situation, the user will not get the expected output and
will not notice as the expected output will still be written.
clang++ -x cuda foo.cu -offload-arch=sm_80 -o foo
This patch introduces a warning that checks for joined -o arguments
that would also be a valid driver argument if an additional - were
added. I believe this situation is uncommon enough to warrant a warning,
and can be trivially fixed by the end user by using the more common
separate form instead.
This looks for all 1-symbol mismatches. and may trigger on differences other than --option vs -option. E.g. if user passes -oip-link (which looks like something we may see in real life), we'll try to find the nearest for --oip-link and will get a distance-1 match for the existing option --hip-link.
We may need to verify that the nearest match that we've found is indeed due to a missing leading dash.