Skip to content

Commit f1b0877

Browse files
Update LLBC backend for Trait support and translation of projection (#3807)
1. Update LLBC backend to adapt to the changes of Charon submodule to AeneasVerif/charon@adc0a85: Changing translate_place to fit with the current place representation of Charon. 3. Support translation of programs that use Trait, but translating the trait impl functions into monomorphized functions. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Zyad Hassan <[email protected]>
1 parent ce67fdf commit f1b0877

File tree

6 files changed

+762
-110
lines changed

6 files changed

+762
-110
lines changed

kani-compiler/src/codegen_aeneas_llbc/compiler_interface.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl LlbcCodegenBackend {
109109

110110
// Translate all the items
111111
for item in &items {
112+
debug!("Translating: {item:?}");
112113
match item {
113114
MonoItem::Fn(instance) => {
114115
let mut fcx = Context::new(
@@ -387,12 +388,14 @@ where
387388
fn create_charon_transformation_context(tcx: TyCtxt) -> TransformCtx {
388389
let options = TransformOptions {
389390
no_code_duplication: false,
390-
hide_marker_traits: false,
391+
hide_marker_traits: true,
391392
no_merge_goto_chains: false,
392393
item_opacities: Vec::new(),
393394
};
394395
let crate_name = tcx.crate_name(LOCAL_CRATE).as_str().into();
395-
let translated = TranslatedCrate { crate_name, ..TranslatedCrate::default() };
396+
let mut translated = TranslatedCrate { crate_name, ..TranslatedCrate::default() };
397+
//This option setting is for Aeneas compatibility
398+
translated.options.hide_marker_traits = true;
396399
let errors = ErrorCtx::new(true, false);
397400
TransformCtx { options, translated, errors }
398401
}

0 commit comments

Comments
 (0)