From: Rudolf Polzer Date: Wed, 2 May 2012 08:34:00 +0000 (+0200) Subject: print warning with instruction X-Git-Tag: xonotic-v0.7.0~55^2~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b6f053a53151df4b19e35522a73772e0e55a5b70;p=xonotic%2Fxonotic.git print warning with instruction --- diff --git a/misc/tools/progs-analyzer.pl b/misc/tools/progs-analyzer.pl index 95a66132..9f45e52a 100644 --- a/misc/tools/progs-analyzer.pl +++ b/misc/tools/progs-analyzer.pl @@ -484,6 +484,20 @@ sub disassemble_function($$;$) my $ipt = $progs->{statements}[$ip]; my $opprop = checkop $op; + if($highlight and $highlight->{$ip}) + { + for(values %{$highlight->{$ip}}) + { + for(@$_) + { + print PRE_MARK_STATEMENT; + printf INSTRUCTION_FORMAT, '', '', '.WARN'; + printf OPERAND_FORMAT, "$_ (in $func->{debugname})"; + print INSTRUCTION_SEPARATOR; + } + } + } + print PRE_MARK_STATEMENT if $highlight and $highlight->{$ip}; @@ -694,8 +708,7 @@ sub find_uninitialized_locals($$) # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) { - print "; Use of uninitialized value $ofs in $func->{debugname} at $ip.$_\n"; - ++$warned{$ip}{$_}; + push @{$warned{$ip}{$_}}, "Use of uninitialized value"; } } elsif($valid->[0] < 0) @@ -703,8 +716,7 @@ sub find_uninitialized_locals($$) # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) { - print "; Use of temporary $ofs across CALL in $func->{debugname} at $ip.$_\n"; - ++$warned{$ip}{$_}; + push @{$warned{$ip}{$_}}, "Use of temporary across CALL"; } } else @@ -831,8 +843,7 @@ sub find_uninitialized_locals($$) if(!$isread) { - print "; Value is never used in $func->{debugname} at $ip.$operand\n"; - ++$warned{$ip}{$operand}; + push @{$warned{$ip}{$operand}}, "Value is never used"; } } }