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

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 11:16:02 PDT 2024


================
@@ -461,50 +461,62 @@ void AsmPrinter::PrintSymbolOperand(const MachineOperand &MO, raw_ostream &OS) {
   printOffset(MO.getOffset(), OS);
 }
 
+void AsmPrinter::diagnoseAsmOperandError(LLVMContext &C,
+                                         const AsmOperandErrorCode ErrCode,
+                                         const char *AsmStr,
+                                         const uint64_t Loc) {
+  std::string msg;
+  raw_string_ostream Msg(msg);
+  Msg << "invalid operand in inline asm: '" << AsmStr << "'";
+  C.emitError(Loc, Msg.str());
+}
 /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
----------------
jrtc27 wrote:

```suggestion

/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
```

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


More information about the llvm-commits mailing list