[llvm] [CodeGen] Enhance inline asm constraint diagnostics (PR #101354)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 17:49:17 PDT 2024


================
@@ -5034,7 +5034,8 @@ class TargetLowering : public TargetLoweringBase {
   /// returns a register number of 0 and a null register class pointer.
   virtual std::pair<unsigned, const TargetRegisterClass *>
   getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
-                               StringRef Constraint, MVT VT) const;
+                               StringRef Constraint, MVT VT,
+                               std::string &ErrMsg) const;
----------------
e-kud wrote:

I like the idea of `SmallString`. `Error` and `StringError`, they consist of `std::string` and additionally have a return code that we don't have use of.

Ok, since there aren't strong points for using something like `Expected`, I'll continue with returning an error message by reference.



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


More information about the llvm-commits mailing list