From: simonmar Date: Wed, 9 Feb 2005 15:25:12 +0000 (+0000) Subject: [project @ 2005-02-09 15:25:12 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1095 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=bd3ac0d73e5ec89fe28405fcd202daa25d703f72 [project @ 2005-02-09 15:25:12 by simonmar] Keep .type/.size directives for _entry symbols, but rename them to _info. This helps cachegrind to find where my instructions are going. --- diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index e616a6c..5d5676c 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -1216,8 +1216,23 @@ sub mangle_asm { # If this is an entry point with an info table, # eliminate the entry symbol and all directives involving it. if (defined($infochk{$symb}) && $TargetPlatform !~ /^ia64-/) { - $c =~ s/^.*$symb_(entry|ret)${T_POST_LBL}\n//; - $c =~ s/^\s*\..*$symb.*\n//g; + @o = (); + foreach $l (split(/\n/,$c)) { + next if $l =~ /^.*$symb_(entry|ret)${T_POST_LBL}/; + + # If we have .type/.size direrctives involving foo_entry, + # then make them refer to foo_info instead. The information + # in these directives is used by the cachegrind annotator, + # so it is worthwhile keeping. + if ($l =~ /^\s*\.(type|size).*$symb_(entry|ret)/) { + $l =~ s/$symb(_entry|_ret)/${symb}_info/g; + push(@o,$l); + next; + } + next if $l =~ /^\s*\..*$symb.*\n/; + push(@o,$l); + } + $c = join("\n",@o) . "\n"; } print OUTASM $T_HDR_entry;