shecc
shecc copied to clipboard
Refactor code generations
Both src/arm-codegen and src/riscv-codegen.c have some functions in common. The code generation can be refactored with the following changes:
- split the shared functions/variables to new file
src/codegen.cfrom src/{arm,riscv}-codegen.c - In the end of
src/codegen.c, there should be a statement `#include "src/arch-codegen.c" which links to Arm or RISC-V code generation implementation. - The generated
sheccexecutable file should be capable of showing its configurations such as the supported architecture and ABI.
Depends on #47