added get_next_ir_opcodes() to allow allocation of cosecutive opcodes
[libfirm] / tools / remove_cpp_comands.perl
index 56a8c2a..f9a7c49 100644 (file)
@@ -62,19 +62,34 @@ $scndlastline = "";
 $lastline = "";
 
 $eat = 0;
+$multiline = 0;
 
 foreach $line (@lines) {
 
     if ($line =~ /\#ifdef __cplusplus/) {
-#       There is extern "C" in firm.h, guarded by #ifdef __cplusplus
+#       There is extern "C" in some header files guarded by #ifdef __cplusplus
 #       crecoder does not grok the extern "C", so remove thses three lines.
        $eat = 2;
     } elsif ($eat > 0) {
        $eat = $eat -1;
-    } elsif (($line =~ /^\#/)   ) {
+    } elsif ($line =~ /wchar_t/) {
+       # of course crecoder cannot handle wchar_t, what else?
+    } elsif ($multiline > 0) {
+        # this line connects a previous one, kill it
+        if ($line =~ /\\$/) {
+          $multiline = 1;
+        } else {
+          $multiline = 0;
+        }
+    } elsif ($line =~ /^\#/) {
        # eat the line
        $scndlastline = $lastline;
        $lastline = $line;
+        if ($line =~ /\\$/) {
+          $multiline = 1;
+        } else {
+          $multiline = 0;
+        }
     } elsif ($openbracket == 1) {
        print TDF "$line";
        if ((index($line, "}") > -1)) {