[llvm-dev] How to access Target Register Info?

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 29 12:00:02 PDT 2016


On 4/29/2016 1:44 PM, fateme Hoseini via llvm-dev wrote:
>
> for (MachineBasicBlock::livein_iterator LI = mb->livein_begin(), E =
> mb->livein_end(); LI != E; ++LI){
>       const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo();
>       errs() << ' ' << PrintReg(*LI,  TRI);
> }
>

TargetRegisterInfo is now in the TargetSubtargetInfo.  So you need to do
   auto *TRI = MF.getSubtarget<yourtarget>().getRegisterInfo();

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list