Copy
[mono.git] / mono / mini / helpers.c
index 29dc782d65f986646248c249b56c1643e94e4355..1b17098ec5db040dc6fb631693b1ee8c3839a773 100644 (file)
 #ifdef MINI_OP
 #undef MINI_OP
 #endif
+#ifdef MINI_OP3
+#undef MINI_OP3
+#endif
 
 #ifdef HAVE_ARRAY_ELEM_INIT
 #define MSGSTRFIELD(line) MSGSTRFIELD1(line)
 #define MSGSTRFIELD1(line) str##line
 static const struct msgstr_t {
 #define MINI_OP(a,b,dest,src1,src2) char MSGSTRFIELD(__LINE__) [sizeof (b)];
+#define MINI_OP3(a,b,dest,src1,src2,src3) char MSGSTRFIELD(__LINE__) [sizeof (b)];
 #include "mini-ops.h"
 #undef MINI_OP
+#undef MINI_OP3
 } opstr = {
 #define MINI_OP(a,b,dest,src1,src2) b,
+#define MINI_OP3(a,b,dest,src1,src2,src3) b,
 #include "mini-ops.h"
 #undef MINI_OP
+#undef MINI_OP3
 };
 static const gint16 opidx [] = {
 #define MINI_OP(a,b,dest,src1,src2) [a - OP_LOAD] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)),
+#define MINI_OP3(a,b,dest,src1,src2,src3) [a - OP_LOAD] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)),
 #include "mini-ops.h"
 #undef MINI_OP
+#undef MINI_OP3
 };
 
 #else
 
 #define MINI_OP(a,b,dest,src1,src2) b,
+#define MINI_OP3(a,b,dest,src1,src2,src3) b,
 /* keep in sync with the enum in mini.h */
 static const char* const
 opnames[] = {
 #include "mini-ops.h"
 };
 #undef MINI_OP
+#undef MINI_OP3
 
 #endif
 
@@ -120,7 +131,9 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
 #endif
 
        for (i = 0; id [i]; ++i) {
-               if (!isalnum (id [i]))
+               if (i == 0 && isdigit (id [i]))
+                       fprintf (ofd, "_");
+               else if (!isalnum (id [i]))
                        fprintf (ofd, "_");
                else
                        fprintf (ofd, "%c", id [i]);
@@ -180,8 +193,12 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
 #if defined(sparc)
 #define AS_CMD "as -xarch=v9"
 #elif defined(__i386__) || defined(__x86_64__)
-#define AS_CMD "as -gstabs"
-#elif defined(__mips__)
+#  if defined(__APPLE__)
+#    define AS_CMD "as"
+#  else
+#    define AS_CMD "as -gstabs"
+#endif
+#elif defined(__mips__) && (_MIPS_SIM == _ABIO32)
 #define AS_CMD "as -mips32"
 #elif defined(__ppc64__)
 #define AS_CMD "as -arch ppc64"