aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-29 20:38:05 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-29 20:38:05 +0000
commit38af59a43c4176d8f34bd26faeb18b23080a1d9b (patch)
tree35e64515ac254af24873d46270f04a95969f54c7 /lib
parentf174cc303ba0f37ceaed75c3ea751ebd0fb3a4cd (diff)
downloadexternal_llvm-38af59a43c4176d8f34bd26faeb18b23080a1d9b.zip
external_llvm-38af59a43c4176d8f34bd26faeb18b23080a1d9b.tar.gz
external_llvm-38af59a43c4176d8f34bd26faeb18b23080a1d9b.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp8
-rw-r--r--lib/CodeGen/VirtRegMap.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 7e8e416..5cec9e9 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 c4188bc..e9bfe76 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,