\section{Library initialization}

Before you can start using the facilities of the [[machine]] library,
the library must initialize some parts of itself.  In SUIF, this is
performed by defining an [[init_]]\emph{libname} routine.

<<machine library initialization>>=
extern "C" void init_machine(SuifEnv* suif_env);
@


We also use the initialization header file as a gathering place for
defining string constants used in Machine SUIF.  These string constants
include those used as the names for annotations.  You should consult the
indicated section, when appropriate, to learn about the meaning and use
of these string constants.

<<machine string constants>>=
extern IdString k_target_lib;		// see contexts.h.nw
extern IdString k_target_type_ptr;	// see types.h.nw
extern IdString k_generic_types;	// see types.h.nw
extern IdString k_enable_exceptions;	// see codegen.cc
extern IdString k_stack_frame_info;	// see codegen.h.nw

extern IdString k_empty_string;		// I.e. "" (used for defaults)

extern IdString k_history;		// Note listing compilation history
extern IdString k_line;			// Note flagging .line directive

extern IdString k_comment;		// Note containing comment text
extern IdString k_mbr_index_def;	//   "   marking mbr table-index calc.
extern IdString k_instr_mbr_tgts;	//   "   containing mbr targets
extern IdString k_instr_opcode;		//   "   for generic-instr opcode_name
extern IdString k_instr_opcode_exts;	//   "   for opcode extensions
extern IdString k_proc_entry;		//   "   marking procedure entry pt.
extern IdString k_regs_used;		//   "   giving regs used at call
extern IdString k_regs_defd;		//   "   giving regs def'd at call
extern IdString k_instr_ret;		//   "	 marking return instruction
extern IdString k_incomplete_proc_exit;	//   "   marking incomplete proc exit
extern IdString k_header_trailer;	//   "   on instruction added by fin
extern IdString k_builtin_args;		//   "   giving args for builtin "call"
extern IdString k_param_reg;		//   "   giving hard reg for parameter
extern IdString k_vr_count;		//   "   giving unit's virtual-reg count
extern IdString k_stdarg_offset;	//   "   giving unnamed-arg frame offset

extern IdString k_const;                // keyword "const"

extern IdString k_dense;		// NatSetNote tag
extern IdString k_dense_inverse;	//     "       "
extern IdString k_sparse;		//     "       "
extern IdString k_sparse_inverse;	//     "       "

extern IdString k_call_target;		// Note attaching target symbol to call
@

The [[machine]] library initialization header has the following
layout:

<<init.h>>=
/* file "machine/init.h" */

<<Machine-SUIF copyright>>

#ifndef MACHINE_INIT_H
#define MACHINE_INIT_H

#include <machine/copyright.h>

#ifndef SUPPRESS_PRAGMA_INTERFACE
#pragma interface "machine/init.h"
#endif

#include <machine/substrate.h>

<<machine library initialization>>

<<machine string constants>>

#endif /* MACHINE_INIT_H */
@
