aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-10-22 13:51:33 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-10-22 13:51:33 +0000
commit1d6158f98fb46ccf86af8285f066c8a513e453c5 (patch)
tree9e563edf7b2e1b0918ff7eb6e9c8fd83b08991ce /lib/CodeGen/MachineInstr.cpp
parent7ad104606557f7b46035556da4d912ad87792290 (diff)
downloadexternal_llvm-1d6158f98fb46ccf86af8285f066c8a513e453c5.zip
external_llvm-1d6158f98fb46ccf86af8285f066c8a513e453c5.tar.gz
external_llvm-1d6158f98fb46ccf86af8285f066c8a513e453c5.tar.bz2
Added class MachineCodeForMethod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 2ec791f..b4f275d 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -176,7 +176,45 @@ operator<<(ostream &os, const MachineOperand &mop)
void
-PrintMachineInstructions(const Method *const method)
+MachineCodeForMethod::putLocalVarAtOffsetFromFP(const Value* local,
+ int offset,
+ unsigned int size)
+{
+ offsetsFromFP[local] = offset;
+ incrementAutomaticVarsSize(size);
+}
+
+
+void
+MachineCodeForMethod::putLocalVarAtOffsetFromSP(const Value* local,
+ int offset,
+ unsigned int size)
+{
+ offsetsFromSP[local] = offset;
+ incrementAutomaticVarsSize(size);
+}
+
+
+int
+MachineCodeForMethod::getOffsetFromFP(const Value* local) const
+{
+ hash_map<const Value*, int>::const_iterator pair = offsetsFromFP.find(local);
+ assert(pair != offsetsFromFP.end() && "Offset from FP unknown for Value");
+ return (*pair).second;
+}
+
+
+int
+MachineCodeForMethod::getOffsetFromSP(const Value* local) const
+{
+ hash_map<const Value*, int>::const_iterator pair = offsetsFromSP.find(local);
+ assert(pair != offsetsFromSP.end() && "Offset from SP unknown for Value");
+ return (*pair).second;
+}
+
+
+void
+MachineCodeForMethod::dump() const
{
cout << "\n" << method->getReturnType()
<< " \"" << method->getName() << "\"" << endl;