hubert.reinterpretcast added inline comments.
================ Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5250 + if (Args.hasArg(options::OPT_mroptr) || Args.hasArg(options::OPT_mno_roptr)) { + bool HasRoptr = ---------------- qiongsiwu1 wrote: > hubert.reinterpretcast wrote: > > This only checks for `-m[no-]roptr` when the front-end is invoked. When the > > driver is used just for linking, we get no diagnostic at all for using > > these options on other platforms. > > > > @MaskRay: > > > > As Clang code owner for the Driver, are you concerned if platform-specific > > options are sometimes silently ignored on other platforms? Is there a > > better place for the diagnostic? > > > > For info, in this case, the option would have effects on AIX at both > > compile-from-C/C++ time and at link time. > > > > Also, should `-Wunused-command-line-argument` warnings be generated for > > cases where the option has no effect (e.g., `-emit-llvm` or > > `-fsyntax-only`)? I think `-flto` is a bit of an exception because it may > > be unfriendly to expect users to change other aspects of their compile > > invocations when adding `-flto`. At the same time, it can be argued instead > > that generating a `-Wunused-command-line-argument` warning for "back-end" > > options on `-flto` compiles helps the user realize that they need to > > provide the option on their link step. > > > @MaskRay May I ask for your input on this issue where platform-specific > options are silently ignored on other platforms? What is our current opinion > on where these checks/diagnostics should go? > > Thanks!! Hi @MaskRay, Thank you for your comments so far. I am particularly interested diagnostics for cases where the option does not take effect. We are hoping for a good approach to implement the diagnostic when the option is used on non-AIX platforms (without the current issue that we only check when the front-end is invoked). Additionally, I would like your opinion on whether a diagnostic is warranted for cases like `-emit-llvm` or `-fsyntax-only`. What existing command-line options are you aware of that can serve as a good design template that we can apply here? Thanks again, HT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144190/new/ https://reviews.llvm.org/D144190 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits