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§
- Clang
Backend - The ClangBackend generates C code from the code in the process image and compiles that
with clang for optimal codegen. It constructs the
ClangRuntime. - Clang
Backend Builder - The ClangBackendBuilder configures the
ClangBackendwith the values that you provide. Use theClangBackend::buildermethod to create this builder. - Clang
Runtime - The ClangRuntime gives you access to registers, memory, the event channel and the AOT-compiled code of the ClangBackend.
- Heap
Chunk - 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§
- AOTReturn
Code - The raw return code of the “AOT”, i.e. the AOT-compiled C code.
- CLifter
Error - This error type represents everything that can go wrong when generating C code.
- Clang
Backend Error - This error shows everything that can go wrong during the operations of the ClangBackend.
- Clang
Runtime Fault - This type shows all errors that can occur during runtime
- Heap
Error - The HeapError shows everything that can go wrong when operating with the heap.
- Symbol
Type - The type of a symbol in the runtime’s symbol store
- Symbol
Visibility - The visibility of a symbol in the runtime’s symbol store