[libav-devel] [PATCH 11/20] Factorize code for checking whether a label is a register

Martin Storsjo martin at martin.st
Mon Mar 24 13:38:02 CET 2014


---
 gas-preprocessor.pl | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 27a84b7..3bdc7dd 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -605,6 +605,16 @@ my %labels_seen;
 
 my %aarch64_req_alias;
 
+sub is_register {
+    my $name = $_[0];
+    if ($name eq "lr" or
+        $name eq "ip" or
+        $name =~ /^[rav]\d+$/) {
+        return 1;
+    }
+    return 0;
+}
+
 # pass 2
 foreach my $line (@pass1_lines) {
     # handle .previous (only with regard to .section not .subsection)
@@ -836,9 +846,7 @@ foreach my $line (@pass1_lines) {
                     push(@{$next_temp_labels{$num}}, $name);
                     $line =~ s/$target/$name/;
                 }
-            } elsif ($target ne "lr" and
-                     $target ne "ip" and
-                     $target !~ /^[rav]\d+$/) {
+            } elsif (!is_register($target)) {
                 $call_targets{$target}++;
             }
         }
-- 
1.8.5.2 (Apple Git-48)



More information about the libav-devel mailing list