Usage of clang::driver::options::DriverOption (-Xarch_ & gcc toolchain)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Usage of clang::driver::options::DriverOption (-Xarch_ & gcc toolchain)

David Chisnall via cfe-dev
Currently, DriverOption is used in two places to decide whether an option

(a) ... can follow -Xarch_* (HIP: C++ Heterogeneous-Compute Interface for Portability)
   or -Xarch_i386/-Xarch_x86_64 (Darwin)
(b) ... can be forwarded to GCC (in clang/lib/Driver/ToolChains/Gnu.cpp
   clang::driver::tools::gcc::Common::ConstructJob)

The two use cases seem very different. For (b), is
clang::driver::tools::gcc::Common, I guess it may historically have more use
cases but nowadays it seems to be only used by some bare metal like drivers to
construct linker command lines. Is my understanding correct?

If yes, should we instead mark a list of options which should be forwarded to GCC
for linking (not too few, but much fewer than the options not marked as
DriverOption).  I think such options can be found in the *link section of gcc -dumpspecs's output.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev