Permalink
Browse files

Update compiler driver to use new backend

  • Loading branch information...
1 parent ae2b965 commit a52a66cc4cbc842ba528c6592da66b622d35ce24 @sorear committed Dec 24, 2010
Showing with 8 additions and 28 deletions.
  1. +3 −9 niecza_eval
  2. +5 −19 src/CompilerDriver.pm
View
12 niecza_eval
@@ -21,7 +21,6 @@ my $aot;
my $lang = 'CORE';
my $setting;
my $safe;
-my $genapp;
sub usage {
my ($fh, $ex) = @_;
@@ -35,7 +34,6 @@ usage: niecza -e 'code' # run a one-liner
general options:
-L --language=NAME # select your setting
- --gen-app=EXEFILE # make self-contained binary (not with -c)
--setting # precompile target is a setting
-v --stage-stats # detailed timing info
--stop-after=STAGE # stop after STAGE and dump AST
@@ -46,7 +44,7 @@ EOM
}
GetOptions('evaluate|e=s' => \@evaluate, 'aot' => \$aot,
- 'gen-app=s' => \$genapp, 'compile|c' => \$module,
+ 'compile|c' => \$module,
'language|L=s' => \$lang, 'stage-stats|v' => \$stagestats,
'stop-after=s' => \$stopafter, 'safe' => \$safe, 'setting' => \$setting)
or usage(\*STDERR, 1);
@@ -58,18 +56,14 @@ if ($excl > 1 || $module && !@ARGV || $safe && ($lang ne 'CORE')) {
usage(\*STDERR, 1);
}
-if (defined($genapp) && $module) {
- usage(\*STDERR, 1);
-}
-
$lang = 'SAFE' if $safe;
sub run {
- compile(stopafter => $stopafter, aot => $aot, selfcontained => $genapp,
+ compile(stopafter => $stopafter, aot => $aot,
stagetime => $stagestats, lang => $lang, safe => $safe,
setting => $setting, @_);
system 'mono', CompilerDriver::build_file('MAIN.exe')
- if !({@_}->{name}) && !$stopafter && !$genapp;
+ if !({@_}->{name}) && !$stopafter;
}
if ($module) {
View
24 src/CompilerDriver.pm
@@ -236,25 +236,11 @@ sub compile {
store $ast, File::Spec->catfile($builddir, "$basename.store");
}
} ],
- [ 'gmcs', sub {
- my @args;
- if ($args{selfcontained}) {
- @args = ("gmcs", "/debug", "/unsafe+",
- "/out:" . $args{selfcontained},
- (map { File::Spec->catfile($libdir, $_) }
- "Kernel.cs", "Cursor.cs", "JSYNC.cs", "Builtins.cs", "NieczaCLR.cs"),
- (map { build_file($_ . ".cs") }
- (sort keys %{ $ast->tdeps })),
- $namfile);
- } else {
- @args = ("gmcs", "/debug",
- (defined($name) ? ("/target:library") : ()),
- "/lib:$builddir",
- "/r:Kernel.dll",
- (map { "/r:$_.dll" } sort keys %{ $ast->tdeps }),
- "/out:$outfile",
- $namfile);
- }
+ [ 'codegen', sub {
+ my @args = ("mono",
+ File::Spec->catfile($builddir, "CLRBackend.exe"), $builddir,
+ "$basename.nam", (defined($name) ? ("$basename.dll", "0") :
+ ("$basename.exe", "1")));
print STDERR "@args\n" if $args{stagetime};
system @args;
$ast = undef;

0 comments on commit a52a66c

Please sign in to comment.