Monotonic codegen now passing compile stage

This commit is contained in:
Emil Fresk 2020-12-12 23:24:54 +01:00
parent 97a48983d2
commit 8e8ec9b7b8
8 changed files with 189 additions and 219 deletions

View file

@ -70,22 +70,6 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
let inputs = util::inputs_ident(name);
let (_, tupled, pats, _) = util::regroup_inputs(&task.inputs);
// TODO: Fix for new monotonics
// let (let_instant, instant) = if extra.monotonic.is_some() {
// let instants = util::instants_ident(name);
// (
// quote!(
// let instant =
// #instants.get_unchecked(usize::from(index)).as_ptr().read();
// ),
// quote!(, instant),
// )
// } else {
// (quote!(), quote!())
// };
let (let_instant, instant) = (quote!(), quote!());
let locals_new = if task.locals.is_empty() {
quote!()
} else {
@ -99,12 +83,11 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
#t::#name => {
let #tupled =
#inputs.get_unchecked(usize::from(index)).as_ptr().read();
#let_instant
#fq.split().0.enqueue_unchecked(index);
let priority = &rtic::export::Priority::new(PRIORITY);
#app_path::#name(
#locals_new
#name::Context::new(priority #instant)
#name::Context::new(priority)
#(,#pats)*
)
}