URL
https://opencores.org/ocsvn/c16/c16/trunk
[/] [c16/] [trunk/] [compiler/] [Node.cc] - Diff between revs 2 and 7
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 7 |
Line 244... |
Line 244... |
assert(funname);
|
assert(funname);
|
Backend::new_function(funname);
|
Backend::new_function(funname);
|
|
|
int ret_size = ret_type->GetSize();
|
int ret_size = ret_type->GetSize();
|
if (ret_size <= 4) ret_size = 0; // return value in register
|
if (ret_size <= 4) ret_size = 0; // return value in register
|
ret_size += 2; // call return address
|
ret_size += 2; // return address
|
|
|
ParameterDeclarationList * pdl = ::GetParameters(fun_declarator);
|
ParameterDeclarationList * pdl = ::GetParameters(fun_declarator);
|
|
|
int offset = ret_size;
|
int offset = ret_size;
|
for (ParameterDeclarationList * p = pdl; p; p = p->Tail())
|
for (ParameterDeclarationList * p = pdl; p; p = p->Tail())
|
Line 256... |
Line 256... |
ParameterDeclaration * pd = p->Head();
|
ParameterDeclaration * pd = p->Head();
|
assert(pd);
|
assert(pd);
|
offset += pd->AllocateParameters(offset);
|
offset += pd->AllocateParameters(offset);
|
}
|
}
|
|
|
const int autosize = body->EmitAutovars(out);
|
|
|
|
body->Emit(out);
|
body->Emit(out);
|
Backend::ret(autosize);
|
|
EmitEnd(out);
|
|
|
|
|
Backend::ret();
|
Name::RemoveAuto();
|
Name::RemoveAuto();
|
}
|
}
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
void InitDeclarator::Emit(FILE * out)
|
void InitDeclarator::Emit(FILE * out)
|
{
|
{
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.