From ef12a4bd05cdd531d9c130763ffb2470e9c0fb54 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 10 Apr 2018 15:06:47 +1000 Subject: py: Refactor how native emitter code is compiled with a file per arch. Instead of emitnative.c having configuration code for each supported architecture, and then compiling this file multiple times with different macros defined, this patch adds a file per architecture with the necessary code to configure the native emitter. These files then #include the emitnative.c file. This simplifies emitnative.c (which is already very large), and simplifies the build system because emitnative.c no longer needs special handling for compilation and qstr extraction. --- py/emitnarm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 py/emitnarm.c (limited to 'py/emitnarm.c') diff --git a/py/emitnarm.c b/py/emitnarm.c new file mode 100644 index 000000000..1b585f821 --- /dev/null +++ b/py/emitnarm.c @@ -0,0 +1,15 @@ +// ARM specific stuff + +#include "py/mpconfig.h" + +#if MICROPY_EMIT_ARM + +// This is defined so that the assembler exports generic assembler API macros +#define GENERIC_ASM_API (1) +#include "py/asmarm.h" + +#define N_ARM (1) +#define EXPORT_FUN(name) emit_native_arm_##name +#include "py/emitnative.c" + +#endif -- cgit v1.2.3