diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 7e8e416034c..5cec9e97c6e 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -61,6 +61,14 @@ int VirtRegMap::assignVirt2StackSlot(unsigned virtReg) return frameIndex; } +void VirtRegMap::assignVirt2StackSlot(unsigned virtReg, int frameIndex) +{ + assert(MRegisterInfo::isVirtualRegister(virtReg)); + assert(v2ssMap_[virtReg] == NO_STACK_SLOT && + "attempt to assign stack slot to already spilled register"); + v2ssMap_[virtReg] = frameIndex; +} + void VirtRegMap::virtFolded(unsigned virtReg, MachineInstr* oldMI, MachineInstr* newMI) diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index c4188bcfbcd..e9bfe76d4bf 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -97,6 +97,7 @@ namespace llvm { } int assignVirt2StackSlot(unsigned virtReg); + void assignVirt2StackSlot(unsigned virtReg, int frameIndex); void virtFolded(unsigned virtReg, MachineInstr* oldMI,