Exemplo n.º 1
0
        private void GenInitializer(Symbol sym)
        {
            if (sym?.Initializer == null)
            {
                throw new ArgumentException();
            }

            LLVM.PositionBuilderAtEnd(this.builder, moduleInitializerBlock);

            var expr  = new ExpressionCompiler(this, builder, moduleInitializerFunction);
            var value = expr.Compile(sym.Initializer);

            LLVM.BuildStore(builder, value, symbols[sym]);
        }