@@ -21,21 +21,21 @@ typedef struct instruction_t
2121 opcode_t opcode;
2222
2323 // An array of arguments for this instruction.
24- value_t args[MAX_IR_ARGS];
24+ value_t args[MAX_IR_ARGS];
2525
2626 // Pointer to the next instruction in the intrusive list.
2727 struct instruction_t *next;
2828
29- // Pointer to the previous instruction the intrusive list.
29+ // Pointer to the previous instruction the intrusive list.
3030 struct instruction_t *previous;
3131} instruction_t ;
3232
3333/* !
3434 * @brief Represents a double-linked list of IR instructions.
3535 *
3636 * This structure holds the head and tail pointers of an intrusive list
37- * composed of `instruction_t` nodes. It is used to store sequences
38- */
37+ * composed of `instruction_t` nodes. It is used to store sequences
38+ */
3939typedef struct
4040{
4141 // Pointer to the first instruction in the list.
@@ -55,7 +55,7 @@ typedef struct
5555 * @pre `instruction` must not be NULL
5656 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
5757 */
58- const value_t * instruction_get_arg ( const instruction_t *instruction, const size_t arg_index);
58+ value_t * instruction_get_arg ( instruction_t *instruction, size_t arg_index);
5959
6060/* !
6161 * Retrieves a U64 argument from an instruction.
@@ -68,7 +68,7 @@ const value_t* instruction_get_arg (const instruction_t *instruction, const size
6868 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
6969 * @pre The argument at `arg_index` must be of type `IR_TYPE_U64`.
7070 */
71- const uint64_t instruction_get_arg_u64 (const instruction_t *instruction, const size_t arg_index);
71+ uint64_t instruction_get_arg_u64 (instruction_t *instruction, size_t arg_index);
7272
7373/* !
7474 * @brief Retrieves a U32 argument from an instruction.
@@ -81,7 +81,7 @@ const uint64_t instruction_get_arg_u64(const instruction_t *instruction, const s
8181 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
8282 * @pre The argument at `arg_index` must be of type `IR_TYPE_U32`.
8383 */
84- const uint32_t instruction_get_arg_u32 (const instruction_t *instruction, const size_t arg_index);
84+ uint32_t instruction_get_arg_u32 (instruction_t *instruction, size_t arg_index);
8585
8686/* !
8787 * Retrives a U8 argument from an instruction.
@@ -94,7 +94,7 @@ const uint32_t instruction_get_arg_u32(const instruction_t *instruction, const s
9494 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
9595 * @pre The argument at `arg_index` must be of type `IR_TYPE_U8`.
9696 */
97- const uint8_t instruction_get_arg_u8 (const instruction_t *instruction, const size_t arg_index);
97+ uint8_t instruction_get_arg_u8 (instruction_t *instruction, size_t arg_index);
9898
9999/* !
100100 * @brief Retrieves a U1 (boolean) argument from an instruction.
@@ -107,7 +107,7 @@ const uint8_t instruction_get_arg_u8(const instruction_t *instruction, const siz
107107 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
108108 * @pre The argument at `arg_index` must be of type `IR_TYPE_U1`.
109109 */
110- const bool instruction_get_arg_u1 (const instruction_t *instruction, const size_t arg_index);
110+ bool instruction_get_arg_u1 (instruction_t *instruction, size_t arg_index);
111111
112112/* !
113113 * @brief Retrieves an A32 register identifier argument from an instruction.
@@ -120,7 +120,8 @@ const bool instruction_get_arg_u1(const instruction_t *instruction, const size_t
120120 * @pre `arg_index` must be less than `MAX_IR_ARGS`.
121121 * @pre The argument at `arg_index` must be of type `IR_TYPE_A32_REGISTER`.
122122 */
123- const pound::jit::a32_register_t instruction_get_arg_a32_register (const instruction_t *instruction, const size_t arg_index);
123+ pound::jit::a32_register_t instruction_get_arg_a32_register (
124+ instruction_t *instruction, size_t arg_index);
124125
125126/* !
126127 * @brief Gets the return type of an instruction based on its opcode.
@@ -129,10 +130,10 @@ const pound::jit::a32_register_t instruction_get_arg_a32_register(const instruct
129130 *
130131 * @return The `type_t` that this instruction's opcode returns.
131132 * @pre `instruction` must not be NULL.
132- * @pre `instruction->opcode` must be a valid opcode index (less than `NUM_OPCODE`).
133+ * @pre `instruction->opcode` must be a valid opcode index (less than
134+ * `NUM_OPCODE`).
133135 */
134- const type_t instruction_get_return_type (const instruction_t *instruction);
135-
136+ type_t instruction_get_return_type (instruction_t *instruction);
136137
137138/* !
138139 * @brief Gets the name of an instruction's opcode as a C-string.
@@ -141,10 +142,11 @@ const type_t instruction_get_return_type (const instruction_t *instruction);
141142 *
142143 * @return A constant C-string containing the opcode's name.
143144 * @pre `instruction` must not be NULL.
144- * @pre `instruction->opcode` must be a valid opcode index (less than `NUM_OPCODE`).
145+ * @pre `instruction->opcode` must be a valid opcode index (less than
146+ * `NUM_OPCODE`).
145147 * @pre The global `g_opcodes` array must be initialized and accessible.
146148 */
147- const char * instruction_get_opcode_name (const instruction_t *instruction);
149+ const char * instruction_get_opcode_name (instruction_t *instruction);
148150
149151/* !
150152 * @brief Appends an instruction to the tail of an instruction list.
@@ -158,7 +160,8 @@ const char* instruction_get_opcode_name(const instruction_t *instruction);
158160 * @pre `list` must not be NULL.
159161 * @pre `instruction` must not be NULL.
160162 */
161- void instruction_list_append (instruction_list_t *list, instruction_t *instruction);
163+ void instruction_list_append (instruction_list_t *list,
164+ instruction_t *instruction);
162165
163166/* !
164167 * @brief Removes an instruction from an instruction list.
@@ -170,6 +173,7 @@ void instruction_list_append (instruction_list_t *list, instruction_t *instructi
170173 * @pre `instruction` must not be NULL.
171174 * @pre `instruction` must be a member of `list`.
172175 */
173- void instruction_list_remove (instruction_list_t *list, instruction_t *instruction);
176+ void instruction_list_remove (instruction_list_t *list,
177+ instruction_t *instruction);
174178}
175179#endif // POUND_JIT_IR_INSTRUCTION_H
0 commit comments