#include "cmdline.h"
#include "mmodel.h"
#include "print.h"
+#include "scopedefs.h"
#include "strbuf.h"
#include "target.h"
#include "tgttrans.h"
/* Write the export list */
WriteExports ();
- /* Write the scopes if requested */
- WriteScopes ();
-
/* Write debug symbols if requested */
WriteDbgSyms ();
+ /* Write the scopes if requested */
+ WriteScopes ();
+
/* Write line infos if requested */
WriteLineInfos ();
/* Initialize the include search paths */
InitIncludePaths ();
+ /* Create the predefined segments */
+ SegInit ();
+
/* Enter the base lexical level. We must do that here, since we may
* define symbols using -D.
*/
- SymEnterLevel (&GlobalNameSpace, ST_GLOBAL, ADDR_SIZE_DEFAULT, 0);
+ SymEnterLevel (&GlobalNameSpace, SCOPE_FILE, ADDR_SIZE_DEFAULT, 0);
/* Initialize the line infos. Must be done here, since we need line infos
* for symbol definitions.
SetMemoryModel (MMODEL_NEAR);
}
- /* Initialize the segments */
- InitSegments ();
+ /* Set the default segment sizes according to the memory model */
+ SetSegmentSizes ();
/* Initialize the scanner, open the input file */
InitScanner (InFile);
CheckPseudo ();
}
- /* If we didn't have any errors, check the unnamed labels */
+ /* If we didn't have any errors, check and cleanup the unnamed labels */
if (ErrorCount == 0) {
- ULabCheck ();
+ ULabDone ();
}
/* If we didn't have any errors, check the symbol table */
SymCheck ();
}
+ /* If we didn't have any errors, close the file scope lexical level */
+ if (ErrorCount == 0) {
+ SymLeaveLevel ();
+ }
+
/* If we didn't have any errors, check and resolve the segment data */
if (ErrorCount == 0) {
- SegCheck ();
+ SegDone ();
}
- /* If we didn't have any errors, check the assertions */
+ /* If we didn't have any errors, check the assertions */
if (ErrorCount == 0) {
CheckAssertions ();
}
- /* If we didn't have an errors, index the line infos */
- MakeLineInfoIndex ();
-
/* Dump the data */
if (Verbosity >= 2) {
SymDump (stdout);
SegDump ();
}
+ /* If we didn't have an errors, finish off the line infos */
+ DoneLineInfo ();
+
/* If we didn't have any errors, create the object, listing and
* dependency files
*/