Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.41
 
1.42
 
MAIN:ragge:20030608182650
 
pftn.c
_>88 
 99 unsigned int offsz;
 1010 
<>11 -struct symtab *schain[MAXSCOPES];       /* sym chains for clearst */
1211 struct symtab *spname;
 1312 struct symtab *cftnsp;
<>14 -int chaintop;                           /* highest active entry */
1513 static int strunem;                     /* currently parsed member */
 1614 
 1715 struct instk {
     
 !
3129 static NODE *arrstk[10];
 3230 static int arrstkp;
 3331 
<>34 -struct symtab *relook(struct symtab *);
 35 -struct symtab * mknonuniq(int *);
3632 void fixtype(NODE *p, int class);
 3733 int fixclass(int class, TWORD type);
 3834 int falloc(struct symtab *p, int w, int new, NODE *pty);
     
 !
358354 
 359355         if (p->slevel > 0 && (p->sflags & SMASK) == SNORMAL)
 360356                 schedremove(p);
<>361 -#if 0
 362 -        {
 363 -                int l = p->slevel;
364357 
<>365 -                if( l >= MAXSCOPES )
 366 -                        cerror( "scopes nested too deep" );
 367 -
 368 -                p->snext = schain[l];
 369 -                schain[l] = p;
 370 -                if( l >= chaintop )
 371 -                        chaintop = l + 1;
 372 -        }
 373 -#endif
 374 -
375358         /* user-supplied routine to fix up new definitions */
<>376 -
377359         FIXDEF(p);
 378360 
 379361 # ifndef BUG1
     
 !
20872069         deflab(s->soffset);
 20882070 }
 20892071 
<>2090 -/*
 2091 - * look up name: must agree with s w.r.t. STAGNAME and SHIDDEN
 2092 - */
 2093 -struct symtab *
 2094 -lookup(char *name, int s)
 2095 -{
 2096 -//      char *p, *q;
 2097 -//      int i, ii;
 2098 -//      struct symtab *sp;
 2099 -
 2100 -        /* compute initial hash index */
 2101 -# ifndef BUG1
 2102 -        if (ddebug > 2)
 2103 -                printf("lookup(%s, %d), instruct=%d\n",
 2104 -                    name, s, instruct);
 2105 -# endif
 2106 -
 2107 -//      if (s == STAGNAME || s == SLBLNAME)
 2108 -                return symbol_add(name, s);
 2109 -#if 0
 2110 -        i = (int)name;
 2111 -        i = i%SYMTSZ;
 2112 -        sp = &stab[ii=i];
 2113 -
 2114 -        for (;;) { /* look for name */
 2115 -
 2116 -                if (sp->stype == TNULL) { /* empty slot */
 2117 -                        if (s & SNOCREAT)
 2118 -                                return NULL;
 2119 -//printf("creating %s (%d)\n", name, sp - stab);
 2120 -                        sp->sflags = 0;
 2121 -                        sp->sname = name;
 2122 -                        sp->stype = UNDEF;
 2123 -                        sp->sclass = SNULL;
 2124 -                        sp->s_argn = 0;
 2125 -                        return sp;
 2126 -                }
 2127 -                if ((sp->sflags & SHIDDEN) != (s & ~SNOCREAT))
 2128 -                        goto next;
 2129 -                p = sp->sname;
 2130 -                q = name;
 2131 -                if (p == q)
 2132 -                        return &stab[i];
 2133 -next:
 2134 -                if (++i >= SYMTSZ) {
 2135 -                        i = 0;
 2136 -                        sp = stab;
 2137 -                } else
 2138 -                        ++sp;
 2139 -                if (i == ii)
 2140 -                        cerror("symbol table full");
 2141 -        }
 2142 -#endif
 2143 -}
 2144 -
21452072 #ifdef PCC_DEBUG
 21462073 /* if not debugging, checkst is a macro */
 21472074 void
     
 !
21662093 }
 21672094 #endif
 21682095 
<>2169 -#if 0
 2170 -/*
 2171 - * look up p again, and see where it lies
 2172 - */
 2173 -struct symtab *
 2174 -relook(struct symtab *p)
 2175 -{
 2176 -        struct symtab *q;
 2177 -
 2178 -        q = lookup(p->sname, p->sflags&SHIDDEN);
 2179 -        /* make relook always point to either p or an empty cell */
 2180 -        if (q->stype == UNDEF) {
 2181 -                q->stype = TNULL;
 2182 -                return(q);
 2183 -        }
 2184 -        while (q != p) {
 2185 -                if (q->stype == TNULL)
 2186 -                        break;
 2187 -                if (++q >= &stab[SYMTSZ])
 2188 -                        q=stab;
 2189 -        }
 2190 -        return(q);
 2191 -}
 2192 -#endif
 2193 -
