Skip to main content

Crate llvmkit_asmparser

Crate llvmkit_asmparser 

Source
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 moduleLLVM sourceStatus
ll_lexerLLLexer.h + LLLexer.cppdone
ll_tokenLLToken.hdone
file_locFileLoc.hdone
numbered_valuesNumberedValues.hdone
slot_mappingSlotMapping.hdone
asm_parser_contextAsmParserContext.h + .cppdone
parse_errorLLParser.{h,cpp} diagnostic surfaceseeded
ll_parserLLParser.h + LLParser.cpp (subset)seeded
parserParser.h + Parser.cppseeded

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
.ll lexer — direct port of LLVM’s textual-IR lexer.
ll_parser
Textual .ll parser — module-level slice (Session 2).
ll_token
Token type and supporting enums for the .ll lexer.
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 r into a fresh Vec<u8>. Convenience helper for the common case where a caller has any Read source and wants to feed it to ll_lexer::Lexer::new.