コード例 #1
0
		public static void EmitCompareEq(IRTranslator tr, ASTType type, IIROperand a, IIROperand b) {
			if (type == ASTType.O || type == ASTType.ByRef ||
			    type == ASTType.R4 || type == ASTType.R8) {
				tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
			}
			else {
				// I4/I8/Ptr
				Debug.Assert(type == ASTType.I4 || type == ASTType.I8 || type == ASTType.Ptr);
				tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
			}
		}
コード例 #2
0
        public static void EmitCompareEq(IRTranslator tr, ASTType type, IIROperand a, IIROperand b)
        {
            switch (type)
            {
            case ASTType.O:
            case ASTType.ByRef:
            case ASTType.R4:
            case ASTType.R8:
                tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
                break;

            default:
                // I4/I8/Ptr
                Debug.Assert(type == ASTType.I4 || type == ASTType.I8 || type == ASTType.Ptr);
                tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
                break;
            }
        }