1
Fork 0

New Backend trait containing associated types

This commit is contained in:
Denis Merigoux 2018-08-28 11:40:34 +02:00 committed by Eduard-Mihai Burtescu
parent d577ec7e5f
commit 3889c2dcfb
4 changed files with 26 additions and 9 deletions

View file

@ -18,7 +18,7 @@ use rustc::ty::TyCtxt;
use rustc::ty::layout::{Align, Size};
use rustc::session::{config, Session};
use rustc_data_structures::small_c_str::SmallCStr;
use interfaces::BuilderMethods;
use interfaces::{BuilderMethods, Backend};
use syntax;
use std::borrow::Cow;
@ -55,11 +55,13 @@ bitflags! {
}
}
impl BuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx> {
type Value = &'ll Value;
type BasicBlock = &'ll BasicBlock;
type Type = &'ll type_::Type;
impl Backend for Builder<'a, 'll, 'tcx> {
type Value = &'ll Value;
type BasicBlock = &'ll BasicBlock;
type Type = &'ll type_::Type;
}
impl BuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx> {
fn new_block<'b>(
cx: &'a CodegenCx<'ll, 'tcx>,
llfn: &'ll Value,