mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Added class MachineCodeForMethod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7ad1046065
commit
1d6158f98f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user