本文整理汇总了C#中Pchp.CodeAnalysis.CodeGen.CodeGenerator.IsLongOnly方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGenerator.IsLongOnly方法的具体用法?C# CodeGenerator.IsLongOnly怎么用?C# CodeGenerator.IsLongOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pchp.CodeAnalysis.CodeGen.CodeGenerator
的用法示例。
在下文中一共展示了CodeGenerator.IsLongOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitBitOr
internal static TypeSymbol EmitBitOr(CodeGenerator cg, BoundExpression left, BoundExpression right)
{
// most common cases:
if (cg.IsLongOnly(left.TypeRefMask) || cg.IsLongOnly(right.TypeRefMask))
{
// i64 | i64 : i64
cg.EmitConvert(left, cg.CoreTypes.Long);
cg.EmitConvert(right, cg.CoreTypes.Long);
cg.Builder.EmitOpCode(ILOpCode.Or);
return cg.CoreTypes.Long;
}
//
return EmitBitOr(cg, cg.Emit(left), right);
}
示例2: Emit
internal override TypeSymbol Emit(CodeGenerator cg)
{
Debug.Assert(this.Access.IsRead || this.Access.IsNone);
//
TypeSymbol returned_type;
if (UsesOperatorMethod)
{
throw new NotImplementedException(); // call this.Operator(Left, Right)
}
switch (this.Operation)
{
#region Arithmetic Operations
case Operations.Add:
returned_type = (cg.IsLongOnly(this.TypeRefMask)) ? cg.CoreTypes.Long.Symbol : this.Access.TargetType;
returned_type = EmitAdd(cg, Left, Right, returned_type);
break;
case Operations.Sub:
//Template: "x - y" Operators.Subtract(x,y) [overloads]
returned_type = EmitSub(cg, Left, Right, this.Access.TargetType);
break;
case Operations.Div:
//Template: "x / y"
returned_type = EmitDivision(cg);
break;
case Operations.Mul:
//Template: "x * y"
returned_type = EmitMultiply(cg);
break;
case Operations.Pow:
//Template: "x ** y"
returned_type = EmitPow(cg);
break;
case Operations.Mod:
//Template: "x % y" Operators.Remainder(x,y)
//codeGenerator.EmitBoxing(node.LeftExpr.Emit(codeGenerator));
//ro_typecode = node.RightExpr.Emit(codeGenerator);
//switch (ro_typecode)
//{
// case PhpTypeCode.Integer:
// returned_typecode = codeGenerator.EmitMethodCall(Methods.Operators.Remainder.Object_Int32);
// break;
// default:
// codeGenerator.EmitBoxing(ro_typecode);
// returned_typecode = codeGenerator.EmitMethodCall(Methods.Operators.Remainder.Object_Object);
// break;
//}
//break;
throw new NotImplementedException();
case Operations.ShiftLeft:
//// LOAD Operators.ShiftLeft(box left, box right);
//codeGenerator.EmitBoxing(node.LeftExpr.Emit(codeGenerator));
//codeGenerator.EmitBoxing(node.RightExpr.Emit(codeGenerator));
//returned_typecode = codeGenerator.EmitMethodCall(Methods.Operators.ShiftLeft);
//break;
throw new NotImplementedException();
case Operations.ShiftRight:
//// LOAD Operators.ShiftRight(box left, box right);
//codeGenerator.EmitBoxing(node.LeftExpr.Emit(codeGenerator));
//codeGenerator.EmitBoxing(node.RightExpr.Emit(codeGenerator));
//returned_typecode = codeGenerator.EmitMethodCall(Methods.Operators.ShiftRight);
//break;
throw new NotImplementedException();
#endregion
#region Boolean and Bitwise Operations
case Operations.And:
returned_type = EmitBinaryBooleanOperation(cg, true);
break;
case Operations.Or:
returned_type = EmitBinaryBooleanOperation(cg, false);
break;
case Operations.Xor:
returned_type = EmitBinaryXor(cg);
break;
case Operations.BitAnd:
returned_type = EmitBitAnd(cg, Left, Right);
break;
case Operations.BitOr:
returned_type = EmitBitOr(cg, Left, Right);
//.........这里部分代码省略.........