<div dir="ltr">Hi,<div>I am writing a register renaming pass for loops. I want to printout livein variables at a specific basic block and find a registerset A = target register - livein regs.</div><div>I am using the following code</div><div><div><br></div><div>for (MachineBasicBlock::livein_iterator LI = mb->livein_begin(), E = mb->livein_end(); LI != E; ++LI){</div><div> const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo();<br></div><div> errs() << ' ' << PrintReg(*LI, TRI);<span class="" style="white-space:pre"> </span><br></div></div><div><span class="" style="white-space:pre">}</span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">but I get the following error:</span></div><div><span class=""><span style="white-space:pre">error: member access into incomplete type 'const llvm::TargetMachine'
const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo();
^
/home/lab154/fateme/LLVM/llvm-3.7/include/llvm/CodeGen/MachineOperand.h:31:7: note: forward declaration of 'llvm::TargetMachine'
class TargetMachine;</span><br></span></div><div><span class=""><span style="white-space:pre"><br></span></span></div><div><span style="white-space:pre">So what is the correct way to access TRI? </span></div><div><span style="white-space:pre">Also, I know that ARM has 13 GPRs </span><span style="white-space:pre">(r0-r12)</span><span style="white-space:pre">. but how to get this from the code?</span></div><div><span style="white-space:pre">I am sorry if my questions are stupid, but spend a lot of time on them and did not find the solution.</span></div><div><span style="white-space:pre"><br></span></div><div><span style="white-space:pre">Regards,</span></div><div><span style="white-space:pre">Fami</span></div></div>