Add settings::Stringwise.
This trait allows settings to be manipulated as strings, using descriptors and constant hash-table lookups. Amend gen_settings.py to generate the necessary constant tables.
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
//! RISC-V Settings.
|
||||
|
||||
use settings::{Descriptor, Detail, Stringwise, Result, Error};
|
||||
use std::fmt;
|
||||
|
||||
// Include code generated by `meta/gen_settings.py`. This file contains a public `Settings` struct
|
||||
// with an impl for all of the settings defined in `meta/cretonne/settings.py`.
|
||||
include!(concat!(env!("OUT_DIR"), "/settings-riscv.rs"));
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Settings;
|
||||
|
||||
#[test]
|
||||
fn display_default() {
|
||||
let s = Settings::default();
|
||||
assert_eq!(s.to_string(),
|
||||
"[riscv]\n\
|
||||
supports_m = false\n\
|
||||
supports_a = false\n\
|
||||
supports_f = false\n\
|
||||
supports_d = false\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user