[AsmWriter] Don't crash when printing addrspace and the operand is null
authorVasileios Porpodas <vporpodas@google.com>
Mon, 9 Jan 2023 23:18:55 +0000 (15:18 -0800)
committerVasileios Porpodas <vporpodas@google.com>
Tue, 10 Jan 2023 23:14:25 +0000 (15:14 -0800)
commit3531c41168e01bf1750b436036c9b9db7e8ee5d5
tree704e4d0da1732dc7918d495596c4f2779abae2be
parent4089c28370fed96e208acbd08e680601d4b7377b
[AsmWriter] Don't crash when printing addrspace and the operand is null

This helps print instructions with detached operands in the debugger.

Differential Revision: https://reviews.llvm.org/D141343
llvm/lib/IR/AsmWriter.cpp
llvm/unittests/IR/AsmWriterTest.cpp