internal WebAssemblyCodegenCompilation(
            DependencyAnalyzerBase <NodeFactory> dependencyGraph,
            WebAssemblyCodegenNodeFactory nodeFactory,
            IEnumerable <ICompilationRootProvider> roots,
            ILProvider ilProvider,
            DebugInformationProvider debugInformationProvider,
            Logger logger,
            WebAssemblyCodegenConfigProvider options)
            : base(dependencyGraph, nodeFactory, GetCompilationRoots(roots, nodeFactory), ilProvider, debugInformationProvider, null, logger)
        {
            NodeFactory = nodeFactory;
            LLVMModuleRef m = LLVMModuleRef.CreateWithName("netscripten");

            m.Target = "wasm32-unknown-unknown-wasm";
            // https://llvm.org/docs/LangRef.html#langref-datalayout
            // e litte endian, mangled names
            // m:e ELF mangling
            // p:32:32 pointer size 32, abi 32
            // i64:64 64 ints aligned 64
            // n:32:64 native widths
            // S128 natural alignment of stack
            m.DataLayout = "e-m:e-p:32:32-i64:64-n32:64-S128";
            Module       = m;

            Options          = options;
            DIBuilder        = Module.CreateDIBuilder();
            DebugMetadataMap = new Dictionary <string, DebugMetadata>();
        }
Esempio n. 2
0
 internal WebAssemblyCodegenCompilation(
     DependencyAnalyzerBase <NodeFactory> dependencyGraph,
     NodeFactory nodeFactory,
     IEnumerable <ICompilationRootProvider> roots,
     Logger logger,
     WebAssemblyCodegenConfigProvider options)
     : base(dependencyGraph, nodeFactory, GetCompilationRoots(roots, nodeFactory), null, logger)
 {
     LLVM.LoadLibrary_libLLVM("./libLLVM-x64.dll");
     Module = LLVM.ModuleCreateWithName("netscripten");
     LLVM.SetTarget(Module, "asmjs-unknown-emscripten");
     Options = options;
 }
Esempio n. 3
0
 internal WebAssemblyCodegenCompilation(
     DependencyAnalyzerBase <NodeFactory> dependencyGraph,
     WebAssemblyCodegenNodeFactory nodeFactory,
     IEnumerable <ICompilationRootProvider> roots,
     DebugInformationProvider debugInformationProvider,
     Logger logger,
     WebAssemblyCodegenConfigProvider options)
     : base(dependencyGraph, nodeFactory, GetCompilationRoots(roots, nodeFactory), debugInformationProvider, null, logger)
 {
     NodeFactory = nodeFactory;
     Module      = LLVM.ModuleCreateWithName("netscripten");
     LLVM.SetTarget(Module, "asmjs-unknown-emscripten");
     Options          = options;
     DIBuilder        = LLVMPInvokes.LLVMCreateDIBuilder(Module);
     DebugMetadataMap = new Dictionary <string, DebugMetadata>();
 }
 public override CompilationBuilder UseBackendOptions(IEnumerable <string> options)
 {
     _config = new WebAssemblyCodegenConfigProvider(options);
     return(this);
 }