Skip to main content

Module clang

Module clang 

Source
Expand description

The clang backend provided by squid.

This backend generates C code from the functions in the process image, compiles the C code with clang as a shared object file and loads that via dlopen() into the address space. We take little detour over clang to get the best possible LLVM codegen and thus the best performance.

Our original idea was to just emit the LLVM IR ourselves but no LLVM frontend is as good as clang anyways and C is a lot easier to generate than the LLVM IR, so this solution was less work and yielded better results.

Modules§

perms
The permission bits used by the ClangBackend

Structs§

ClangBackend
The ClangBackend generates C code from the code in the process image and compiles that with clang for optimal codegen. It constructs the ClangRuntime.
ClangBackendBuilder
The ClangBackendBuilder configures the ClangBackend with the values that you provide. Use the ClangBackend::builder method to create this builder.
ClangRuntime
The ClangRuntime gives you access to registers, memory, the event channel and the AOT-compiled code of the ClangBackend.
HeapChunk
The HeapChunk represents a single chunk on the heap of the runtime.
Symbol
The Symbols in the ClangRuntime are constructed from the symbols in the process image except that there is one runtime Symbol for every private + public name of a process image symbol.

Enums§

AOTReturnCode
The raw return code of the “AOT”, i.e. the AOT-compiled C code.
CLifterError
This error type represents everything that can go wrong when generating C code.
ClangBackendError
This error shows everything that can go wrong during the operations of the ClangBackend.
ClangRuntimeFault
This type shows all errors that can occur during runtime
HeapError
The HeapError shows everything that can go wrong when operating with the heap.
SymbolType
The type of a symbol in the runtime’s symbol store
SymbolVisibility
The visibility of a symbol in the runtime’s symbol store