[llvm] r204320 - [mips] Splitting up class definition from implementation.

Matheus Almeida Matheus.Almeida at imgtec.com
Thu Mar 20 12:59:45 PDT 2014


> Anonymous namespaces in headers is not a good idea.
Thanks for the advice.

> Why the split? Will this be used for another .cpp file?
Possibly[1]. In Mips there are two ELF sections that capture the register usage for a translation unit (.reginfo and .Mips.option [kind = ODK_REGINFO]).
One of our ideas is to subclass MCELFStreamer and override EmitInstruction. We can then inspect the register operands for the instruction that is about to be emitted and based on the register classes [and encoding values], we should be able to tell the physical registers used. I was planning to use the MCInstrInfo class from the code emitter(accessible from MCELFStreamer)  and from there I could access the instruction description(MCInstrDesc) and that would give us the register classes I need. Too many indirections, isn't it ? 
I just realized that there's a better way because there's a global array (defined in TargetGenInstrInfo.inc) that defines the instruction description for each opcode. =] That definitely simplifies a couple of things...

[1] I was going to say "yes" but I realized midway my reply that there's another way of doing what I was trying to achieve...

Regards,
Matheus
________________________________________
From: Rafael EspĂ­ndola [rafael.espindola at gmail.com]
Sent: 20 March 2014 18:29
To: Matheus Almeida
Cc: llvm-commits
Subject: Re: [llvm] r204320 - [mips] Splitting up class definition from implementation.

> +namespace {

Anonymous namespaces in headers is not a good idea.

Why the split? Will this be used for another .cpp file?

Cheers,
Rafael



More information about the llvm-commits mailing list