[llvm] Add diagnostic help for inline asm operand constraint 'H' (PR #88248)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 06:57:28 PDT 2024


================
@@ -528,6 +528,20 @@ class InlineAsm final : public Value {
   }
 };
 
+/// Inline Asm specifies input & output constraint which can
+/// specifiy target specific criteria for operand. If this criteria
+/// does not match, we must throw error.
+/// NO_ERROR represents Operand constraints are valid/applicable
+/// OPERAND_ERROR represents some constraint(unspecified) failed
+/// UNKNOWN_MODIFIER_ERROR represents use of unknown char constraint
+/// CONSTRAINT_<char>_ERROR represents error regarding constraint.
+enum class AsmOperandErrorCode {
+  NO_ERROR = 0,
+  OPERAND_ERROR,
+  UNKNOWN_MODIFIER_ERROR,
+  CONSTRAINT_H_ERROR,
----------------
arsenm wrote:

The constraint H seems too specific. Why not just let this be an arbitrary string carried by Error? 

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


More information about the llvm-commits mailing list