36 releases

new 0.13.0 Dec 5, 2024
0.12.16 Jul 30, 2024
0.12.14 Feb 22, 2024
0.12.12 Oct 19, 2023
0.0.3 Jul 13, 2018

#3 in No standard library

Download history 1322876/week @ 2024-08-21 1197090/week @ 2024-08-28 1420385/week @ 2024-09-04 1284030/week @ 2024-09-11 1116327/week @ 2024-09-18 1353288/week @ 2024-09-25 1500251/week @ 2024-10-02 1656578/week @ 2024-10-09 1257504/week @ 2024-10-16 1221310/week @ 2024-10-23 1077012/week @ 2024-10-30 1200851/week @ 2024-11-06 1333476/week @ 2024-11-13 1408883/week @ 2024-11-20 945668/week @ 2024-11-27 1127855/week @ 2024-12-04

5,026,474 downloads per month
Used in 3,375 crates (150 directly)

Apache-2.0 WITH LLVM-exception

105KB
2.5K SLoC

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.

Dependencies

~160KB