Implement the machinery to create a TargetIsa.

Add an isa::lookup() function which serves as a target registry for creating
Box<TargetIsa> trait objects.

An isa::Builder makes it possible to confugure the trait object before it is
created.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-11 11:39:42 -07:00
parent 1ae9a37796
commit 1087aa67f0
3 changed files with 94 additions and 5 deletions

View File

@@ -211,6 +211,7 @@ def gen_group(sgrp, fmt):
"""
byte_size = layout_group(sgrp)
fmt.line('#[derive(Clone)]')
fmt.doc_comment('Flags group `{}`.'.format(sgrp.name))
with fmt.indented('pub struct Flags {', '}'):
fmt.line('bytes: [u8; {}],'.format(byte_size))