Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git] / mono / mini / ir-emit.h
index ba9d6531367042081ba87410847ee375d5302d00..d535f25b6d311f3e566db35914720fb03e133f95 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * ir-emit.h: IR Creation/Emission Macros
+/**
+ * \file
+ * IR Creation/Emission Macros
  *
  * Author:
  *   Zoltan Varga (vargaz@gmail.com)
@@ -75,6 +76,12 @@ alloc_ireg_mp (MonoCompile *cfg)
        return vreg;
 }
 
+static inline guint32
+alloc_xreg (MonoCompile *cfg)
+{
+       return alloc_ireg (cfg);
+}
+
 static inline guint32
 alloc_dreg (MonoCompile *cfg, MonoStackType stack_type)
 {
@@ -303,15 +310,6 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type)
 
 #define NEW_LDTOKENCONST(cfg,dest,image,token,generic_context) NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_LDTOKEN, (image), (token), (generic_context), STACK_PTR, NULL)
 
-#define NEW_TLS_OFFSETCONST(cfg,dest,key) do { \
-       if (cfg->compile_aot) { \
-               NEW_AOTCONST ((cfg), (dest), MONO_PATCH_INFO_TLS_OFFSET, GINT_TO_POINTER (key)); \
-       } else {                                                                                                                        \
-               int _offset = mini_get_tls_offset ((key));                                                      \
-               NEW_PCONST ((cfg), (dest), GINT_TO_POINTER (_offset)); \
-               } \
-       } while (0)
-
 #define NEW_DECLSECCONST(cfg,dest,image,entry) do { \
                if (cfg->compile_aot) { \
                        NEW_AOTCONST_TOKEN (cfg, dest, MONO_PATCH_INFO_DECLSEC, image, (entry).index, NULL, STACK_OBJ, NULL); \
@@ -815,10 +813,12 @@ static int ccount = 0;
             ins->inst_false_bb = NULL; \
             mono_link_bblock ((cfg), (cfg)->cbb, (truebb)); \
             MONO_ADD_INS ((cfg)->cbb, ins); \
-            if (g_getenv ("COUNT2") && ccount == atoi (g_getenv ("COUNT2")) - 1) { printf ("HIT: %d\n", cfg->cbb->block_num); } \
-            if (g_getenv ("COUNT2") && ccount < atoi (g_getenv ("COUNT2"))) { \
+            char *count2 = g_getenv ("COUNT2"); \
+            if (count2 && ccount == atoi (count2) - 1) { printf ("HIT: %d\n", cfg->cbb->block_num); } \
+            if (count2 && ccount < atoi (count2)) { \
                  cfg->cbb->extended = TRUE; \
             } else { NEW_BBLOCK ((cfg), falsebb); ins->inst_false_bb = (falsebb); mono_link_bblock ((cfg), (cfg)->cbb, (falsebb)); MONO_START_BB ((cfg), falsebb); } \
+            if (count2) g_free (count2); \
         } \
        } while (0)
 #else