Пример #1
0
		public override Statement  VisitBranch(Branch branch)
		{
      branch = (Branch)branch.Clone();

			// remember this statement on the list to adjust branches
			this.branchInstructions.Add(branch);

			if (branch.Condition == null) return branch;

      if (this.performConstantFoldingOnBranchConditions) {
        Literal l = AsConstant(branch.Condition);
        if (l != null) {
          if (Equals(l.Value, true) || Equals(l.Value, 1)) {
            branch.Condition = null;
            return branch;
          }
          if (Equals(l.Value, false) || Equals(l.Value, 0)) {
            return null;
          }
        }
      }
			branch.Condition = simplify(branch.Condition);
			return branch;
		}
Пример #2
0
 public override Statement VisitBranch(Branch branch)
 {
     if (branch == null) return null;
     branch = (Branch)base.VisitBranch((Branch)branch.Clone());
     if (branch == null) return null;
     branch.Target = this.VisitBlock(branch.Target);
     return branch;
 }
Пример #3
0
 public override Statement VisitBranch(Branch branch) {
   if (branch == null) return null;
   return ((Branch)branch.Clone());
 }