[merp] Remove dead code (#20043)
[mono-project.git] / mono / metadata / method-builder-ilgen.h
blob82daf70e91e5ea707823b8e89570a26c11f95757
1 /**
2 * \file
3 * Copyright 2018 Microsoft
4 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
5 */
6 #ifndef __MONO_METHOD_BUILDER_ILGEN_H__
7 #define __MONO_METHOD_BUILDER_ILGEN_H__
9 #include "config.h"
10 #include <mono/metadata/class.h>
11 #include <mono/metadata/object-internals.h>
12 #include <mono/metadata/class-internals.h>
13 #include <mono/metadata/opcodes.h>
14 #include <mono/metadata/reflection.h>
15 #include <mono/metadata/method-builder.h>
17 MONO_API void
18 mono_method_builder_ilgen_init (void);
20 void
21 mono_mb_patch_addr (MonoMethodBuilder *mb, int pos, int value);
23 void
24 mono_mb_patch_addr_s (MonoMethodBuilder *mb, int pos, gint8 value);
26 void
27 mono_mb_patch_branch (MonoMethodBuilder *mb, guint32 pos);
29 void
30 mono_mb_patch_short_branch (MonoMethodBuilder *mb, guint32 pos);
32 int
33 mono_mb_get_label (MonoMethodBuilder *mb);
35 int
36 mono_mb_get_pos (MonoMethodBuilder *mb);
38 void
39 mono_mb_emit_ptr (MonoMethodBuilder *mb, gpointer ptr);
41 void
42 mono_mb_emit_calli (MonoMethodBuilder *mb, MonoMethodSignature *sig);
44 void
45 mono_mb_emit_native_call (MonoMethodBuilder *mb, MonoMethodSignature *sig, gpointer func);
47 #ifdef __cplusplus
48 template <typename T>
49 inline void
50 mono_mb_emit_native_call (MonoMethodBuilder *mb, MonoMethodSignature *sig, T func)
52 mono_mb_emit_native_call (mb, sig, (gpointer)func);
54 #endif // __cplusplus
56 void
57 mono_mb_emit_managed_call (MonoMethodBuilder *mb, MonoMethod *method, MonoMethodSignature *opt_sig);
59 void
60 mono_mb_emit_icall_id (MonoMethodBuilder *mb, MonoJitICallId jit_icall_id);
62 #define mono_mb_emit_icall(mb, name) (mono_mb_emit_icall_id ((mb), MONO_JIT_ICALL_ ## name))
64 int
65 mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type);
67 void
68 mono_mb_emit_ldarg (MonoMethodBuilder *mb, guint argnum);
70 void
71 mono_mb_emit_ldarg_addr (MonoMethodBuilder *mb, guint argnum);
73 void
74 mono_mb_emit_ldloc (MonoMethodBuilder *mb, guint num);
76 void
77 mono_mb_emit_ldloc_addr (MonoMethodBuilder *mb, guint locnum);
79 void
80 mono_mb_emit_stloc (MonoMethodBuilder *mb, guint num);
82 void
83 mono_mb_emit_exception (MonoMethodBuilder *mb, const char *exc_name, const char *msg);
85 void
86 mono_mb_emit_exception_full (MonoMethodBuilder *mb, const char *exc_nspace, const char *exc_name, const char *msg);
88 void
89 mono_mb_emit_exception_for_error (MonoMethodBuilder *mb, MonoError *error);
91 void
92 mono_mb_emit_icon (MonoMethodBuilder *mb, gint32 value);
94 void
95 mono_mb_emit_icon8 (MonoMethodBuilder *mb, gint64 value);
97 guint32
98 mono_mb_emit_branch (MonoMethodBuilder *mb, guint8 op);
100 guint32
101 mono_mb_emit_short_branch (MonoMethodBuilder *mb, guint8 op);
103 void
104 mono_mb_emit_branch_label (MonoMethodBuilder *mb, guint8 op, guint32 label);
106 void
107 mono_mb_emit_add_to_local (MonoMethodBuilder *mb, guint16 local, gint32 incr);
109 void
110 mono_mb_emit_ldflda (MonoMethodBuilder *mb, gint32 offset);
112 void
113 mono_mb_emit_byte (MonoMethodBuilder *mb, guint8 op);
115 void
116 mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 data);
118 void
119 mono_mb_emit_i4 (MonoMethodBuilder *mb, gint32 data);
121 void
122 mono_mb_emit_i8 (MonoMethodBuilder *mb, gint64 data);
124 void
125 mono_mb_emit_op (MonoMethodBuilder *mb, guint8 op, gpointer data);
127 void
128 mono_mb_emit_ldstr (MonoMethodBuilder *mb, char *str);
130 void
131 mono_mb_set_clauses (MonoMethodBuilder *mb, int num_clauses, MonoExceptionClause *clauses);
133 void
134 mono_mb_set_param_names (MonoMethodBuilder *mb, const char **param_names);
136 char*
137 mono_mb_strdup (MonoMethodBuilder *mb, const char *s);
139 #endif