public LLVMTypeResolver(JITContext context) { Context = context; _mapping = new Dictionary <string, Func <LLVMTypeRef> > { { TypeReferenceName.Boolean, LLVM.Int8Type }, { TypeReferenceName.SByte, LLVM.Int8Type }, { TypeReferenceName.Int8, LLVM.Int8Type }, { TypeReferenceName.Int16, LLVM.Int16Type }, { TypeReferenceName.Int32, LLVM.Int32Type }, { TypeReferenceName.Int64, LLVM.Int64Type }, { TypeReferenceName.Byte, LLVM.Int8Type }, { TypeReferenceName.UInt8, LLVM.Int8Type }, { TypeReferenceName.UInt16, LLVM.Int16Type }, { TypeReferenceName.UInt32, LLVM.Int32Type }, { TypeReferenceName.UInt64, LLVM.Int64Type }, { TypeReferenceName.Float, LLVM.FloatType }, { TypeReferenceName.Double, LLVM.DoubleType }, //TODO, on second thought... let's forget about .Net Decimal { TypeReferenceName.Decimal, LLVM.FP128Type }, { TypeReferenceName.Char, LLVM.Int8Type } }; }
public PearlCLR(string file, string target = null) { assembly = AssemblyDefinition.ReadAssembly(file); LLVM.InitializeX86TargetMC(); LLVM.InitializeX86Target(); LLVM.InitializeX86TargetInfo(); LLVM.InitializeX86AsmParser(); LLVM.InitializeX86AsmPrinter(); _context = new JITContext { CLR = this, ModuleRef = LLVM.ModuleCreateWithName("PearlCLRModule"), CLRLogger = LogManager.GetCurrentClassLogger() }; _context.ContextRef = LLVM.GetModuleContext(_context.ModuleRef); _context.TypeResolver = new LLVMTypeResolver(_context); _options = new JITCompilerOptions { MetadataFixedLength = 32, CLRStringMode = StringMode.CString, MetadataTypeHandlingModeOption = MetadataTypeHandlingMode.Full_Fixed }; _context.Options = _options; }
protected OpcodeHandlerModule(JITContext context) { Context = context; }
public LocalVariableOpcodeModule(JITContext context) : base(context) { }
public ComparsionOpcodeModule(JITContext context) : base(context) { }
public ConstantOpcodeModule(JITContext context) : base(context) { }
public ArithmeticOpcodeModule(JITContext context) : base(context) { }
public ParameterOpcodeModule(JITContext context) : base(context) { }
public MetaOpcodeModule(JITContext context) : base(context) { }