TSFlags in AsmBackend

Hello LLVM,
I'd like to check TSFlags in my AsmBackend code. However AsmBackend
objects don't have a reference to MCInstrInfo, which is the only way
I've seen to reach TSFlags. A quickie grep shows that none of the
existing targets check TSFlags in their AsmBackends. Is there any
reason I shouldn't check TSFlags in AsmBackend? If not, what's the
best way to go about it?

Not clean but you could add something like this in your AsmBackend:

namespace llvm {
extern const MCInstrDesc XInsts[];
static const MCInstrDesc &getInstDesc(unsigned Opcode) {
return XInsts[Opcode];
(replace X with your target)

TSFlags will be in MCInstrDesc

Thanks, Francois. Your answer was very helpful and worked fine.
After some experimenting, I wrapped your approach inside a XMCInst()
class defined like so:

namespace llvm {
  class XMCInst : public MCInst {
    const MCInstrDesc& getInstrDesc() const;

Now, anywhere I have an MCInst I can static_cast to XMCInst and get
the MCInstrDesc.

Best Regards,