1) SDCC_(target) new preprocessor define added
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 8 Feb 2000 06:50:04 +0000 (06:50 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 8 Feb 2000 06:50:04 +0000 (06:50 +0000)
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
src/SDCCsymt.c

index fbf69c0ac70884d5f25b0b7ea4d5a13aa724e813..12d340dad22a6450ebb45e738899dcf584493f96 100644 (file)
@@ -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));
 
index e34bad43b2d1cf0ce34103cc77a7425da8dfb618..037bf4792230936ca69d6e586f9757d63c185455 100644 (file)
@@ -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 ) ;
     }
 }