summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-11-21 12:05:18 -0800
committerDavid Terei <davidterei@gmail.com>2011-11-22 11:06:18 -0800
commit7b594a5d7ac29972db39228e9c8b7f384313f39b (patch)
treec486d9f4923dca37f59bbe3651891c1c30e93996 /driver
parent1c9af8558ee1573843bc56103bb165609bc3b047 (diff)
downloadhaskell-7b594a5d7ac29972db39228e9c8b7f384313f39b.tar.gz
Remove registerised code for dead architectures: mips, ia64, alpha,
hppa1, m68k
Diffstat (limited to 'driver')
-rw-r--r--driver/split/ghc-split.lprl189
1 files changed, 1 insertions, 188 deletions
diff --git a/driver/split/ghc-split.lprl b/driver/split/ghc-split.lprl
index 0a7a7215bc..dd12a8aed5 100644
--- a/driver/split/ghc-split.lprl
+++ b/driver/split/ghc-split.lprl
@@ -19,10 +19,8 @@ print OUTPUT "$NoOfSplitFiles\n";
close(OUTPUT);
exit(0);
-\end{code}
-\begin{code}
sub split_asm_file {
local($asm_file) = @_;
my @pieces = ();
@@ -223,13 +221,9 @@ sub process_asm_block {
return(&process_asm_block_darwin($str))
if $TargetPlatform =~ /-apple-darwin/m;
- return(&process_asm_block_m68k($str)) if $TargetPlatform =~ /^m68k-/m;
return(&process_asm_block_sparc($str)) if $TargetPlatform =~ /^sparc-/m;
return(&process_asm_block_iX86($str)) if $TargetPlatform =~ /^i[34]86-/m;
return(&process_asm_block_x86_64($str)) if $TargetPlatform =~ /^x86_64-/m;
- return(&process_asm_block_alpha($str)) if $TargetPlatform =~ /^alpha-/m;
- return(&process_asm_block_hppa($str)) if $TargetPlatform =~ /^hppa/m;
- return(&process_asm_block_mips($str)) if $TargetPlatform =~ /^mips-/m;
return(&process_asm_block_powerpc_linux($str))
if $TargetPlatform =~ /^powerpc-[^-]+-linux/m;
@@ -276,82 +270,6 @@ sub process_asm_block_sparc {
$str;
}
-sub process_asm_block_m68k {
- local($str) = @_;
-
- # strip the marker
-
- $str =~ s/(\.text\n\t\.even\n)\t\.globl\s+.*_?__stg_split_marker.*\n/$1/m;
- $str =~ s/(\t\.even\n)\t\.globl\s+.*_?__stg_split_marker.*\n/$1/m;
-
- # it seems prudent to stick on one of these:
- $str = "\.text\n\t.even\n" . $str;
-
- # remove/record any literal constants defined here
- while ( $str =~ /((LC\d+):\n\t\.ascii.*\n)/m ) {
- local($label) = $2;
- local($body) = $1;
-
- &tidy_up_and_die(1,"Local constant label $label already defined!\n")
- if $LocalConstant{$label};
-
- $LocalConstant{$label} = $body;
-
- $str =~ s/LC\d+:\n\t\.ascii.*\n//m;
- }
-
- # inject definitions for any local constants now used herein
- foreach $k (keys %LocalConstant) {
- if ( $str =~ /\b$k\b/m ) {
- $str = $LocalConstant{$k} . $str;
- }
- }
-
- print STDERR "### STRIPPED BLOCK (m68k):\n$str" if $Dump_asm_splitting_info;
-
- $str;
-}
-
-sub process_asm_block_alpha {
- local($str) = @_;
-
- # strip the marker
- if ( $OptimiseC ) {
- $str =~ s/_?__stg_split_marker.*:\n//m;
- } else {
- $str =~ s/(\t\.align .\n)\t\.globl\s+.*_?__stg_split_marker.*\n\t\.ent.*\n/$1/m;
- }
-
- # remove/record any literal constants defined here
- while ( $str =~ /(\.rdata\n\t\.align \d\n)?(\$(C\d+):\n\t\..*\n)/m ) {
- local($label) = $3;
- local($body) = $2;
-
- &tidy_up_and_die(1,"Local constant label $label already defined!\n")
- if $LocalConstant{$label};
-
- $LocalConstant{$label} = ".rdata\n\t.align 3\n" . $body . "\t.text\n";
-
- $str =~ s/(\.rdata\n\t\.align \d\n)?\$C\d+:\n\t\..*\n//m;
- }
-
- # inject definitions for any local constants now used herein
- foreach $k (keys %LocalConstant) {
- if ( $str =~ /\$\b$k\b/m ) {
- $str = $LocalConstant{$k} . $str;
- }
- }
-
- # Slide the dummy direct return code into the vtbl .ent/.end block,
- # to keep the label fixed if it's the last thing in a module, and
- # to avoid having any anonymous text that the linker will complain about
- $str =~ s/(\t\.end [A-Za-z0-9_]+)\n\t# nop/\tnop\n$1/gm;
-
- print STDERR "### STRIPPED BLOCK (alpha):\n$str" if $Dump_asm_splitting_info;
-
- $str;
-}
-
sub process_asm_block_iX86 {
local($str) = @_;
@@ -395,9 +313,7 @@ sub process_asm_block_iX86 {
$str;
}
-\end{code}
-\begin{code}
sub process_asm_block_x86_64 {
local($str) = @_;
@@ -433,107 +349,7 @@ sub process_asm_block_x86_64 {
$str;
}
-\end{code}
-
-\begin{code}
-sub process_asm_block_hppa {
- local($str) = @_;
- # strip the marker
- $str =~ s/___stg_split_marker.*\n//m;
-
- # remove/record any imports defined here
- while ( $str =~ /^(\s+\.IMPORT\s.*\n)/m ) {
- $Imports .= $1;
-
- $str =~ s/^\s+\.IMPORT.*\n//m;
- }
-
- # remove/record any literal constants defined here
- while ( $str =~ /^(\s+\.align.*\n(L\$C\d+)\n(\s.*\n)+); end literal\n/m ) {
- local($label) = $2;
- local($body) = $1;
- local($prefix) = $`;
- local($suffix) = $';
- $label =~ s/\$/\\\$/gm;
-
- &tidy_up_and_die(1,"Local constant label $label already defined!\n")
- if $LocalConstant{$label};
-
- $LocalConstant{$label} = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$LIT\$\n\n" . $body;
-
- $str = $prefix . $suffix;
- }
-
- # inject definitions for any local constants now used herein
- foreach $k (keys %LocalConstant) {
- if ( $str =~ /\b$k\b/m ) {
- $str = $LocalConstant{$k} . $str;
- }
- }
-
- # inject required imports for local exports in other chunks
- foreach $k (keys %LocalExport) {
- if ( $str =~ /\b$k\b/m && ! /EXPORT\s+$k\b/m ) {
- $str = $LocalExport{$k} . $str;
- }
- }
-
- # inject collected imports
-
- $str = $Imports . $str;
-
- print STDERR "### STRIPPED BLOCK (hppa):\n$str" if $Dump_asm_splitting_info;
-
- $str;
-}
-\end{code}
-
-\begin{code}
-sub process_asm_block_mips {
- local($str) = @_;
-
- # strip the marker
- if ( $OptimiseC ) {
- $str =~ s/_?__stg_split_marker.*:\n//m;
- } else {
- $str =~ s/(\t\.align .\n)\t\.globl\s+.*_?__stg_split_marker.*\n\t\.ent.*\n/$1/m;
- }
-
- # remove/record any literal constants defined here
- while ( $str =~ /(\t\.rdata\n\t\.align \d\n)?^(\$(LC\d+):\n(\t\.byte\t.*\n)+)/m ) {
- local($label) = $3;
- local($body) = $2;
-
- &tidy_up_and_die(1,"Local constant label $label already defined!\n")
- if $LocalConstant{$label};
-
- $LocalConstant{$label} = "\t.rdata\n\t.align 2\n" . $body . "\t.text\n";
-
- $str =~ s/(\t\.rdata\n\t\.align \d\n)?\$LC\d+:\n(\t\.byte\t.*\n)+//m;
- }
-
- # inject definitions for any local constants now used herein
- foreach $k (keys %LocalConstant) {
- if ( $str =~ /\$\b$k\b/m ) {
- $str = $LocalConstant{$k} . $str;
- }
- }
-
- # Slide the dummy direct return code into the vtbl .ent/.end block,
- # to keep the label fixed if it's the last thing in a module, and
- # to avoid having any anonymous text that the linker will complain about
- $str =~ s/(\t\.end [A-Za-z0-9_]+)\n\t# nop/\tnop\n$1/gm;
-
- $str .= $UNDEFINED_FUNS; # pin on gratuitiously-large amount of info
-
- print STDERR "### STRIPPED BLOCK (mips):\n$str" if $Dump_asm_splitting_info;
-
- $str;
-}
-\end{code}
-
-\begin{code}
# The logic for both Darwin/PowerPC and Darwin/x86 ends up being the same.
sub process_asm_block_darwin {
@@ -579,9 +395,7 @@ sub process_asm_block_darwin {
$str;
}
-\end{code}
-\begin{code}
sub process_asm_block_powerpc_linux {
local($str) = @_;
@@ -610,12 +424,11 @@ sub process_asm_block_powerpc_linux {
$str;
}
-\end{code}
-\begin{code}
sub tidy_up_and_die {
local($return_val, $msg) = @_;
print STDERR $msg;
exit (($return_val == 0) ? 0 : 1);
}
\end{code}
+