Rename trampoline to wrappedcall everywhere

This commit is contained in:
Lauri Kasanen
2017-05-18 16:00:04 +03:00
parent 7feced8862
commit f6fa74a636
7 changed files with 55 additions and 55 deletions

View File

@@ -58,7 +58,7 @@
#include "scanner.h" #include "scanner.h"
#include "standard.h" #include "standard.h"
#include "symtab.h" #include "symtab.h"
#include "trampoline.h" #include "wrappedcall.h"
#include "typeconv.h" #include "typeconv.h"
@@ -1316,8 +1316,8 @@ static FuncDesc* ParseFuncDecl (void)
{ {
unsigned Offs; unsigned Offs;
SymEntry* Sym; SymEntry* Sym;
SymEntry* Trampoline; SymEntry* WrappedCall;
unsigned char TrampolineData; unsigned char WrappedCallData;
/* Create a new function descriptor */ /* Create a new function descriptor */
FuncDesc* F = NewFuncDesc (); FuncDesc* F = NewFuncDesc ();
@@ -1383,11 +1383,11 @@ static FuncDesc* ParseFuncDecl (void)
/* Leave the lexical level remembering the symbol tables */ /* Leave the lexical level remembering the symbol tables */
RememberFunctionLevel (F); RememberFunctionLevel (F);
/* Did we have a trampoline for this function? */ /* Did we have a WrappedCall for this function? */
GetTrampoline((void **) &Trampoline, &TrampolineData); GetWrappedCall((void **) &WrappedCall, &WrappedCallData);
if (Trampoline) { if (WrappedCall) {
F->Trampoline = Trampoline; F->WrappedCall = WrappedCall;
F->TrampolineData = TrampolineData; F->WrappedCallData = WrappedCallData;
} }
/* Return the function descriptor */ /* Return the function descriptor */
@@ -1471,13 +1471,13 @@ static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode)
Qualifiers &= ~T_QUAL_FASTCALL; Qualifiers &= ~T_QUAL_FASTCALL;
} }
/* Was there a previous entry? If so, copy trampoline info from it */ /* Was there a previous entry? If so, copy WrappedCall info from it */
PrevEntry = FindGlobalSym (D->Ident); PrevEntry = FindGlobalSym (D->Ident);
if (PrevEntry && PrevEntry->Flags & SC_FUNC) { if (PrevEntry && PrevEntry->Flags & SC_FUNC) {
FuncDesc* D = PrevEntry->V.F.Func; FuncDesc* D = PrevEntry->V.F.Func;
if (D->Trampoline && !F->Trampoline) { if (D->WrappedCall && !F->WrappedCall) {
F->Trampoline = D->Trampoline; F->WrappedCall = D->WrappedCall;
F->TrampolineData = D->TrampolineData; F->WrappedCallData = D->WrappedCallData;
} }
} }

View File

