Skip to content

Commit f71f435

Browse files
committed
Fix Clang error when disabling MOP FUSION
When using 'make ENABLE_MOP_FUSION=0 CC=clang', the following error is observed: src/emulate.c:695:20: error: unused function 'remove_next_nth_ir' [-Werror,-Wunused-function] 695 | static inline void remove_next_nth_ir(const riscv_t *rv, | ^~~~~~~~~~~~~~~~~~ 1 error generated. Fix by gurading the 'remove_next_nth_ir' function and the 'COMBINE_MEM_OPS' macro with the 'RV32_HAS(MOP_FUSION)' macro. This ensures both are only included when MOP FUSION is enabled, preventing the Clang warning and maintaining proper functionality.
1 parent 2ca5dcc commit f71f435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ static void block_translate(riscv_t *rv, block_t *block)
666666
block->ir_tail->next = NULL;
667667
}
668668

669+
#if RV32_HAS(MOP_FUSION)
669670
#define COMBINE_MEM_OPS(RW) \
670671
next_ir = ir->next; \
671672
count = 1; \
@@ -705,7 +706,6 @@ static inline void remove_next_nth_ir(const riscv_t *rv,
705706
block->n_insn -= n;
706707
}
707708

708-
#if RV32_HAS(MOP_FUSION)
709709
/* Check if instructions in a block match a specific pattern. If they do,
710710
* rewrite them as fused instructions.
711711
*

0 commit comments

Comments
 (0)