Skip to content

Commit

Permalink
Merge branch 'main' into libllvm
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldnevermore committed Mar 17, 2021
2 parents 6083c2a + eff292e commit 59b2344
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Kaleidoscope/IREmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ private void InitializeModule()

public void Run(List<Expression> exprs)
{
InitializeModule();
var ctx = new Context();
foreach (var item in exprs)
{
InitializeModule();
var ctx = new Context();
var (ctxn, v) = Visit(ctx, item);
if (item is FunctionExpression f && string.IsNullOrWhiteSpace(f.Proto.Name))
{
Expand All @@ -119,10 +119,10 @@ public void Run(List<Expression> exprs)
Console.WriteLine("> {0}", fres);
}
ctx = ctxn;
_passManager.Dispose();
_builder.Dispose();
_module.Dispose();
}
_passManager.Dispose();
_builder.Dispose();
_module.Dispose();
}

private (Context, LLVMValueRef) Visit(Context ctx, Expression body)
Expand Down

0 comments on commit 59b2344

Please sign in to comment.