From: Alkis Evlogimenos Date: Sat, 29 May 2004 20:38:05 +0000 (+0000) Subject: Add method to assign stack slot to virtual register without creating a X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=38af59a43c4176d8f34bd26faeb18b23080a1d9b;p=oota-llvm.git Add method to assign stack slot to virtual register without creating a new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13895 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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,