Gyoji Compiler
Loading...
Searching...
No Matches
Classes
Gyoji::mir Namespace Reference

Middle intermediate representation (MIR) of a translation unit. More...

Classes

class  Argument
 Function argument. More...
 
class  BasicBlock
 Basic block of a function. More...
 
class  Function
 Function inside a translation unit. More...
 
class  FunctionArgument
 A single named argument to a function. More...
 
class  Functions
 Container for functions. More...
 
class  MIR
 The middle-tier intermediate representation (MIR) of a translation unit. More...
 
class  Operation
 Operations inside basic blocks, the virtual instruction-set of the MIR. More...
 
class  OperationArrayIndex
 This subclass of OperationBinary represents indexing an array. More...
 
class  OperationBinary
 This subclass of Operation represents a binary operation. More...
 
class  OperationCast
 This subclass of OperationUnary represents a cast operation. More...
 
class  OperationDot
 This subclass of Operation is used to access member variables of classes and other aggregate types by reference. More...
 
class  OperationFunctionCall
 Function call (invoke) operation. More...
 
class  OperationJump
 Unconditional Jump. More...
 
class  OperationJumpConditional
 This operation represents a conditional jump. More...
 
class  OperationLiteralBool
 Literal bool. More...
 
class  OperationLiteralChar
 Literal character. More...
 
class  OperationLiteralFloat
 Literal float. More...
 
class  OperationLiteralInt
 Literal integer. More...
 
class  OperationLiteralNull
 Literal null. More...
 
class  OperationLiteralString
 Literal string. More...
 
class  OperationLocalDeclare
 Declare a local variable in scope. More...
 
class  OperationLocalUndeclare
 Un-declare a variable (remove it from scope) More...
 
class  OperationLocalVariable
 Load a local variable. More...
 
class  OperationReturn
 Return from a function with a value. More...
 
class  OperationReturnVoid
 Return from a function without a value. More...
 
class  OperationSizeofType
 The operation for obtaining the storage size of a type. More...
 
class  OperationSymbol
 Symbol-table lookup. More...
 
class  OperationUnary
 This subclass of Operation represents a unary operation. More...
 
class  Symbol
 A symbol defined globally inside a namespace. More...
 
class  Symbols
 Symbol table for the intermediate representation (MIR) More...
 
class  Type
 This represents a type as declared in a translation unit. More...
 
class  TypeMember
 This represents a typed member variable of a class. More...
 
class  TypeMethod
 Method of a class. More...
 
class  Types
 Set of types extracted from a translation unit. More...
 

Detailed Description

Middle intermediate representation (MIR) of a translation unit.

The types namespace is used to extract and resolve types from the syntax tree.

The MIR is an intermediate representation of a source program. It contains no syntax information and just enough context from the source-code that any errors can be traced back to the source-code for quality error reporting.

The purpose of the MIR is to provide a representation that is at a low enough level that a code-generator such as LLVM can be used to emit assembly, while remaining high-level enough that we can perform analysis and reasoning about the semantics such as implementing a borrow checker.

The MIR consists of two primary components. The first are the Types which represent logical layouts of data. The second are Functions which represent operations that manipulate data (in types).

The purpose of the MIR is to provide a consistent view of the intermediate representation of each of these things together as a unit because many operations like code-generation and analysis rely on them being paired and consistent.

The purpose of this namespace is to process the synax tree and extract the types of objects that will be used later in the compilation and code generation.

This consists of several data types representing the type system as well as a set of classes and functions intended to construct the type information by processing a TranslationUnit.

Type processing may encounter errors where objects are defined incorrectly or types cannot be properly resolved. In these cases, errors may be reported to the error handling system so that the programmer is aware of why the definition or resolution did not succeed.