lab.ch

Declarations

Public Only
ModuleType
Publicenum
enum ModuleType { File, ObjFile, CPPFile, CFile, Directory }
PackageKind
Publicenum
enum PackageKind { Library, Application }
Module
Publicinterface
interface Module
getType
Publicfunction
func getType(self : &Module) : ModuleType
getScopeName
Publicfunction
func getScopeName(self : &Module) : string_view
getName
Publicfunction
func getName(self : &Module) : string_view
getBitcodePath
Publicfunction
func getBitcodePath(self : &Module) : string_view
setBitcodePath
Publicfunction
func setBitcodePath(self : &Module, path : &string_view) : void
getObjectPath
Publicfunction
func getObjectPath(self : &Module) : string_view
setObjectPath
Publicfunction
func setObjectPath(self : &Module, path : &string_view) : void
getLlvmIrPath
Publicfunction
func getLlvmIrPath(self : &Module) : string_view
setLlvmIrPath
Publicfunction
func setLlvmIrPath(self : &Module, path : &string_view) : void
getAsmPath
Publicfunction
func getAsmPath(self : &Module) : string_view
setAsmPath
Publicfunction
func setAsmPath(self : &Module, path : &string_view) : void
LabJobType
Publicenum
enum LabJobType { Executable, ProcessingOnly, Library, JITExecutable, ToCTranslation, ToChemicalTranslation, CBI }
LabJobStatus
Publicenum
enum LabJobStatus { Pending, Launched, Success, Failure }
OutputMode
Publicenum
enum OutputMode { Debug, DebugComplete, DebugQuick, ReleaseFast, ReleaseSmall, ReleaseSafe }
LabJob
Publicinterface
interface LabJob
getType
Publicfunction
func getType(self : &LabJob) : LabJobType
getName
Publicfunction
func getName(self : &LabJob) : string_view
getAbsPath
Publicfunction
func getAbsPath(self : &LabJob) : string_view
getBuildDir
Publicfunction
func getBuildDir(self : &LabJob) : string_view
getStatus
Publicfunction
func getStatus(self : &LabJob) : LabJobStatus
getTargetTriple
Publicfunction
func getTargetTriple(self : &LabJob) : string_view
getMode
Publicfunction
func getMode(self : &LabJob) : OutputMode
getTarget
Publicfunction
func getTarget(self : &LabJob) : &TargetData
LabJobCBI
Publicstruct
struct LabJobCBI : LabJob
CBIFunctionType
Publicenum
enum CBIFunctionType { ReplacementNode, SymResDeclareTopLevelNode, InitializeLexer, SymResLinkSignatureValue, ParseMacroValue, SymResLinkSignatureNode, ParseMacroNode, ParseMacroTopLevelNode, ParseMacroMemberNode, SymResNode, SymResValue, ReplacementNodeDeclare, ReplacementValue, SemanticTokensPut, FoldingRangesPut, TransformerMain }
DependencySymbolInfo
Publicstruct
struct DependencySymbolInfo { var symbols : span<ImportSymbol> var alias : string_view var location : u64 }
ModuleDependency
Publicstruct
struct ModuleDependency { var module : *Module var info : *DependencySymbolInfo }
ConflictResolutionStrategy
Publicenum
enum ConflictResolutionStrategy { Default, OverridePrevious, PreferNewerVersion, PreferOlderVersion, RaiseError, KeepPrevious }
BuildContext
Publicinterface
interface BuildContext
getAnnotationController
Publicfunction
func getAnnotationController(self : &BuildContext) : *AnnotationController
new_package
Publicfunction
func new_package(self : &BuildContext, type : ModuleType, package_kind : PackageKind, scope_name : &string_view, name : &string_view, dependencies : span<ModuleDependency>) : *Module
set_module_symbol_info
Publicfunction
func set_module_symbol_info(self : &BuildContext, module : *Module, index : uint, info : &DependencySymbolInfo) : void
get_cached
Publicfunction
func get_cached(self : &BuildContext, job : *LabJob, scope_name : &string_view, name : &string_view) : *Module
set_cached
Publicfunction
func set_cached(self : &BuildContext, job : *LabJob, module : *Module) : void
add_path
Publicfunction
func add_path(self : &BuildContext, module : *Module, path : &string_view) : void
add_dependency
Publicfunction
func add_dependency(self : &BuildContext, job : *LabJob, module : *Module, info : *DependencySymbolInfo) : void
add_module
Publicfunction
func add_module(self : &BuildContext, job : *LabJob, module : *Module) : void
adds the module to given job (as a dependency)
put_job_before
Publicfunction
func put_job_before(self : &BuildContext, newJob : *LabJob, existingJob : *LabJob) : void
put the given before the existing job, so it is done before it
add_compiler_interface
Publicfunction
func add_compiler_interface(self : &BuildContext, module : *Module, interface : &string_view) : bool
adds the given compiler interface to the module
resolve_condition
Publicfunction
func resolve_condition(self : &BuildContext, job : *LabJob, condition : &string_view) : bool
include_header
Publicfunction
func include_header(self : &BuildContext, module : *Module, header : &string_view) : void
allows to include c header in the module
translate_to_chemical
Publicfunction
func translate_to_chemical(self : &BuildContext, module : *Module, output_path : &string_view) : *LabJob
translate a module to chemical
translate_to_c
Publicfunction
func translate_to_c(self : &BuildContext, name : &string_view, output_path : &string_view) : *LabJob
translate a chemical module to c file
build_exe
Publicfunction
func build_exe(self : &BuildContext, name : &string_view) : *LabJob
build executable using module dependencies
run_jit_exe
Publicfunction
func run_jit_exe(self : &BuildContext, name : &string_view) : *LabJob
compiles and runs the given executables instantly using jit
build_dynamic_lib
Publicfunction
func build_dynamic_lib(self : &BuildContext, name : &string_view) : *LabJob
build a dynamic library using executable dependencies
build_cbi
Publicfunction
func build_cbi(self : &BuildContext, name : &string_view) : *LabJobCBI
build a cbi by given name, that can be used to integrate with compiler
set_environment_testing
Publicfunction
func set_environment_testing(self : &BuildContext, job : *LabJob, value : bool) : void
sets the environment to testing mode
index_cbi_fn
Publicfunction
func index_cbi_fn(self : &BuildContext, job : *LabJobCBI, key : &string_view, fn_name : &string_view, fn_type : CBIFunctionType) : bool
indexes a function from cbi, so it can be called when required
add_object
Publicfunction
func add_object(self : &BuildContext, job : *LabJob, path : &string_view) : void
add a linkable object (.o file)
build_path
Publicfunction
func build_path(self : &BuildContext) : string_view
get build
has_arg
Publicfunction
func has_arg(self : &BuildContext, name : &string_view) : bool
check if argument given to chemical compiler
get_arg
Publicfunction
func get_arg(self : &BuildContext, name : &string_view) : string_view
get the argument given to chemical compiler
remove_arg
Publicfunction
func remove_arg(self : &BuildContext, name : &string_view) : void
remove the argument given to chemical compiler
define
Publicfunction
func define(self : &BuildContext, job : *LabJob, name : &string_view) : bool
define a definition, that you can access using defined compiler function
undefine
Publicfunction
func undefine(self : &BuildContext, job : *LabJob, name : &string_view) : bool
un-define a definition
invoke_dlltool
Publicfunction
func invoke_dlltool(self : &BuildContext, string_arr : span<string_view>) : int
invoke llvm dll tool with given cli args
invoke_ranlib
Publicfunction
func invoke_ranlib(self : &BuildContext, string_arr : span<string_view>) : int
invoke ranlib tool with given cli args
invoke_lib
Publicfunction
func invoke_lib(self : &BuildContext, string_arr : span<string_view>) : int
invoke lib tool with given cli args
invoke_ar
Publicfunction
func invoke_ar(self : &BuildContext, string_arr : span<string_view>) : int
invoke ar with given cli args
set_conflict_resolution_strategy
Publicfunction
func set_conflict_resolution_strategy(self : &BuildContext, job : *LabJob, strategy : ConflictResolutionStrategy) : void
sets the conflict resolution strategy for the job
fetch_job_dependency
Publicfunction
func fetch_job_dependency(self : &BuildContext, job : *LabJob, dep : &ImportRepo, strategy : ConflictResolutionStrategy) : bool
fetches a remote dependency for the job
fetch_mod_dependency
Publicfunction
func fetch_mod_dependency(self : &BuildContext, job : *LabJob, mod : *Module, dep : &ImportRepo, strategy : ConflictResolutionStrategy) : bool
fetches a remote dependency for the module
new_module
PublicfunctionExtension
func new_module(ctx : &BuildContext, type : ModuleType, scope_name : &string_view, name : &string_view, dependencies : span<ModuleDependency>) : *Module
new_app_module
PublicfunctionExtension
func new_app_module(ctx : &BuildContext, type : ModuleType, scope_name : &string_view, name : &string_view, dependencies : span<ModuleDependency>) : *Module
directory_module
PublicfunctionExtension
func directory_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, dependencies : span<ModuleDependency>) : *Module
make_deps
function
func make_deps(vec : &vector<ModuleDependency>, dependencies : span<*Module>) : void
new_module_with_deps
PublicfunctionExtension
func new_module_with_deps(ctx : &BuildContext, type : ModuleType, package_kind : PackageKind, scope_name : &string_view, name : &string_view, dependencies : span<*Module>) : *Module
c_file_module
PublicfunctionExtension
func c_file_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view, dependencies : span<*Module>) : *Module
a single .c file
cpp_file_module
PublicfunctionExtension
func cpp_file_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view, dependencies : span<*Module>) : *Module
a single .cpp file
object_module
PublicfunctionExtension
func object_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view) : *Module
a single .o file
chemical_dir_module
PublicfunctionExtension
func chemical_dir_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view, dependencies : span<*Module>) : *Module
directory module
directory_app_module
PublicfunctionExtension
func directory_app_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view, dependencies : span<*Module>) : *Module
ImportSymbol
Publicstruct
struct ImportSymbol { var parts : span<string_view> var alias : string_view }
make
function
func make() : ImportSymbol
ImportRepo
Publicstruct
struct ImportRepo { var scope : string_view var name : string_view var origin : string_view var from : string_view var subdir : string_view var version : string_view var branch : string_view var commit : string_view var alias : string_view var symbols : span<ImportSymbol> var location : u64 }
AppBuildContext
Publicinterface
interface AppBuildContext : BuildContext
launch_executable
Publicfunction
func launch_executable(self : &AppBuildContext, path : &string_view, same_window : bool) : int
launch an executable at the path
on_finished
Publicfunction
func on_finished(self : &AppBuildContext, lambda : func(*void) : void, data : *void) : void
something you'd want to be invoked when lab build has finished
add_compiler_interfaces
PublicfunctionExtension
func add_compiler_interfaces(ctx : &BuildContext, mod : *Module, interfaces : span<string_view>) : void
create_module
PublicfunctionExtension
func create_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, dir_path : &string_view, dependencies : span<*Module>, interfaces : span<string_view>) : *Module
default_get
PublicfunctionExtension
func default_get(ctx : &BuildContext, buildFlag : *bool, cached : **Module, build : func(*BuildContext) : *Module) : *Module
file_module
PublicfunctionExtension
func file_module(ctx : &BuildContext, scope_name : &string_view, name : &string_view, path : &string_view, dependencies : span<*Module>) : *Module
translate_file_to_chemical
PublicfunctionExtension
func translate_file_to_chemical(ctx : &BuildContext, c_path : &string_view, output_path : &string_view) : *LabJob
include_headers
PublicfunctionExtension
func include_headers(ctx : &BuildContext, module : *Module, headers : span<string_view>) : void
allows to include headers in the module
index_def_cbi_fn
PublicfunctionExtension
func index_def_cbi_fn(ctx : &BuildContext, job : *LabJobCBI, name : &string_view, type : CBIFunctionType) : void
build_job_dir_path
PublicfunctionExtension
func build_job_dir_path(ctx : &BuildContext, job_name : &string_view) : string
-----------------------------------------------------
job_dir_path
PublicfunctionExtension
func job_dir_path(ctx : &BuildContext, job : *LabJob) : string
build_mod_file_path
PublicfunctionExtension
func build_mod_file_path(ctx : &BuildContext, job_name : &string_view, mod_scope : &string_view, mod_name : &string_view, file : &string_view) : string
build_llvm_ir_path
PublicfunctionExtension
func build_llvm_ir_path(ctx : &BuildContext, job_name : &string_view, mod_scope : &string_view, mod_name : &string_view) : string
build_asm_path
PublicfunctionExtension
func build_asm_path(ctx : &BuildContext, job_name : &string_view, mod_scope : &string_view, mod_name : &string_view) : string
build_bitcode_path
PublicfunctionExtension
func build_bitcode_path(ctx : &BuildContext, job_name : &string_view, mod_scope : &string_view, mod_name : &string_view) : string
llvm_ir_path
PublicfunctionExtension
func llvm_ir_path(ctx : &BuildContext, job : *LabJob, mod : *Module) : string
asm_path
PublicfunctionExtension
func asm_path(ctx : &BuildContext, job : *LabJob, mod : *Module) : string
bitcode_path
PublicfunctionExtension
func bitcode_path(ctx : &BuildContext, job : *LabJob, mod : *Module) : string
lab
Publicnamespace
namespace lab
curr_dir_of
Publicfunction
func curr_dir_of(path : *char, len : size_t) : string
curr_dir
Publicfunction
func curr_dir() : string
appended_str
Publicfunction
func appended_str(str : string, path : *char) : string
rel_path_to
Publicfunction
func rel_path_to(path : *char) : string