[coop handles] Add mono_internal_thread_handle_ptr () function
[mono.git] / mono / cil / make-opcodes-def.pl
index 3114918bb6512267b93896dba71100d0be68413a..4a4c8cf55b8b212d80417fbf93e2fa7138c305b8 100644 (file)
@@ -19,10 +19,11 @@ my %valid_flow;
 # the XML file also includes "throw"
 @valid_flow{qw(next call return branch meta cond-branch)} = ();
 
-open OUTPUT, ">opcode.def" || die "Can not create opcode.def file: $!";
+open OUTPUT, ">$ARGV[1]" || die "Can not create $ARGV[1] file: $!";
 
 my $parser = new XML::Parser (Handlers => {Start => \&handle_opcode});
-$parser->parsefile("cil-opcodes.xml");
+print_header();
+$parser->parsefile($ARGV[0]);
 print_trailer();
 close(OUTPUT) || die "Can not close file: $!";
 
@@ -53,6 +54,12 @@ sub handle_opcode {
     
 }
 
+sub print_header {
+print OUTPUT<<EOF;
+/* GENERATED FILE, DO NOT EDIT */
+EOF
+}
+
 sub print_trailer {
 print OUTPUT<<EOF;
 #ifndef OPALIAS