Skip to content

Commit

Permalink
Added Attributes to CfgStatement
Browse files Browse the repository at this point in the history
  • Loading branch information
martinschaef committed Jun 29, 2014
1 parent 8bea8d7 commit 5119802
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
Binary file modified boogieamp/dist/boogieamp.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ private BasicBlock constructCfg(Statement s, BasicBlock b) {
Log.error("Statement " + s + " is unreachable");
return null;
}
if (s instanceof AssertStatement) {
if (s instanceof AssertStatement) {
CfgAssertStatement asrt = new CfgAssertStatement(
s.getLocation(),
s.getAttributes(),
expression2CfgExpression(((AssertStatement) s).getFormula()));
this.astStatementMap.put(asrt, s);
b.addStatement(asrt);
Expand Down Expand Up @@ -280,6 +281,7 @@ private BasicBlock constructCfg(Statement s, BasicBlock b) {
} else if (s instanceof AssumeStatement) {
CfgAssumeStatement assm = new CfgAssumeStatement(
s.getLocation(),
s.getAttributes(),
expression2CfgExpression(((AssumeStatement) s).getFormula()));
b.addStatement(assm);
this.astStatementMap.put(assm, s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package boogie.controlflow.statement;

import boogie.ast.Attribute;
import boogie.controlflow.expression.CfgExpression;
import boogie.location.ILocation;

Expand All @@ -30,6 +31,11 @@ public class CfgAssertStatement extends CfgStatement {

private CfgExpression condition;

public CfgAssertStatement(ILocation loc, Attribute[] attributes, CfgExpression cond) {
super(loc, attributes);
this.condition = cond;
}

public CfgAssertStatement(ILocation loc, CfgExpression cond) {
super(loc);
this.condition = cond;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package boogie.controlflow.statement;

import boogie.ast.Attribute;
import boogie.controlflow.expression.CfgExpression;
import boogie.location.ILocation;

Expand All @@ -30,6 +31,12 @@ public class CfgAssumeStatement extends CfgStatement {

private CfgExpression condition;

public CfgAssumeStatement(ILocation loc, Attribute[] attributes, CfgExpression cond) {
super(loc, attributes);
this.condition = cond;
}


public CfgAssumeStatement(ILocation loc, CfgExpression cond) {
super(loc);
this.condition = cond;
Expand Down
18 changes: 17 additions & 1 deletion boogieamp/src/boogie/controlflow/statement/CfgStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package boogie.controlflow.statement;

import boogie.ast.Attribute;
import boogie.location.ILocation;

/**
Expand All @@ -28,15 +29,30 @@
public abstract class CfgStatement {

private ILocation location;
private Attribute[] attributes;

public CfgStatement(ILocation loc) {
this.location = loc;
}

public CfgStatement(ILocation loc, Attribute[] attributes) {
this.location = loc;
this.attributes = attributes;
}


public ILocation getLocation() {
return this.location;
}

@Override
public abstract CfgStatement clone();
public abstract CfgStatement clone();

/**
* @return the attributes
*/
public Attribute[] getAttributes() {
return attributes;
}

}

0 comments on commit 5119802

Please sign in to comment.