TableGen : Difference between CodeEmitter and InstrInfo

Hello All,

I have created a file Instr.td which describes instructions for a new assembly language.I would like to create a new TableGen Backend by using either of the two mentioned above backends so that i am able to retrieve (print ,at least ) some info about the instructions such as Modifier list,Constraints etc . I am confused between the above 2 backend’s and find them very similar.

1)Can please know the difference between the two , as they seem very similar
2)Which one will be the better backend to use to solve my above described problem?

-Thanks

In short, InstrInfo generates information about instructions (properties, etc) that is relevant to "MachineInstr". This information contains data that the codegen passes use. I'm assuming that by CodeEmitter you mean the MC code emitter. MC refers to "machine code, i.e. the instructions encoded into the binary form. This is used to emit the final code into an object file.
Normally a new LLVM target will need both sets of data, but if you are only implementing an assembler, you may get away without having to generate the "instr info" part.

-Krzysztof