static void
emitRegularMap (memmap * map, bool addPublics, bool arFlag)
{
- symbol *sym;
+ symbol *sym, *symIval;
ast *ival = NULL;
+ memmap *segment;
if (addPublics)
{
(sym->_isparm && !IS_REGPARM (sym->etype))) &&
addPublics &&
!IS_STATIC (sym->etype) &&
- (sym->used || sym->fbody))
+ (IS_FUNC(sym->type) ? (sym->used || sym->fbody) : 1))
{
addSetHead (&publics, sym);
}
it is a global variable */
if (sym->ival && sym->level == 0)
{
-
- if (IS_AGGREGATE (sym->type))
+ if (IS_AGGREGATE (sym->type)) {
ival = initAggregates (sym, sym->ival, NULL);
- else
+ } else {
ival = newNode ('=', newAst_VALUE (symbolVal (sym)),
decorateType (resolveSymbols (list2expr (sym->ival))));
+ }
codeOutFile = statsg->oFile;
allocInfo = 0;
// set ival's lineno to where the symbol was defined
- ival->lineno=sym->lineDef;
+ if (ival) ival->lineno=sym->lineDef;
eBBlockFromiCode (iCodeFromAst (ival));
allocInfo = 1;
+
+ /* if the ival was a symbol, delete it from its segment */
+ if (IS_AST_SYM_VALUE(sym->ival->init.node)) {
+ symIval=AST_SYMBOL(sym->ival->init.node);
+ segment = SPEC_OCLS (symIval->etype);
+ deleteSetItem (&segment->syms, symIval);
+ }
sym->ival = NULL;
}
}
void
_printPointerType (FILE * oFile, const char *name)
{
- if (TARGET_IS_DS390)
+ /* if (TARGET_IS_DS390) */
+ if (options.model == MODEL_FLAT24)
{
fprintf (oFile, "\t.byte %s,(%s >> 8),(%s >> 16)", name, name, name);
}
applyToSet (tmpfileNameSet, rmTmpFiles);
}
+#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+void
+rm_tmpfiles (void)
+{
+ applyToSet (tmpfileSet, closeTmpFiles);
+ applyToSet (tmpfileNameSet, rmTmpFiles);
+}
+#endif
+
/** Creates a temporary file a'la tmpfile which avoids the bugs
in cygwin wrt c:\tmp.
Scans, in order: TMP, TEMP, TMPDIR, else uses tmpfile().