[Next] [Previous] [Up] [Top]

2 Building Your Program

2.2 Running the compiler

2.2.1 Typical compiler session

Vortex normally runs interactively, reading and executing user commands. The prompt (for instance, Cecil>) depends on the language currently being compiled. The notation Cecil> some_command indicates that some_command (followed by pressing the return key) is typed at the compiler prompt. Compiler commands appear in boldface, and % is used as a sample Unix shell prompt.

To compile a new program (say, myprog.cecil) run a make command which specifies the name of your program: Cecil> make myprog.cecil. The make command parses the file named myprog.cecil and any files transitively included by this file, constructs global data structures describing the program (e.g., the object inheritance graph and the table of defined methods), produces Phase-1"compiled" (C++ or assembly) code for the application in the gen directory (which is created if necessary), and then invokes a Phase-2 make*1 to compile the intermediate files into .o files and link the .o files into a target executable, gen/myprog. The generated executable can be run either from a UNIX prompt or by typing run at the Vortex prompt.

Once a program has been compiled, further invocations of the make command (the program name is optional after the first time) incrementally recompile only files that changed (or depend on a changed file).

The save command writes the program checkpoint to a file named program.db. The checkpoint contains a snapshot of the application's source code, the interprocedural information computed by the compiler, and recompilation dependencies, as well as the current settings of the Vortex compiler's options. At this point, it is safe to quit Vortex by typing the quit command. (really_quit skips asking for confirmation.)

To reload a program's checkpoint file, use the load program.db command. The compiler's state is restored to where it was at the point of the previous save, permitting more incremental development to proceed. If you do not load a checkpoint file, the first make command will perform a full non-incremental compilation.

2.2.2 Start-up Commands

Upon startup, Vortex searches for a file named .vortexrc first in the current directory, then in the user's home directory. Each line is executed as if it were typed at the Vortex prompt. If the line contains the # symbol, the part of the line between the first # and the end of the line is ignored. For example, if you want Vortex to load the program's checkpoint upon startup, you can create a .vortexrc containing the following lines:

	# put this .vortexrc in the directory where you start the compiler
load myprog.db
After .vortexrc is processed (if found), any command-line arguments are processed in order. Each command-line argument is executed as if it were typed at the Cecil> prompt.

For example, Vortex can compile a program in batch mode when invoked as follows:

% vortex "load myprog.db" make save really_quit

2.2.3 Compiler commands

This section describes the major Vortex compiler commands. The following notation is used:

More commands are described in Sections
2.3, 2.4, and 2.5. You can get a complete list of commands and their brief descriptions by entering the help command. Multiple commands separated by semicolons can be given on the same line.

A string typed at the Vortex prompt is interpreted as follows. If it starts with a word that matches one of the compiler commands, such as make, that command is executed. Otherwise, if the first word matches an option name, such as optimize, the value of the option is modified (section 2.4 describes options). Otherwise, the string is evaluated as a Cecil expression (section 4 describes the evaluator). If the evaluator does not recognize the string as a valid expression, it reports an error.

2.2.1 - Typical compiler session
2.2.2 - Start-up Commands
2.2.3 - Compiler commands

How to Use the Vortex Compiler - 20 JAN 97
[Next]