From d79c58c29d6bd1a6a540ee9d6b51a13d0bb17969 Mon Sep 17 00:00:00 2001 From: sandeep Date: Tue, 8 Feb 2000 06:50:04 +0000 Subject: [PATCH] 1) SDCC_(target) new preprocessor define added 2) variables being allocated to xstack in large model without --use-xstack option git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@87 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCmain.c | 7 ++++++- src/SDCCsymt.c | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/SDCCmain.c b/src/SDCCmain.c index fbf69c0a..12d340da 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -116,7 +116,7 @@ char *preOutName; #define OPTION_NOREGPARMS "-noregparms" static const char *_preCmd[] = { - "sdcpp", "-version", "-Wall", "-lang-c++", "-DSDCC=1", + "sdcpp", "-Wall", "-lang-c++", "-DSDCC=1", "-I" SDCC_INCLUDE_DIR, "$l", "$1", "$2", NULL }; @@ -1083,6 +1083,7 @@ static void assemble (char **envp) static int preProcess (char **envp) { char *argv[128]; + char procDef[128]; preOutName = NULL; @@ -1100,6 +1101,10 @@ static int preProcess (char **envp) else _addToList(preArgv, "-DSDCC_MODEL_SMALL"); + /* add port (processor information to processor */ + sprintf(procDef,"-DSDCC_%s",port->target); + _addToList(preArgv,procDef); + if (!preProcOnly) preOutName = strdup(tmpnam(NULL)); diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index e34bad43..037bf479 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -963,6 +963,8 @@ static void checkSClass ( symbol *sym ) ( SPEC_SCLS(sym->etype) != S_AUTO && SPEC_SCLS(sym->etype) != S_FIXED && SPEC_SCLS(sym->etype) != S_REGISTER && + SPEC_SCLS(sym->etype) != S_STACK && + SPEC_SCLS(sym->etype) != S_XSTACK && SPEC_SCLS(sym->etype) != S_CONSTANT )) { werror(E_AUTO_ASSUMED,sym->name) ; @@ -1005,10 +1007,10 @@ static void checkSClass ( symbol *sym ) /* the storage class to reflect where the var will go */ if ( sym->level && SPEC_SCLS(sym->etype) == S_FIXED) { if ( options.stackAuto || (currFunc && IS_RENT(currFunc->etype))) - SPEC_SCLS(sym->etype) = (options.model ? + SPEC_SCLS(sym->etype) = (options.useXstack ? S_XSTACK : S_STACK ) ; else - SPEC_SCLS(sym->etype) = (options.model ? + SPEC_SCLS(sym->etype) = (options.useXstack ? S_XDATA :S_DATA ) ; } } -- 2.47.2