Commit 4477bea
committed
Fix Clang error with JIT when EXT_C is disabled
When using 'make make ENABLE_EXT_C=0 ENABLE_JIT=1 CC=clang', the
following errors are observed:
rc/t2c.c:77:1: error: unused function 't2c_gen_ra_addr' [-Werror,-Wunused-function]
77 | T2C_LLVM_GEN_ADDR(ra, X, rv_reg_ra);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/t2c.c:64:31: note: expanded from macro 'T2C_LLVM_GEN_ADDR'
64 | FORCE_INLINE LLVMValueRef t2c_gen_##reg##_addr( \
| ^~~~~~~~~~~~~~~~~~~~
<scratch space>:75:1: note: expanded from here
75 | t2c_gen_ra_addr
| ^~~~~~~~~~~~~~~
src/t2c.c:78:1: error: unused function 't2c_gen_sp_addr' [-Werror,-Wunused-function]
78 | T2C_LLVM_GEN_ADDR(sp, X, rv_reg_sp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/t2c.c:64:31: note: expanded from macro 'T2C_LLVM_GEN_ADDR'
64 | FORCE_INLINE LLVMValueRef t2c_gen_##reg##_addr( \
| ^~~~~~~~~~~~~~~~~~~~
Fix this by guarding the 't2c_gen_ra_addr' and 't2c_gen_sp_addr'
function definition with RV32_HAS(EXT_C) macro. This ensures the
functions are only defined when the EXT_C is enabled.1 parent 312c83f commit 4477bea
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
0 commit comments