Add documentation for top-level items in cranelift-codegen/meta
This commit is contained in:
@@ -39,6 +39,7 @@ macro_rules! predicate {
|
||||
};
|
||||
}
|
||||
|
||||
/// A macro that joins boolean settings into a list (e.g. `preset!(feature_a && feature_b)`).
|
||||
#[macro_export]
|
||||
macro_rules! preset {
|
||||
() => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Trait for extending `HashMap` with `get_or_default`.
|
||||
use std::collections::HashMap;
|
||||
use std::hash::Hash;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Error returned during meta code-generation.
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Generate instruction data (including opcodes, formats, builders, etc.).
|
||||
use std::fmt;
|
||||
|
||||
use cranelift_codegen_shared::constant_hash;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Generate transformations to legalize instructions without encodings.
|
||||
use crate::cdsl::ast::{Def, DefPool, Expr, VarPool};
|
||||
use crate::cdsl::isa::TargetIsa;
|
||||
use crate::cdsl::operands::Operand;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Generate the ISA-specific registers.
|
||||
use crate::cdsl::isa::TargetIsa;
|
||||
use crate::cdsl::regs::{RegBank, RegClass};
|
||||
use crate::error;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Generate the ISA-specific settings.
|
||||
use std::collections::HashMap;
|
||||
|
||||
use cranelift_codegen_shared::constant_hash::{generate_table, simple_hash};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! Define supported ISAs; includes ISA-specific instructions, encodings, registers, settings, etc.
|
||||
use crate::cdsl::isa::TargetIsa;
|
||||
use crate::shared::Definitions as SharedDefinitions;
|
||||
use std::fmt;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//! This crate generates Rust sources for use by
|
||||
//! [`cranelift_codegen`](../cranelift_codegen/index.html).
|
||||
#[macro_use]
|
||||
mod cdsl;
|
||||
mod srcgen;
|
||||
@@ -17,6 +19,7 @@ mod default_map;
|
||||
mod shared;
|
||||
mod unique_table;
|
||||
|
||||
/// Generate an ISA from an architecture string (e.g. "x86_64").
|
||||
pub fn isa_from_arch(arch: &str) -> Result<isa::Isa, String> {
|
||||
isa::Isa::from_arch(arch).ok_or_else(|| format!("no supported isa found for arch `{}`", arch))
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! An index-accessed table implementation that avoids duplicate entries.
|
||||
use std::collections::HashMap;
|
||||
use std::hash::Hash;
|
||||
use std::slice;
|
||||
|
||||
Reference in New Issue
Block a user