[LLVMdev] getInstructionName() in XXXGenAsmWriter.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Mar 30 15:33:08 PDT 2012


On Mar 30, 2012, at 3:12 PM, Benjamin Kramer <benny.kra at googlemail.com> wrote:

> 
> On 30.03.2012, at 23:30, Jakob Stoklund Olesen wrote:
> 
>> Is this function required?
>> 
>> MCInstrInfo::getName(OpCode) returns the same string, and we have two copies of the string table now.
>> 
>> Can MCInstrPrinter refer to MCInstrInfo, and why not?
> 
> I looked into this at some point and if my memory serves me correctly using MCInstrInfo in the printer would create a cyclic dependency between the libXXXAsmPrinter and libXXXDesc for the target. I guess libXXXDesc could be refactored not to depend on libXXXAsmPrinter but I haven't checked what exactly uses it.

I thought it was something like that.

The AsmPrinter wouldn't need to depend on the XXXMCTargetDesc library, though. It just needs an MCInstrInfo pointer. It already has an MCRegisterInfo pointer.

The regIsInRegisterClass() function also looks like it is identical to MCRegisterClass::contains(). It it even used anywhere?

/jakob




More information about the llvm-dev mailing list