X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fghc-iface.lprl;h=f452fa10210497699e9a45d24f7383c24390ff77;hb=5a21d20b0f25de3d829de90d219cb66855f91d58;hp=71b5d3c94362e1b559d389bb570ff9c1226c6ecf;hpb=ed974e41e3dd1acd24e2ef816b104ff66ea720ee;p=ghc-hetmet.git diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl index 71b5d3c..f452fa1 100644 --- a/ghc/driver/ghc-iface.lprl +++ b/ghc/driver/ghc-iface.lprl @@ -153,18 +153,17 @@ sub constructNewHiFile { } local($new_module_version) = &calcNewModuleVersion(@decl_names); - print NEWHI "__interface ", $ModuleName{'new'}, " $new_module_version $Orphan{'new'} $ProjectVersionInt where\n"; + print NEWHI "__interface ", $PackageName{'new'}, $ModuleName{'new'}, " $new_module_version $Orphan{'new'} $ProjectVersionInt where\n"; print NEWHI $Stuff{'new:exports'}; print NEWHI $Stuff{'new:usages'} unless $Stuff{'new:usages'} eq ''; print NEWHI $Stuff{'new:instances'} unless $Stuff{'new:instances'} eq ''; - print STDERR @decl_names ; - foreach $v (@decl_names) { &printNewItemVersion(NEWHI, $v, $new_module_version, $show_hi_diffs); # Print new version number print NEWHI $Decl{"new:$v"}; # Print the new decl itself } print NEWHI $Stuff{'new:rules'} unless $Stuff{'new:rules'} eq ''; + print NEWHI $Stuff{'new:deprecations'} unless $Stuff{'new:deprecations'} eq ''; close(NEWHI) || &tidy_up_and_die(1,"Failed writing to $new_hi\n"); } @@ -200,6 +199,7 @@ sub readHiFile { $Stuff{"$mod:instances"} = ''; $Stuff{"$mod:declarations"} = ''; $Stuff{"$mod:rules"} = ''; + $Stuff{"$mod:deprecations"} = ''; if (! -f $hifile) { # no pre-existing .hi file $HiExists{$mod} = 0; @@ -211,14 +211,15 @@ sub readHiFile { hi_line: while () { next if /^ *$/; # blank line - if ( /^__interface ([A-Z]\S*) (\d+)( \!)?/ ) { + if ( /^__interface ("[A-Za-z]*"\s*)([A-Z]\S*)\s+(\d+)?\s*(\!)?/ ) { if ( $mod ne 'new' ) { # Reading old .hi file - $ModuleVersion{$mod} = $2; + $ModuleVersion{$mod} = $3; } - $ModuleName{$mod} = $1; # used to decide name of iface file. - $Orphan{$mod} = $3; + $PackageName{$mod} = $1; + $ModuleName{$mod} = $2; # used to decide name of iface file. + $Orphan{$mod} = $4; # optional "!" indicates that the # module contains orphan rules or instance decls @@ -234,6 +235,9 @@ sub readHiFile { } elsif ( /^{-## __R / ) { $Stuff{"$mod:rules"} .= $_; + } elsif ( /^{-## __D / ) { + $Stuff{"$mod:deprecations"} .= $_; + } elsif ( /^-[-]+ .*/ ) { # silently ignore comment lines. ; } else { # We're in a declaration @@ -316,7 +320,7 @@ sub calcNewModuleVersion { return(&mv_change($changed_version, "orphan-hood changed")); } - foreach $t ( 'usages' , 'exports', 'instances', 'fixities', 'rules' ) { + foreach $t ( 'usages' , 'exports', 'instances', 'fixities', 'rules', 'deprecations' ) { return(&mv_change($changed_version,"$t changed")) if $Stuff{"old:$t"} ne $Stuff{"new:$t"}; }