Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cprover_bindings/src/irep/irep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ impl Irep {
/// Adds a `comment` sub to the irep.
/// Note that there might be comments both on the irep itself and
/// inside the location sub of the irep.
pub fn with_comment<T: Into<InternedString>>(self, c: T) -> Self {
self.with_named_sub(IrepId::Comment, Irep::just_string_id(c))
pub fn with_kani_comment<T: Into<InternedString>>(self, c: T) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up with "kani" stuff inside cprover_bindings. Is there a better way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
The only other way is to use a IrepId::FreeformString.

self.with_named_sub(IrepId::KaniComment, Irep::just_string_id(c))
}

pub fn with_named_sub(mut self, key: IrepId, value: Irep) -> Self {
Expand Down
2 changes: 2 additions & 0 deletions cprover_bindings/src/irep/irep_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub enum IrepId {
Line,
Column,
Comment,
KaniComment,
Property,
PropertyClass,
PropertyId,
Expand Down Expand Up @@ -909,6 +910,7 @@ impl ToString for IrepId {
IrepId::Line => "line",
IrepId::Column => "column",
IrepId::Comment => "comment",
IrepId::KaniComment => "#kani_comment",
IrepId::Property => "property",
IrepId::PropertyClass => "property_class",
IrepId::PropertyId => "property_id",
Expand Down
2 changes: 1 addition & 1 deletion cprover_bindings/src/irep/to_irep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ impl ToIrep for StmtBody {
// So we translate identically to `nondet` here, but add a comment noting we wish it were poison
// potentially for other backends to pick up and treat specially.
code_irep(IrepId::Assign, vec![place.to_irep(mm), place.typ().nondet().to_irep(mm)])
.with_comment("deinit")
.with_kani_comment("deinit")
}
StmtBody::Expression(e) => code_irep(IrepId::Expression, vec![e.to_irep(mm)]),
StmtBody::For { init, cond, update, body } => code_irep(
Expand Down