LLVM 22.x tile for building compilers, language runtimes, and out-of-tree tooling
88
83%
Does it follow best practices?
Impact
96%
1.23xAverage score across 5 eval scenarios
Passed
No known issues
A small team has built a toy compiler for a language called "Pico" that lowers a simple AST to LLVM IR. The compiler works — it emits correct code — but users are frustrated that they can't use gdb or lldb to step through their Pico programs at the source level. Every crash shows disassembly with no file names or line numbers.
Your task is to add DWARF debug information to the existing Pico compiler so that:
lldb shows the correct Pico source lineThe existing compiler has an LLVMContext, a Module, and an IRBuilder<>. Functions are already being emitted with allocas for local variables and parameters. What's missing is the entire debug metadata layer.
Produce a C++ source file pico_debug.cpp that implements the debug info layer for the Pico compiler. It should demonstrate:
DebugInfoEmitter class (or equivalent struct) that integrates with the existing CodeGen contextbeginFunction() method that integrates debug metadata with each llvm::FunctionThe file should be self-contained and readable without needing to run the compiler — someone reviewing the code should be able to verify the debug API is being used correctly. Include a short main() or standalone demo() function that exercises the above methods on a trivial example (one function with one parameter and one local variable).
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
add-alias-analysis
add-attributes-metadata
add-calling-convention
add-debug-info
add-exception-handling
add-gc-statepoints
add-intrinsic
add-lto
add-sanitizer
add-vectorization-hint
frontend-to-ir
jit-setup
lit-filecheck
lower-struct-types
new-target
out-of-tree-setup
tessl-llvm
version-sync