Move duplicated AddLiveIn function from X86 and ARM backends to be a method

in the MachineFunction class, renaming it to addLiveIn for consistency with
the same method in MachineBasicBlock.  Thanks for Anton for suggesting this.

llvm-svn: 69615
This commit is contained in:
Bob Wilson
2009-04-20 18:36:57 +00:00
parent 958d5eb032
commit f8b85477ae
4 changed files with 23 additions and 30 deletions

View File

@@ -385,6 +385,16 @@ MachineFunction& MachineFunction::get(const Function *F)
return *mc;
}
/// addLiveIn - Add the specified physical register as a live-in value and
/// create a corresponding virtual register for it.
unsigned MachineFunction::addLiveIn(unsigned PReg,
const TargetRegisterClass *RC) {
assert(RC->contains(PReg) && "Not the correct regclass!");
unsigned VReg = getRegInfo().createVirtualRegister(RC);
getRegInfo().addLiveIn(PReg, VReg);
return VReg;
}
/// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given
/// source file, line, and column. If none currently exists, create a new
/// DebugLocTuple, and insert it into the DebugIdMap.