replaced inline by __inline to allow to be compiled in gcc and msvc modes
[libfirm] / ir / be / scripts / generate_machine.pl
index 296b796..f8f4ea0 100755 (executable)
@@ -1,5 +1,24 @@
 #!/usr/bin/perl -w
 
+#
+# Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+#
+# This file is part of libFirm.
+#
+# This file may be distributed and/or modified under the terms of the
+# GNU General Public License version 2 as published by the Free Software
+# Foundation and appearing in the file LICENSE.GPL included in the
+# packaging of this file.
+#
+# Licensees holding valid libFirm Professional Edition licenses may use
+# this file in accordance with the libFirm Commercial License.
+# Agreement provided with the Software.
+#
+# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE.
+#
+
 # This script generates the data structures for the machine description.
 # Creation: 2006/10/20
 # $Id$
@@ -20,9 +39,9 @@ my $return;
 
 no strict "subs";
 unless ($return = do $specfile) {
-       warn "couldn't parse $specfile: $@" if $@;
-       warn "couldn't do $specfile: $!"    unless defined $return;
-       warn "couldn't run $specfile"       unless $return;
+       die "couldn't parse $specfile: $@" if $@;
+       die "couldn't do $specfile: $!"    unless defined $return;
+       die "couldn't run $specfile"       unless $return;
 }
 use strict "subs";
 
@@ -62,6 +81,7 @@ foreach my $unit_type (keys(%cpu)) {
        push(@obst_unit_tp_defs, "\t$tp_name,\n");
        push(@obst_init, "\n\t\t/* init of execution unit type $tp_name */\n");
        push(@obst_init, "\t\tcur_unit_tp = &$arch\_execution_unit_types[$tp_name];\n");
+       push(@obst_init, "\t\t(void) cur_unit_tp; /* avoid warning */\n");
 
        push(@obst_unit_defs, "/* enum for execution units of type $unit_type */\n");
        push(@obst_unit_defs, "enum $arch\_execunit_tp_$unit_type\_vals {\n");
@@ -83,16 +103,16 @@ open(OUT, ">$target_h") || die("Could not open $target_h, reason: $!\n");
 my $creation_time = localtime(time());
 
 print OUT<<EOF;
-#ifndef _GEN_$tmp\_MACHINE_H_
-#define _GEN_$tmp\_MACHINE_H_
-
 /**
- * Function prototypes for the machine description.
- * DO NOT EDIT THIS FILE, your changes will be lost.
- * Edit $specfile instead.
- * created by: $0 $specfile $target_dir
- * date:       $creation_time
+ * \@file
+ * \@brief     Function prototypes for the machine description.
+ * \@note      DO NOT EDIT THIS FILE, your changes will be lost.
+ *            Edit $specfile instead.
+ *            created by: $0 $specfile $target_dir
+ * \@date      $creation_time
  */
+#ifndef FIRM_BE_${tmp}_GEN_${tmp}_MACHINE_H
+#define FIRM_BE_${tmp}_GEN_${tmp}_MACHINE_H
 
 #include "../bemachine.h"
 
@@ -109,7 +129,7 @@ print OUT @obst_unit_defs;
 
 print OUT<<EOF;
 
-#endif /* _GEN_$tmp\_MACHINE_H_ */
+#endif
 
 EOF
 
@@ -121,11 +141,12 @@ $creation_time = localtime(time());
 
 print OUT<<EOF;
 /**
- * Generated functions for machine description interface.
- * DO NOT EDIT THIS FILE, your changes will be lost.
- * Edit $specfile instead.
- * created by: $0 $specfile $target_dir
- * date:       $creation_time
+ * \@file
+ * \@brief     Generated functions for machine description interface.
+ * \@note      DO NOT EDIT THIS FILE, your changes will be lost.
+ *            Edit $specfile instead.
+ *            created by: $0 $specfile $target_dir
+ * \@date      $creation_time
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -162,6 +183,7 @@ const be_machine_t *$arch\_init_machine_description(void) {
 
        if (! initialized) {
                be_execution_unit_type_t *cur_unit_tp;
+               (void) cur_unit_tp; /* avoid warning */
 
                be_machine_init_dummy_unit();
 EOF