21942096 void
 21952097 clearst(int lev)
 21962098 {
<>2197 -//      struct symtab *p, *q;
21982099         int temp;
<>2199 -//      struct symtab *clist = 0;
22002100 
 22012101         temp = lineno;
 22022102         aobeg();
 22032103 
<>2204 -#if 0
 2205 -        /* step 1: remove entries */
 2206 -        while( chaintop-1 > lev ){
 2207 -                p = schain[--chaintop];
 2208 -                schain[chaintop] = 0;
 2209 -                for( ; p; p = q ){
 2210 -                        q = p->snext;
 2211 -                        if( p->stype == TNULL || p->slevel <= lev )
 2212 -                                cerror( "schain botch" );
 2213 -                        lineno = p->suse < 0 ? -p->suse : p->suse;
 2214 -                        if (p->stype==UNDEF) {
 2215 -                                lineno = temp;
 2216 -                                uerror("%s undefined", p->sname);
 2217 -                        } else
 2218 -                                aocode(p);
 2219 -//printf("removing %s (%d)\n", p->sname, p - stab);
 2220 -# ifndef BUG1
 2221 -                        if( ddebug ){
 2222 -                                printf( "removing %s", p->sname );
 2223 -                                printf( " from stab[%d], flags %o level %d\n",
 2224 -                                        p-stab, p->sflags, p->slevel);
 2225 -                                }
 2226 -# endif
 2227 -                        if( p->sflags & SHIDES )unhide( p );
 2228 -                        p->stype = TNULL;
 2229 -                        p->snext = clist;
 2230 -                        clist = p;
 2231 -                        }
 2232 -                }
 2233 -
 2234 -        /* step 2: fix any mishashed entries */
 2235 -        p = clist;
 2236 -        while( p ){
 2237 -                struct symtab *next, **t, *r;
 2238 -
 2239 -                q = p;
 2240 -                next = p->snext;
 2241 -                for(;;){
 2242 -                        if( ++q >= &stab[SYMTSZ] )q = stab;
 2243 -                        if( q == p || q->stype == TNULL )break;
 2244 -                        if( (r = relook(q)) != q ) {
 2245 -//printf("moving %d to %d\n", q - stab, r - stab);
 2246 -                                /* move q in schain list */
 2247 -                                t = &schain[(int)q->slevel];
 2248 -                                while( *t && *t != q )
 2249 -                                        t = &(*t)->snext;
 2250 -                                if( *t )
 2251 -                                        *t = r;
 2252 -                                else
 2253 -                                        cerror("schain botch 2");
 2254 -                                *r = *q;
 2255 -                                q->stype = TNULL;
 2256 -                                }
 2257 -                        }
 2258 -                p = next;
 2259 -                }
 2260 -#endif
 2261 -
22622104         symclear(lev); /* Clean ut the symbol table */
 22632105 
 22642106         lineno = temp;
 22652107         aoend();
 22662108 }
 22672109 
<>2268 -#if 0
 2269 -/*
 2270 - * Hide an earlier symbol p by creating a new one.
 2271 - * Return the new symbol.
 2272 - */
22732110 struct symtab *
<>2274 -hide(struct symtab *p)
 2275 -{
 2276 -        struct symtab *q;
 2277 -
 2278 -        for (q = p + 1; ; ++q) {
 2279 -                if (q >= &stab[SYMTSZ])
 2280 -                        q = stab;
 2281 -                if (q == p)
 2282 -                        cerror( "symbol table full" );
 2283 -                if (q->stype == TNULL)
 2284 -                        break;
 2285 -        }
 2286 -        *q = *p;
 2287 -        p->sflags |= SHIDDEN;
 2288 -        q->sflags = SHIDES;
 2289 -#if 0
 2290 -        if (p->slevel > 0)
 2291 -                werror("%s redefinition hides earlier one", p->sname);
 2292 -#endif
 2293 -# ifndef BUG1
 2294 -        if (ddebug)
 2295 -                printf("        %p hidden by %p\n", p, q);
 2296 -# endif
 2297 -        return (spname = q );
 2298 -}
 2299 -
 2300 -void
 2301 -unhide(struct symtab *p)
 2302 -{
 2303 -        struct symtab *q;
 2304 -        int s;
 2305 -
 2306 -        s = 0;
 2307 -        q = p;
 2308 -
 2309 -        for(;;){
 2310 -
 2311 -                if( q == stab ) q = &stab[SYMTSZ-1];
 2312 -                else --q;
 2313 -
 2314 -                if( q == p ) break;
 2315 -
 2316 -                if (0 == s) {
 2317 -                        if (p->sname == q->sname) {
 2318 -                                q->sflags &= ~SHIDDEN;
 2319 -# ifndef BUG1
 2320 -                                if( ddebug ) printf( "unhide uncovered %d from %d\n", q-stab,p-stab);
 2321 -# endif
 2322 -                                return;
 2323 -                                }
 2324 -                        }
 2325 -
 2326 -                }
 2327 -        cerror( "unhide fails" );
 2328 -        }
 2329 -#endif
 2330 -
 2331 -struct symtab *
<_23322111 getsymtab(char *name, int flags)
 23332112 {
 23342113         struct symtab *s;
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-18 17:45 +0200