Exemplo n.º 1
0
  @Override
  protected void flowThrough(Object in, Object node, Object out) {
    // perform flow from in to out, through node
    FlowSet inSet = (FlowSet) in, outSet = (FlowSet) out;
    Unit unit = (Unit) node;

    //		 System.out.println(inSet);
    //		 System.out.println("=== " + unit);
    // copy inSet to outSet
    inSet.copy(outSet);

    if (unit instanceof Stmt) {
      Stmt s = (Stmt) unit;
      if (exactProceedSet.contains(s)) {
        // exact proceed
        outSet.add(EXACT);
        outSet.remove(NONE);
        outSet.remove(NON_EXACT);
      } else if (nonExactProceedSet.contains(s)) {
        // non-exact proceed
        if (!inSet.contains(EXACT)) {
          outSet.add(NON_EXACT);
          outSet.remove(NONE);
        }
      } else {
        // no proceed
        if (!inSet.contains(NON_EXACT) && !inSet.contains(EXACT)) outSet.add(NONE);
      }
    }
    //		 System.out.println(outSet);
  }
  /*
   * (non-Javadoc)
   *
   * @see soot.toolkits.scalar.FlowAnalysis#flowThrough(java.lang.Object, java.lang.Object, java.lang.Object)
   */
  @Override
  protected void flowThrough(FlowSet source, Unit unit, FlowSet dest) {

    if (unit instanceof AssignStmt) {
      AssignStmt assignment = (AssignStmt) unit;

      FeatureTag tag = (FeatureTag) assignment.getTag(FeatureTag.FEAT_TAG_NAME);
      IFeatureRep featureRep = tag.getFeatureRep();

      if (featureRep.belongsToConfiguration(configuration)) {
        kill(source, assignment, dest);
        gen(dest, assignment);
      } else {
        source.copy(dest);
      }
    } else {
      source.copy(dest);
    }
  }
 /*
  * (non-Javadoc)
  *
  * @see soot.toolkits.scalar.AbstractFlowAnalysis#copy(java.lang.Object, java.lang.Object)
  */
 @Override
 protected void copy(FlowSet source, FlowSet dest) {
   source.copy(dest);
 }
Exemplo n.º 4
0
 @Override
 protected void copy(Object source, Object dest) {
   // copy from source to dest
   FlowSet srcSet = (FlowSet) source, destSet = (FlowSet) dest;
   srcSet.copy(destSet);
 }