Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dotnet] Add building of NQP optimizer to the Makefile. Currently all…
… the stuff to use it in compile.pir is commented out though - if you want to test it, uncomment the three commented lines in this patch. At some point it should become a -O flag.
  • Loading branch information
jnthn committed Nov 21, 2010
1 parent 6fd5926 commit a6d8d72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dotnet/compiler/Makefile
@@ -1,13 +1,16 @@
# This works provided you have a parrot-nqp and csc somewhere in your path.

all: gen_actions.pir gen_grammar.pir gen_dnst.pir gen_past2dnst.pir gen_dnst2csharp.pir NQPSetting.dll P6Objects.dll
all: gen_actions.pir gen_grammar.pir gen_nqpoptimizer.pir gen_dnst.pir gen_past2dnst.pir gen_dnst2csharp.pir NQPSetting.dll P6Objects.dll

gen_actions.pir: Actions.pm
parrot-nqp --target=pir Actions.pm > gen_actions.pir

gen_grammar.pir: Grammar.pm
parrot-nqp --target=pir Grammar.pm > gen_grammar.pir

gen_nqpoptimizer.pir: NQPOptimizer.pm
parrot-nqp --target=pir NQPOptimizer.pm > gen_nqpoptimizer.pir

gen_dnst.pir: DNST.pm
parrot-nqp --target=pir DNST.pm > gen_dnst.pir

Expand All @@ -26,7 +29,7 @@ NQPSetting.dll: ../../common/NQP/NQPSetting.pm RakudoRuntime.dll
parrot compile.pir ../../common/NQP/NQPSetting.pm --setting > NQPSetting.cs
csc /nologo /warn:0 /target:library /debug /out:NQPSetting.dll /reference:RakudoRuntime.dll NQPSetting.cs

P6Objects.dll: gen_actions.pir gen_grammar.pir gen_dnst.pir gen_past2dnst.pir gen_dnst2csharp.pir ../../common/NQP/P6Objects.pm NQPSetting.dll
P6Objects.dll: gen_actions.pir gen_grammar.pir gen_nqpoptimizer.pir gen_dnst.pir gen_past2dnst.pir gen_dnst2csharp.pir ../../common/NQP/P6Objects.pm NQPSetting.dll
parrot compile.pir ../../common/NQP/P6Objects.pm --no-core-libs > P6Objects.cs
csc /nologo /warn:0 /target:library /debug /out:P6Objects.dll /reference:RakudoRuntime.dll P6Objects.cs

Expand Down
5 changes: 4 additions & 1 deletion dotnet/compiler/compile.pir
Expand Up @@ -9,6 +9,7 @@
.include 'gen_past2dnst.pir'
.include 'gen_dnst2csharp.pir'
.loadlib 'io_ops'
#.include 'gen_nqpoptimizer.pir'

.sub 'main' :main
.param pmc args
Expand All @@ -28,9 +29,10 @@
$P1 = 1
not_ncl:

.local pmc g, a, pastcomp, dnstcomp
.local pmc g, a, opt, pastcomp, dnstcomp
g = get_hll_global ['JnthnNQP'], 'Grammar'
a = get_hll_global ['JnthnNQP'], 'Actions'
# opt = get_hll_global 'NQPOptimizer'
pastcomp = get_hll_global 'PAST2DNSTCompiler'
dnstcomp = get_hll_global 'DNST2CSharpCompiler'

Expand All @@ -44,6 +46,7 @@
.local pmc match, ast, dnst, compiled
match = g.'parse'(file, 'actions'=>a)
ast = match.'ast'()
# opt.'optimize'(ast)
dnst = pastcomp.'compile'(ast)
compiled = dnstcomp.'compile'(dnst)
say compiled
Expand Down

0 comments on commit a6d8d72

Please sign in to comment.