Skip to content

Commit 325509f

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 this by guarding the remove_next_nth_ir function definition with RV32_HAS(MOP_FUSION) macro. This ensures the function is only defined when the MOP_FUSION is enabled.
1 parent b1b92af commit 325509f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/emulate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ static void block_translate(riscv_t *rv, block_t *block)
692692
remove_next_nth_ir(rv, ir, block, count - 1); \
693693
}
694694

695+
#if RV32_HAS(MOP_FUSION)
695696
static inline void remove_next_nth_ir(const riscv_t *rv,
696697
rv_insn_t *ir,
697698
block_t *block,
@@ -706,6 +707,7 @@ static inline void remove_next_nth_ir(const riscv_t *rv,
706707
block->ir_tail = ir;
707708
block->n_insn -= n;
708709
}
710+
#endif
709711

710712
#if RV32_HAS(MOP_FUSION)
711713
/* Check if instructions in a block match a specific pattern. If they do,

0 commit comments

Comments
 (0)