Exemplo n.º 1
0
        public void CompileAndExecuteFunction(CompilerTestBase test, DfirRoot function)
        {
#if LLVM_TEST
            const string     compiledFunctionName = "test";
            LLVMSharp.Module compiledFunction     = test.RunSemanticAnalysisUpToLLVMCodeGeneration(function, compiledFunctionName);
            _context.LoadFunction(compiledFunction);
            _context.ExecuteFunctionTopLevel(compiledFunctionName);
#else
            Function compiledFunction = test.RunSemanticAnalysisUpToCodeGeneration(function);
            _context.LoadFunction(compiledFunction);
            _context.FinalizeLoad();
            _context.ExecuteFunctionTopLevel(compiledFunction.Name);
#endif
        }