Exemplo n.º 1
0
 public static LLVMType GetBaseType(string sType)
 {
     if (sType[0] == 'i')
     {
         int          bitsize = int.Parse(sType.Substring(1));
         LLVMBaseType i;
         if (!intTypes.TryGetValue(bitsize, out i))
         {
             i = new LLVMBaseType(sType, Domain.Integral, bitsize);
             intTypes.Add(bitsize, i);
         }
         return(i);
     }
     throw new NotImplementedException();
 }
Exemplo n.º 2
0
 public DataType VisitBaseType(LLVMBaseType b)
 {
     switch (b.Domain)
     {
     case Domain.Integral:
         if (b.BitSize == 1)
             return PrimitiveType.Bool;
         else 
             return PrimitiveType.CreateWord(b.BitSize / 8);
     case Domain.Real:
         return PrimitiveType.Create(Core.Types.Domain.Real, b.BitSize / 8);
     case Domain.Void:
         return VoidType.Instance;
     }
     throw new NotImplementedException(string.Format("{0}", b));
 }
Exemplo n.º 3
0
 static LLVMType()
 {
     Void     = new LLVMBaseType("void", Domain.Void, 0);
     Double   = new LLVMBaseType("double", Domain.Real, 64);
     X86_fp80 = new LLVMBaseType("x86_fp80", Domain.Real, 80);
 }