@@ -536,8 +536,8 @@ static void FunctionCall (ExprDesc* Expr)
/* Special handling for function pointers */ /* Special handling for function pointers */
if (IsFuncPtr) { if (IsFuncPtr) {
if (Func->Trampoline) { if (Func->WrappedCall) {
Warning("Calling a trampolined function via a pointer, trampoline will not be used"); Warning("Calling a wrapped function via a pointer, wrapped-call will not be used");
} }
/* If the function is not a fastcall function, load the pointer to /* If the function is not a fastcall function, load the pointer to
@@ -588,12 +588,12 @@ static void FunctionCall (ExprDesc* Expr)
} else { } else {
/* Normal function */ /* Normal function */
if (Func->Trampoline) { if (Func->WrappedCall) {
char tmp[64]; char tmp[64];
StrBuf S = AUTO_STRBUF_INITIALIZER; StrBuf S = AUTO_STRBUF_INITIALIZER;
/* Store the trampoline data in tmp4 */ /* Store the WrappedCall data in tmp4 */
sprintf(tmp, "ldy #%u", Func->TrampolineData); sprintf(tmp, "ldy #%u", Func->WrappedCallData);
SB_AppendStr (&S, tmp); SB_AppendStr (&S, tmp);
g_asmcode (&S); g_asmcode (&S);
SB_Clear(&S); SB_Clear(&S);
@@ -625,7 +625,7 @@ static void FunctionCall (ExprDesc* Expr)
SB_Done (&S); SB_Done (&S);
g_call (TypeOf (Expr->Type), Func->Trampoline->Name, ParamSize); g_call (TypeOf (Expr->Type), Func->WrappedCall->Name, ParamSize);
} else { } else {
g_call (TypeOf (Expr->Type), (const char*) Expr->Name, ParamSize); g_call (TypeOf (Expr->Type), (const char*) Expr->Name, ParamSize);
} }

View File

@@ -60,8 +60,8 @@ FuncDesc* NewFuncDesc (void)
F->ParamCount = 0; F->ParamCount = 0;
F->ParamSize = 0; F->ParamSize = 0;
F->LastParam = 0; F->LastParam = 0;
F->Trampoline = 0; F->WrappedCall = 0;
F->TrampolineData = 0; F->WrappedCallData = 0;
/* Return the new struct */ /* Return the new struct */
return F; return F;

View File

@@ -67,8 +67,8 @@ struct FuncDesc {
unsigned ParamCount; /* Number of parameters */ unsigned ParamCount; /* Number of parameters */
unsigned ParamSize; /* Size of the parameters */ unsigned ParamSize; /* Size of the parameters */
struct SymEntry* LastParam; /* Pointer to last parameter */ struct SymEntry* LastParam; /* Pointer to last parameter */
struct SymEntry* Trampoline; /* Pointer to the trampoline */ struct SymEntry* WrappedCall; /* Pointer to the WrappedCall */
unsigned char TrampolineData; /* The trampoline's user data */ unsigned char WrappedCallData; /* The WrappedCall's user data */
}; };

View File

@@ -51,7 +51,7 @@
#include "scanstrbuf.h" #include "scanstrbuf.h"
#include "symtab.h" #include "symtab.h"
#include "pragma.h" #include "pragma.h"
#include "trampoline.h" #include "wrappedcall.h"
@@ -468,7 +468,7 @@ static void WrappedCallPragma (StrBuf* B)
break; break;
case PP_POP: case PP_POP:
PopTrampoline(); PopWrappedCall();
/* Done */ /* Done */
goto ExitPoint; goto ExitPoint;
@@ -511,7 +511,7 @@ static void WrappedCallPragma (StrBuf* B)
/* Check if the name is valid */ /* Check if the name is valid */
if (Entry && Entry->Flags & (SC_FUNC | SC_STORAGE)) { if (Entry && Entry->Flags & (SC_FUNC | SC_STORAGE)) {
PushTrampoline(Entry, Val); PushWrappedCall(Entry, Val);
Entry->Flags |= SC_REF; Entry->Flags |= SC_REF;
} else { } else {

View File

@@ -1,8 +1,8 @@
/*****************************************************************************/ /*****************************************************************************/
/* */ /* */
/* trampoline.c */ /* wrappedcall.c */
/* */ /* */
/* Trampoline management */ /* WrappedCall management */
/* */ /* */
/* */ /* */
/* */ /* */
@@ -44,7 +44,7 @@
/* cc65 */ /* cc65 */
#include "codeent.h" #include "codeent.h"
#include "error.h" #include "error.h"
#include "trampoline.h" #include "wrappedcall.h"
@@ -53,8 +53,8 @@
/*****************************************************************************/ /*****************************************************************************/
/* Trampolines */ /* WrappedCalls */
static IntPtrStack Trampolines; static IntPtrStack WrappedCalls;
@@ -64,39 +64,39 @@ static IntPtrStack Trampolines;
void PushTrampoline (void *Ptr, unsigned char Val) void PushWrappedCall (void *Ptr, unsigned char Val)
/* Push the current trampoline */ /* Push the current WrappedCall */
{ {
if (IPS_IsFull (&Trampolines)) { if (IPS_IsFull (&WrappedCalls)) {
Error ("Trampoline stack overflow"); Error ("WrappedCall stack overflow");
} else { } else {
IPS_Push (&Trampolines, Val, Ptr); IPS_Push (&WrappedCalls, Val, Ptr);
} }
} }
void PopTrampoline (void) void PopWrappedCall (void)
/* Remove the current trampoline */ /* Remove the current WrappedCall */
{ {
if (IPS_GetCount (&Trampolines) < 1) { if (IPS_GetCount (&WrappedCalls) < 1) {
Error ("Trampoline stack is empty"); Error ("WrappedCall stack is empty");
} else { } else {
IPS_Drop (&Trampolines); IPS_Drop (&WrappedCalls);
} }
} }
void GetTrampoline (void **Ptr, unsigned char *Val) void GetWrappedCall (void **Ptr, unsigned char *Val)
/* Get the current trampoline */ /* Get the current WrappedCall */
{ {
if (IPS_GetCount (&Trampolines) < 1) { if (IPS_GetCount (&WrappedCalls) < 1) {
*Ptr = NULL; *Ptr = NULL;
*Val = 0; *Val = 0;
} else { } else {
long Temp; long Temp;
IPS_Get (&Trampolines, &Temp, Ptr); IPS_Get (&WrappedCalls, &Temp, Ptr);
*Val = Temp; *Val = Temp;
} }
} }

View File

@@ -1,8 +1,8 @@
/*****************************************************************************/ /*****************************************************************************/
/* */ /* */
/* trampoline.h */ /* wrappedcall.h */
/* */ /* */
/* Trampoline management */ /* Wrapped-call management */
/* */ /* */
/* */ /* */
/* */ /* */
@@ -30,8 +30,8 @@
#ifndef TRAMPOLINE_H #ifndef WRAPPEDCALL_H
#define TRAMPOLINE_H #define WRAPPEDCALL_H
@@ -50,16 +50,16 @@
void PushTrampoline (void *Ptr, unsigned char Val); void PushWrappedCall (void *Ptr, unsigned char Val);
/* Push the current trampoline */ /* Push the current WrappedCall */
void PopTrampoline (void); void PopWrappedCall (void);
/* Pop the current trampoline */ /* Pop the current WrappedCall */
void GetTrampoline (void **Ptr, unsigned char *Val); void GetWrappedCall (void **Ptr, unsigned char *Val);
/* Get the current trampoline, if any */ /* Get the current WrappedCall, if any */
/* End of trampoline.h */ /* End of wrappedcall.h */
#endif #endif