[build] Introduce a TargetIsaBuilder to better encapsulate the TargetIsa;
It was the caller's responsibility to call TargetIsa::check() before; now one can't manipulate a TargetIsa without calling the TargetIsaBuilder::finish() method, which is less error-prone and more in line with what's coming for other things we're going to generate in the meta crate. Also splits the construction of a RegClass in two parts: a prototype is made first when declaring the RegClass, and missing bits are filled in when adding it to the TargetIsa(Builder). This avoids an awkward passing of the isa to the RegClass ctor.
This commit is contained in:
committed by
Dan Gohman
parent
f896bfb946
commit
add4043bb5
@@ -62,14 +62,10 @@ impl fmt::Display for Isa {
|
||||
}
|
||||
|
||||
pub fn define_all() -> Vec<TargetIsa> {
|
||||
let isas = vec![
|
||||
vec![
|
||||
riscv::define(),
|
||||
arm32::define(),
|
||||
arm64::define(),
|
||||
x86::define(),
|
||||
];
|
||||
for isa in isas.iter() {
|
||||
isa.check();
|
||||
}
|
||||
isas
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user