[llvm] llvm-mc: Error on MCSubtargetInfo construction failure (PR #159226)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 22:02:49 PDT 2025


arsenm wrote:

> Can you add a test to llvm/test/tools/llvm-mc?

Short answer is no

> ```
> % llvm-mc -triple=xxx
> llvm-mc: error: unable to get target for 'xxx', see --version and --triple.
> ```

This is a different error for the top level target machine. There is no current in tree example where the subtarget constructor will return nullptr (but it probably should be a failable method that returns with error messages). Currently this would only trigger on partially implemented targets 

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


More information about the llvm-commits mailing list