private HLLocation ProcessUnaryNegationExpression(IUnaryNegation pExpression) { HLLocation locationOperand = ProcessExpression(pExpression.Operand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseNegate(locationTemporary, locationOperand); return(locationTemporary); }
public override void Visit(IUnaryNegation unaryNegation) { if (Process(unaryNegation)) { visitor.Visit(unaryNegation); } base.Visit(unaryNegation); }
public void Visit(IUnaryNegation unaryNegation) { throw new NotImplementedException(); }
/// <summary> /// Performs some computation with the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public virtual void Visit(IUnaryNegation unaryNegation) { this.Visit((IUnaryOperation)unaryNegation); }
/// <summary> /// Traverses the children of the unary negation expression. /// </summary> public virtual void TraverseChildren(IUnaryNegation unaryNegation) { Contract.Requires(unaryNegation != null); this.TraverseChildren((IUnaryOperation)unaryNegation); }
/// <summary> /// Performs some computation with the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public virtual void Visit(IUnaryNegation unaryNegation) { }
public override void TraverseChildren(IUnaryNegation unaryNegation) { MethodEnter(unaryNegation); base.TraverseChildren(unaryNegation); MethodExit(); }
public override void TraverseChildren(IUnaryNegation unaryNegation) { base.TraverseChildren(unaryNegation); Bpl.Expr exp = TranslatedExpressions.Pop(); Bpl.Expr e, zero, realZero; zero = Bpl.Expr.Literal(0); realZero = new Bpl.NAryExpr(Bpl.Token.NoToken, new Bpl.FunctionCall(this.sink.Heap.Int2Real), new List<Bpl.Expr>(new Bpl.Expr[] {zero})); switch (unaryNegation.Type.TypeCode) { case PrimitiveTypeCode.Float32: case PrimitiveTypeCode.Float64: e = new Bpl.NAryExpr( unaryNegation.Token(), new Bpl.FunctionCall(this.sink.Heap.RealMinus), new List<Bpl.Expr>(new Bpl.Expr[] {realZero, exp}) ); break; default: e = Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Sub, Bpl.Expr.Literal(0), exp); break; } TranslatedExpressions.Push(e); }
/// <summary> /// Visits the specified unary negation. /// </summary> /// <param name="unaryNegation">The unary negation.</param> public override void Visit(IUnaryNegation unaryNegation) { UnaryNegation mutableUnaryNegation = unaryNegation as UnaryNegation; if (alwaysMakeACopy || mutableUnaryNegation == null) mutableUnaryNegation = new UnaryNegation(unaryNegation); this.resultExpression = this.myCodeMutator.Visit(mutableUnaryNegation); }
public override void TraverseChildren(IUnaryNegation unaryNegation) { base.TraverseChildren(unaryNegation); ((UnaryNegation)unaryNegation).Type = unaryNegation.Operand.Type; }
/// <summary> /// Generates IL for the specified unary negation. /// </summary> /// <param name="unaryNegation">The unary negation.</param> public override void TraverseChildren(IUnaryNegation unaryNegation) { if (unaryNegation.CheckOverflow && TypeHelper.IsSignedPrimitiveInteger(unaryNegation.Type)) { this.generator.Emit(OperationCode.Ldc_I4_0); this.StackSize++; this.Traverse(unaryNegation.Operand); this.generator.Emit(OperationCode.Sub_Ovf); this.StackSize--; return; } this.Traverse(unaryNegation.Operand); this.generator.Emit(OperationCode.Neg); }
public override void Visit(IUnaryNegation unaryNegation) { if(Process(unaryNegation)){visitor.Visit(unaryNegation);} base.Visit(unaryNegation); }
private HLLocation ProcessUnaryNegationExpression(IUnaryNegation pExpression) { HLLocation locationOperand = ProcessExpression(pExpression.Operand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseNegate(locationTemporary, locationOperand); return locationTemporary; }
public void Visit(IUnaryNegation unaryNegation) { this.result = this.rewriter.Rewrite(unaryNegation); }
/// <summary> /// Rewrites the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public virtual IExpression Rewrite(IUnaryNegation unaryNegation) { var mutableUnaryNegation = unaryNegation as UnaryNegation; if (mutableUnaryNegation == null) return unaryNegation; this.RewriteChildren(mutableUnaryNegation); return mutableUnaryNegation; }
/// <summary> /// /// </summary> /// <param name="unaryNegation"></param> public UnaryNegation(IUnaryNegation unaryNegation) : base(unaryNegation) { this.CheckOverflow = unaryNegation.CheckOverflow; }
public virtual void onASTElement(IUnaryNegation unaryNegation) { }
public override void Visit(IUnaryNegation unaryNegation) { allElements.Add(new InvokInfo(Traverser, "IUnaryNegation", unaryNegation)); }
public void Visit(IUnaryNegation unaryNegation) { this.result = this.copier.Copy(unaryNegation); }
/// <summary> /// Rewrites the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public virtual IExpression Rewrite(IUnaryNegation unaryNegation) { return unaryNegation; }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public virtual void Visit(IUnaryNegation unaryNegation) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(unaryNegation); this.Visit(unaryNegation.Operand); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count. this.path.Pop(); }
/// <summary> /// Returns a shallow copy of the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public UnaryNegation Copy(IUnaryNegation unaryNegation) { Contract.Requires(unaryNegation != null); Contract.Ensures(Contract.Result<UnaryNegation>() != null); return new UnaryNegation(unaryNegation); }
/// <summary> /// Traverses the unary negation expression. /// </summary> public void Traverse(IUnaryNegation unaryNegation) { Contract.Requires(unaryNegation != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(unaryNegation); if (this.StopTraversal) return; this.TraverseChildren(unaryNegation); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(unaryNegation); }
/// <summary> /// Returns a deep copy of the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public UnaryNegation Copy(IUnaryNegation unaryNegation) { Contract.Requires(unaryNegation != null); Contract.Ensures(Contract.Result<UnaryNegation>() != null); var mutableCopy = this.shallowCopier.Copy(unaryNegation); this.CopyChildren((UnaryOperation)mutableCopy); return mutableCopy; }
public void Visit(IUnaryNegation unaryNegation) { this.traverser.Traverse(unaryNegation); }
public void Visit(IUnaryNegation unaryNegation) { Contract.Requires(unaryNegation != null); throw new NotImplementedException(); }
/// <summary> /// Visits the specified unary negation. /// </summary> /// <param name="unaryNegation">The unary negation.</param> public override void Visit(IUnaryNegation unaryNegation) { UnaryNegation mutableUnaryNegation = new UnaryNegation(unaryNegation); this.resultExpression = this.myCodeCopier.DeepCopy(mutableUnaryNegation); }
public override void Visit(IUnaryNegation unaryNegation) { base.Visit(unaryNegation); Bpl.Expr exp = TranslatedExpressions.Pop(); Bpl.Expr zero = Bpl.Expr.Literal(0); // TODO: (mschaef) will this work in any case? TranslatedExpressions.Push( Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Sub, zero, exp) ); }
/// <summary> /// Returns a deep copy of the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public UnaryNegation Copy(IUnaryNegation unaryNegation) { var mutableCopy = this.shallowCopier.Copy(unaryNegation); this.CopyChildren((UnaryOperation)mutableCopy); return mutableCopy; }
public override void TraverseChildren(IUnaryNegation unaryNegation) { base.TraverseChildren(unaryNegation); }
/// <summary> /// Returns a shallow copy of the given unary negation expression. /// </summary> /// <param name="unaryNegation"></param> public UnaryNegation Copy(IUnaryNegation unaryNegation) { return new UnaryNegation(unaryNegation); }
/// <summary> /// Visits the specified unary negation. /// </summary> /// <param name="unaryNegation">The unary negation.</param> public override void Visit(IUnaryNegation unaryNegation) { UnaryNegation mutableUnaryNegation = unaryNegation as UnaryNegation; if (mutableUnaryNegation == null) { this.resultExpression = unaryNegation; return; } this.resultExpression = this.myCodeMutator.Visit(mutableUnaryNegation); }