[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

Evgenii Kudriashov via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 26 20:01:59 PDT 2024


e-kud wrote:

> I think the specific checks clang is doing here have to be part of clang: in particular, clang needs to translate from gcc syntax to LLVM IR asm syntax, and that requires parsing the constraints. So these checks are necessary, and emitting better diagnostics for checks we need to do anyway seems fine.

Yes. But constraints are checked. The problem here is that they may conflict with features. Should this "features+constraint" combination checked in the frontend or in the backend?

I like the idea of checking it in the frontend because we may point to the specific constraint. In the backend we can point only to the whole expression or even emit a generic error without a line.

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


More information about the cfe-commits mailing list