-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for enum, struct, tuple in llbc backend #3721
base: main
Are you sure you want to change the base?
Conversation
Can you please provide a better title to this PR? Something like "Add support for enum, struct, tuple in the llbc backend". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -0,0 +1,24 @@ | |||
-- THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete all the .lean
files.
@@ -5,4 +5,4 @@ fn test::is_zero(@1: i32) -> bool\ | |||
|
|||
@0 := copy (i@1) == const (0 : i32)\ | |||
return\ | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? You might want to update your VSCode settings to insert a new line at the end of file. See https://stackoverflow.com/questions/44704968/visual-studio-code-insert-newline-at-the-end-of-files
@@ -7,66 +7,96 @@ | |||
//! unstructured low-level borrow calculus (ULLBC) | |||
|
|||
use core::panic; | |||
//use std::any::Any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove comments.
}; | ||
use charon_lib::{error_assert, error_or_panic}; | ||
use rustc_data_structures::fx::FxHashMap; | ||
//use rustc_data_structures::stable_hasher::HashStable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments.
}; | ||
|
||
use stable_mir::ty::{GenericArgKind, GenericArgs}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with the previous use stable_mir::ty
.
use stable_mir::{CrateDef, DefId}; | ||
//use syn::token::Default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment.
@@ -152,31 +187,192 @@ impl<'a, 'tcx> Context<'a, 'tcx> { | |||
tid.try_into().unwrap() | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented function.
tid.try_into().unwrap() | ||
} | ||
|
||
fn find_type_decl_id(&self, def_id: DefId) -> CharonTypeDeclId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the previous function (register_type_decl_id
) sufficient? Or is this used in cases where the decl_id is guaranteed to be created previously?
CharonSpan { span: rspan, generated_from_span: None } | ||
} | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code.
@@ -409,54 +710,150 @@ impl<'a, 'tcx> Context<'a, 'tcx> { | |||
instance_internal.def.requires_caller_location(self.tcx()) | |||
} | |||
|
|||
fn translate_ty(&self, ty: Ty) -> CharonTy { | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.