text: /* -*- mode: c; c-default-style: "bsd"; -*- */
  /* Copyright (c) 2020-2022 Charlie Burnett <burne251@umn.edu> */
  /* SPDX-License-Identifier: ISC OR Apache-2.0 */
  
  #ifndef OPE_BACKEND_H
  #define OPE_BACKEND_H
  #include "util.h"
  #include "semantic.h"
  OPE_BEGIN_HEADER
  /* Hardcoded values */
  typedef enum architecture {
  	ARCH_INVALID = 0x0,
  	ARCH_ALPHA = 0x1,
  	ARCH_AMD64 = 0x2,
  	ARCH_AMD64_HASWELL = 0x3,
  	ARCH_ARM64 = 0x4,
  	ARCH_ARMV7 = 0x5,
  	ARCH_HPPA = 0x6,
  	ARCH_I386 = 0x7,
  	ARCH_LANDISK = 0x8,
  	ARCH_LOONGSON = 0x9,
  	ARCH_M88K = 0xA,
  	ARCH_MACPPC = 0xB,
  	ARCH_OCTEON = 0xC,
  	ARCH_POWERPC64 = 0xD,
  	ARCH_RISCV64 = 0xE,
  	ARCH_SPARC64 = 0xF,
  } architecture;
  
  UNUSED static const char *arch_strings[] = {
      "INVALID",
      "alpha",
      "amd64",
      "amd64 haswell",
      "arm64",
      "armv7",
      "hppa",
      "i386",
      "landisk",
      "loongson",
      "m88k",
      "macppc",
      "octeon",
      "powerpc64",
      "riscv64",
      "sparc64",
  };
  
  typedef enum linkage {
  	LINKAGE_BASE = 0,
  	LINKAGE_EXTERNAL = 1,
  	LINKAGE_INLINE = 2,
  	LINKAGE_INLINE_ODR = 3,
  	LINKAGE_MAYBE_INLINE = 4,
  	LINKAGE_MAYBE_ODR = 5,
  	LINKAGE_MAYBE_STATIC = 6,
  	LINKAGE_PRIVATE = 7,
  	LINKAGE_STATIC = 8,
  } linkage;
  
  int backend(ast *);
  
  OPE_END_HEADER
  #endif /* OPE_BACKEND_H */
  