The getConstraintRegister method is used by semantic checking of inline assembly statements in order to diagnose conflicts between clobber list and input/output lists. By overriding getConstraintRegister we get those diagnostics and we match RISC-V GCC's behavior. The implementation is trivial due to the lack of single-register RISC-V-specific constraints.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/Sema/inline-asm-validate-riscv.c | ||
---|---|---|
27–28 | I don't really understand the point of erroring-out in these two cases where the register is an input and is also clobbered. In fact, I've run into a case where that would be useful and accurately reflected the situation. But GCC's documentation explicitly prohibits that. I'm not sure if there's a fundamental reason for that, or if it's just an implementation quirk. |
I don't really understand the point of erroring-out in these two cases where the register is an input and is also clobbered. In fact, I've run into a case where that would be useful and accurately reflected the situation. But GCC's documentation explicitly prohibits that. I'm not sure if there's a fundamental reason for that, or if it's just an implementation quirk.