[PATCH] D97066: [MC] Diagnose MCContext errors using LLVMContext handler

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 11:18:31 PST 2021


rnk added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineModuleInfo.cpp:172-173
 
+  if (Context.hadError())
+    TheModule->getContext().emitError("MC error");
+
----------------
This doesn't seem like a great user experience. Won't we get two errors, something like the following?
```
error: lds: unsupported initializer for address space
error: MC error
```

It seems worth adding an LLVMContext API to mark errors as having been reported another way if we don't have plans to unify MCContext / LLVMContext error reporting in the short term.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97066/new/

https://reviews.llvm.org/D97066



More information about the llvm-commits mailing list