New long option --static-locals
git-svn-id: svn://svn.cc65.org/cc65/trunk@85 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
c59aa8ffdf
commit
7329d4acb3
5 changed files with 19 additions and 6 deletions
|
@ -53,7 +53,7 @@ unsigned char InlineStdFuncs = 0; /* Inline some known functions */
|
|||
unsigned char EnableRegVars = 0; /* Enable register variables */
|
||||
unsigned char AllowRegVarAddr = 0; /* Allow taking addresses of register vars */
|
||||
unsigned char RegVarsToCallStack= 0; /* Save reg variables on call stack */
|
||||
unsigned char LocalsAreStatic = 0; /* Make local variables static */
|
||||
unsigned char StaticLocals = 0; /* Make local variables static */
|
||||
unsigned char SignedChars = 0; /* Make characters signed by default */
|
||||
unsigned char Verbose = 0; /* Verbose flag */
|
||||
unsigned char AddSource = 0; /* Add source lines as comments */
|
||||
|
|
|
@ -70,7 +70,7 @@ extern unsigned char InlineStdFuncs; /* Inline some known functions *
|
|||
extern unsigned char EnableRegVars; /* Enable register variables */
|
||||
extern unsigned char AllowRegVarAddr; /* Allow taking addresses of register vars */
|
||||
extern unsigned char RegVarsToCallStack; /* Save reg variables on call stack */
|
||||
extern unsigned char LocalsAreStatic; /* Make local variables static */
|
||||
extern unsigned char StaticLocals; /* Make local variables static */
|
||||
extern unsigned char SignedChars; /* Make characters signed by default */
|
||||
extern unsigned char Verbose; /* Verbose flag */
|
||||
extern unsigned char AddSource; /* Add source lines as comments */
|
||||
|
|
|
@ -245,7 +245,7 @@ void DeclareLocals (void)
|
|||
if (SymbolSC & (SC_AUTO | SC_REGISTER)) {
|
||||
|
||||
/* Auto variable */
|
||||
if (LocalsAreStatic == 0) {
|
||||
if (StaticLocals == 0) {
|
||||
|
||||
/* Change SC in case it was register */
|
||||
SymbolSC = (SymbolSC & ~SC_REGISTER) | SC_AUTO;
|
||||
|
|
|
@ -117,6 +117,7 @@ static void Usage (void)
|
|||
" --help\t\tHelp (this text)\n"
|
||||
" --include-dir dir\tSet an include directory search path\n"
|
||||
" --signed-chars\tDefault characters are signed\n"
|
||||
" --static-locals\tMake local variables static\n"
|
||||
" --target sys\t\tSet the target system\n"
|
||||
" --verbose\t\tIncrease verbosity\n"
|
||||
" --version\t\tPrint the compiler version number\n",
|
||||
|
@ -330,6 +331,14 @@ static void OptSignedChars (const char* Opt, const char* Arg)
|
|||
|
||||
|
||||
|
||||
static void OptStaticLocals (const char* Opt, const char* Arg)
|
||||
/* Place local variables in static storage */
|
||||
{
|
||||
StaticLocals = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void OptTarget (const char* Opt, const char* Arg)
|
||||
/* Set the target system */
|
||||
{
|
||||
|
@ -363,13 +372,14 @@ int main (int argc, char* argv[])
|
|||
{
|
||||
/* Program long options */
|
||||
static const LongOpt OptTab[] = {
|
||||
{ "--add-source", 0, OptAddSource },
|
||||
{ "--add-source", 0, OptAddSource },
|
||||
{ "--ansi", 0, OptAnsi },
|
||||
{ "--cpu", 1, OptCPU },
|
||||
{ "--debug-info", 0, OptDebugInfo },
|
||||
{ "--help", 0, OptHelp },
|
||||
{ "--include-dir", 1, OptIncludeDir },
|
||||
{ "--signed-chars", 0, OptSignedChars },
|
||||
{ "--static-locals", 0, OptStaticLocals },
|
||||
{ "--target", 1, OptTarget },
|
||||
{ "--verbose", 0, OptVerbose },
|
||||
{ "--version", 0, OptVersion },
|
||||
|
@ -440,8 +450,11 @@ int main (int argc, char* argv[])
|
|||
while (*P) {
|
||||
switch (*P++) {
|
||||
case 'l':
|
||||
LocalsAreStatic = 1;
|
||||
OptStaticLocals (Arg, 0);
|
||||
break;
|
||||
default:
|
||||
UnknownOption (Arg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -180,7 +180,7 @@ void DoPragma (void)
|
|||
break;
|
||||
|
||||
case PR_STATICLOCALS:
|
||||
FlagPragma (&LocalsAreStatic);
|
||||
FlagPragma (&StaticLocals);
|
||||
break;
|
||||
|
||||
case PR_ZPSYM:
|
||||
|
|
Loading…
Add table
Reference in a new issue