Skip to content

Commit e00fc12

Browse files
committed
Enable code completion on a editor
1 parent 02dcf02 commit e00fc12

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ as_SRCS:=$(wildcard $(AS_DIR)/*.c) \
9191
ld_SRCS:=$(wildcard $(LD_DIR)/*.c) $(UTIL_DIR)/archive.c \
9292
$(UTIL_DIR)/util.c $(UTIL_DIR)/elfutil.c $(UTIL_DIR)/table.c
9393

94-
src_as_CFLAGS:=-I$(AS_DIR) -I$(AS_ARCH_DIR)
95-
src_as_arch_$(ARCHTYPE)_CFLAGS:=-I$(AS_DIR) -I$(AS_ARCH_DIR)
96-
src_cc_CFLAGS:=-I$(CC1_FE_DIR) -I$(CC1_BE_DIR) # arch required for builtin.c
94+
src_as_CFLAGS:=-I$(AS_DIR)
95+
src_as_arch_$(ARCHTYPE)_CFLAGS:=-I$(AS_DIR)
96+
src_cc_CFLAGS:=-I$(CC1_FE_DIR) -I$(CC1_BE_DIR)
9797
src_cc_frontend_CFLAGS:=-I$(CC1_FE_DIR)
9898
src_cc_backend_CFLAGS:=-I$(CC1_FE_DIR) -I$(CC1_BE_DIR)
9999
src_cc_arch_$(ARCHTYPE)_CFLAGS:=-I$(CC1_FE_DIR) -I$(CC1_BE_DIR)

src/as/parse_asm.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@
1212
#include <alloca.h>
1313
#endif
1414

15-
#include "inst.h" // Inst, depends on target architecture.
1615
#include "ir_asm.h"
1716
#include "table.h"
1817
#include "util.h"
1918

19+
// #include "inst.h" // To enable code interpolation on a text editor.
20+
#if XCC_TARGET_ARCH == XCC_ARCH_X64
21+
#include "./arch/x64/inst.h"
22+
#elif XCC_TARGET_ARCH == XCC_ARCH_AARCH64
23+
#include "./arch/aarch64/inst.h"
24+
#elif XCC_TARGET_ARCH == XCC_ARCH_RISCV64
25+
#include "./arch/riscv64/inst.h"
26+
#else
27+
#error "Unsupported architecture"
28+
#endif
29+
2030
#if XCC_TARGET_PLATFORM == XCC_PLATFORM_APPLE
2131
const char kSegText[] = "__TEXT";
2232
const char kSecText[] = "__text";

0 commit comments

Comments
 (0)