MCPcopy Index your code
hub / github.com/bytecodealliance/target-lexicon

github.com/bytecodealliance/target-lexicon @v0.13.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.5 ↗ · + Follow
91 symbols 108 edges 9 files 24 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

This is a library for managing targets for compilers and related tools.

Currently, the main feature is support for decoding LLVM "triples", which are strings that identify a particular target configuration. They're named "triples" because historically they contained three fields, though over time they've added additional fields. This library provides a Triple struct containing enums for each of fields of a triple. Triple implements FromStr and fmt::Display so it can be converted to and from the conventional string representation of a triple.

Triple also has functions for querying a triple's endianness, pointer bit width, and binary format.

And, Triple and the enum types have host() constructors, for targeting the host.

It somewhat supports reading triples currently used by rustc and rustup, though beware that the mapping between rustc and LLVM triples is not one-to-one.

It does not support reading JSON target files itself. To use it with a JSON target file, construct a Triple using the value of the "llvm-target" field.

Core symbols most depended-on inside this repo

into_str
called by 13
src/targets.rs
as_str
called by 4
src/targets.rs
default_binary_format
called by 4
src/targets.rs
default_calling_convention
called by 3
src/triple.rs
is_like_darwin
called by 2
src/targets.rs
using_1_40
called by 1
build.rs
write_host_rs
called by 1
build.rs
endianness
called by 1
src/triple.rs

Shape

Method 35
Function 30
Enum 22
Class 4

Languages

Rust100%

Modules by API surface

src/targets.rs34 symbols
src/triple.rs21 symbols
src/data_model.rs11 symbols
src/host.rs9 symbols
src/lib.rs7 symbols
build.rs5 symbols
src/parse_error.rs2 symbols
examples/misc.rs1 symbols
examples/host.rs1 symbols

For agents

$ claude mcp add target-lexicon \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact