Ejemplo n.º 1
0
        public string ParseInstruction()
        {
            StringBuilder sb = new StringBuilder("\t");

            sb.Append(LRefHelper.GetIdentifierOf(Result)).Append(" = ").Append(LKeywords.Zext);
            sb.Append(Value.ParseType()).Append(" ").Append(LRefHelper.GetValueOrIdentifierOf(Value));
            sb.Append(" ").Append(LKeywords.To).Append(" ").Append(Result.ParseType());
            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public string ParseInstruction()
        {
            StringBuilder sb = new StringBuilder("\t");

            sb.Append(LRefHelper.GetIdentifierOf(Result));
            sb.Append(" = ").Append(LKeywords.Icmp).Append(" ");
            sb.Append(Condition.Parse()).Append(" ");
            sb.Append(Result.ParseType()).Append(" ");
            sb.Append(LRefHelper.GetValueOrIdentifierOf(Op1)).Append(", ");
            sb.Append(LRefHelper.GetValueOrIdentifierOf(Op2));
            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public string ParseInstruction()
        {
            if (RetValue.IsValue() && RetValue.BaseType.IsPrimitiveType() &&
                RetValue.BaseType.CheckedCast <LPrimitiveType>().Type == LPrimitiveTypes.@void)
            {
                return($"\t{LKeywords.Ret} {LKeywords.Void}");
            }

            StringBuilder sb = new StringBuilder("\t");

            sb.Append(LKeywords.Ret).Append(" ");
            sb.Append(RetValue.ParseType()).Append(" ").Append(LRefHelper.GetValueOrIdentifierOf(RetValue));
            return(sb.ToString());
        }