[clang] [Clang] Diagnose apply AST consume actions on LLVM IR (PR #88602)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 09:12:24 PDT 2024


https://github.com/AaronBallman approved this pull request.

LGTM!

> I still have some questions, should we give tips to the user that which options cannot apply on LLVM IR files?

I think the diagnostic you've got is reasonable -- these options are CC1 options which are not something we typically expect users to specify themselves.

> Do we have any precedent or design principles for dealing with mutually exclusive options?

When they're cc1 only options, we basically just don't want to cause crashes or assertions. If they're driver options, we want to issue reasonable diagnostics to help the user identify what the issue is so they know how to resolve it (and ideally, we'd document the mutual exclusion explicitly in the user's manual).

CC @jansvoboda11 as options code owner

https://github.com/llvm/llvm-project/pull/88602


More information about the cfe-commits mailing list