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(); }
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)); }
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); }