1use std::collections::VecDeque;
4
5mod compilation;
6use super::{CallConv, Lexer, TargetBackendDescr, WhiteList};
9mod reg;
10use compilation::construct_compilation_helper;
11pub use reg::*;
12
13pub(crate) mod call;
14mod asm;
15mod lower;
16
17pub use asm::*;
18
19use crate::{CodeGen::MachineMnemonic, Target::Compiler};
20
21pub fn initializeX64Target(call_conv: CallConv) -> TargetBackendDescr {
23 let mut target = TargetBackendDescr::new();
24
25 target.call = call_conv;
26
27 target.init = Some(initializeX64Target);
28
29 target.lexer = Some(x64Lexer {}.boxed());
30 target.compile = Some(x64Parser { tokens: VecDeque::new(), out: None }.boxed());
31
32 target.whitelist = construct_whitelist();
33
34 target.helper = Some(construct_compilation_helper(call_conv));
35
36 target
37}
38
39fn construct_whitelist() -> WhiteList {
40 let mut whitelist = WhiteList::new();
41
42 whitelist.forbid(MachineMnemonic::Div);
46 whitelist.forbid(MachineMnemonic::Downcast);
47
48 whitelist
49}