#target #host #triple #compiler #jit

no-std target-lexicon

Targeting utilities for compilers and related tools

15 releases (breaking)

✓ Uses Rust 2018 edition

0.10.0 Nov 19, 2019
0.8.1 Sep 5, 2019
0.4.0 Mar 26, 2019
0.2.0 Nov 7, 2018
0.0.3 Jul 13, 2018

#8 in No standard library

Download history 5761/week @ 2019-12-02 5820/week @ 2019-12-09 5748/week @ 2019-12-16 2873/week @ 2019-12-23 3204/week @ 2019-12-30 8156/week @ 2020-01-06 8030/week @ 2020-01-13 6558/week @ 2020-01-20 5100/week @ 2020-01-27 7217/week @ 2020-02-03 6922/week @ 2020-02-10 7786/week @ 2020-02-17 9552/week @ 2020-02-24 10016/week @ 2020-03-02 12343/week @ 2020-03-09 11377/week @ 2020-03-16

21,563 downloads per month
Used in 113 crates (44 directly)

Apache-2.0 WITH LLVM-exception

71KB
1.5K SLoC

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

Currently, the main feature is support for decoding "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 supports all triples currently used by rustc and rustup.

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.


lib.rs:

Target triple support.

No runtime deps