[llvm-commits] [RFC] Patch 1/3 for the native code compiler of Erlang
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu May 3 07:52:56 PDT 2012
On May 3, 2012, at 3:27 AM, Yiannis Tsiouris wrote:
> Let me see if I get this right:
>
> I would need to use a MachineInstr pointer in order to get the Calling
> convention; something like:
>
>> const MachineBasicBlock * MBB = MI->getParent();
>> const MachineFunction * MF = MBB->getParent();
>
> and then do:
>
>> MF->getCallingConv() == CallingConv::HiPE
>
> Is this what you were thinking?
Yes, except the MI part was a thinko. It should just be an MF reference:
virtual const TargetRegisterClass *getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const;
> Furthermore, to do this properly I should change the interface of
> getPointerRegClass target hook in all Targets and the usage of it by
> changing TRI->getPointerRegClass() wherever needed, right?
Yes, and it looks like you will have to add the same MF argument to TargetInstrInfo::getRegClass().
If you find any places that call TII->getRegClass() without having an MF reference available, we may have to find a different solution.
/jakob
More information about the llvm-commits
mailing list