Expand description
.ll (LLVM IR) lexer and parser.
The crate’s module layout mirrors the LLVM 22.1.4 AsmParser source tree
(include/llvm/AsmParser/*.h + lib/AsmParser/*.cpp). One Rust file per
C++ translation unit; header-only C++ files map to a Rust file of the
same stem.
| Rust module | LLVM source | Status |
|---|---|---|
ll_lexer | LLLexer.h + LLLexer.cpp | done |
ll_token | LLToken.h | done |
file_loc | FileLoc.h | done |
numbered_values | NumberedValues.h | done |
slot_mapping | SlotMapping.h | done |
asm_parser_context | AsmParserContext.h + .cpp | done |
parse_error | LLParser.{h,cpp} diagnostic surface | seeded |
ll_parser | LLParser.h + LLParser.cpp (subset) | seeded |
parser | Parser.h + Parser.cpp | seeded |
The substrate listed as done is the support layer the parser-first
roadmap pulls in alongside LLParser; it ships before the parser core
so Sessions 2-3 can wire their resolution / location pipelines against
a stable interface (Roadmap section 10.5 forward-reference typestate).
Modules§
- asm_
parser_ context - Optional file-location registry produced by
LLParser. - file_
loc - Line / column source locations for parser diagnostics.
- ll_
lexer .lllexer — direct port of LLVM’s textual-IR lexer.- ll_
parser - Textual
.llparser — module-level slice (Session 2). - ll_
token - Token type and supporting enums for the
.lllexer. - module_
summary - Module summary index parser and display support.
- numbered_
values - Slot-numbered value tables used by the textual IR parser.
- parse_
error - Typed parser-error catalogue.
- parser
- Public parser facade.
- slot_
mapping - Public parser-by-product table mapping slot numbers to IR handles.
Functions§
- read_
to_ owned - Drain
rinto a freshVec<u8>. Convenience helper for the common case where a caller has anyReadsource and wants to feed it toll_lexer::Lexer::new.