Glossary - common terms used in fbc development

arg, argument
An expression passed to a parameter in a procedure call.

A type cast changes the compile-time data type of an expression and either causes a conversion (e.g. float <-> int) or a reinterpretation of the expression value's bit representation (e.g. integer <-> uinteger).

comp, compound
conv, conversion
A conversion is an operation that translates between two different representations of the same value (e.g. float <-> int, or 32bit <-> 64bit).
cast and conv are often used interchangeably in the compiler sources. For example, the AST's CONV nodes represent type casts, no matter whether they perform conversions or not.
Some (but not all) casts require run-time conversions, for example:
short <-> integer
single <-> integer
single <-> double
Simple casts between types of equal class and size do not require a run-time conversion, because the bit representation wouldn't change anyways. For example:
short <-> ushort
integer <-> uinteger
These are also called noconv casts.

ctor, constructor
ctx, context
UDTs/"classes" in the fbc sources for holding global information shared amongst multiple procedures or modules.

desc, descriptor
dtor, destructor
FB compile-time information, also see objinfo.

FB graphics, usually referring to the use of FB's built-in graphics keywords, implemented in gfxlib2

frontend stage 1
Compilation of the .bas input files into the next intermediate format: .asm (-gen gas), .c (-gen gcc) or .ll (-gen llvm)

frontend stage 2
Compilation of the .c (-gen gcc) or .ll (-gen llvm) intermediate files into .asm files. (doesn't apply to -gen gas because there the FB compiler generates .asm itself directly)

A procedure with result value; sometimes also used in place of procedure, as in C.

The FB graphics runtime library implementation from the fbc project.

A hash table, often used together with a symbol table to allow fast lookup of the symbols in that symbol table.

libfb, libfbmt, libfbgfx, libfbgfxmt
Names of the libraries built from the rtlib/gfxlib2 sources. Libraries named lib*mt are the thread-safe versions of their lib* counterparts. They are built with the ENABLE_MT #define.

noconv cast
A cast that does not require a conversion.

normal build
Described here: Normal vs. Standalone

param, parameter
Procedure parameters as declared in procedure DECLARE statements or bodies.

For each parameter, the compiler will create a corresponding local variable in the procedure's scope, allowing the parameters to be accessed by user code.

proc, procedure
Any sub or function, including constructors/destructors, operator overloads, property setters/getters.

standalone build
Described here: Normal vs. Standalone

struct, structure
TYPE or UNION, also known as struct/union in C.

A procedure without result (with VOID result).

A symbol table: owns a linked list of FBSYMBOL in a specific scope. This is where FBSYMBOLs live.

The FB runtime library implementation from the fbc project

UDT, user-defined type
TYPEs/UNIONs/ENUMs, sometimes just TYPEs/UNIONs.

Virtual registers are used when emitting the AST. The AST creates a vreg for the operands and results of all operations that make up the input program. Each backend emits them differently:
  • The ASM backend actually maps the vregs to real registers and also re-uses them as they become free again. The vregs then also let the x86 code emitter know which exact registers are used.
  • The C backend sometimes emits vregs as temporary variables, sometimes simply inserts the expression whose result is represented by a vreg in place of that vreg's first use.
  • The LLVM backend simply emits each vreg as a numbered intermediate value.
Since the C/LLVM backends don't re-use vregs, the vregs are almost in static-single-assignment form; although not quite because there still are self-operations etc. produced by the AST which don't take SSA form into account.

Back to FreeBASIC Developer Information

Back to Table of Contents
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki phatcode