From ed50bd1b655ff028bdd650edecdcdd6675f1dee0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 17 Aug 2016 20:11:04 -0700 Subject: progress toward stack trace printing --- src/target.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/target.cpp') diff --git a/src/target.cpp b/src/target.cpp index 07a7bb0098..18573be4c3 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -137,6 +137,31 @@ static const ZigLLVM_EnvironmentType environ_list[] = { ZigLLVM_CoreCLR, }; +static const ZigLLVM_ObjectFormatType oformat_list[] = { + ZigLLVM_UnknownObjectFormat, + ZigLLVM_COFF, + ZigLLVM_ELF, + ZigLLVM_MachO, +}; + +int target_oformat_count(void) { + return array_length(oformat_list); +} + +const ZigLLVM_ObjectFormatType get_target_oformat(int index) { + return oformat_list[index]; +} + +const char *get_target_oformat_name(ZigLLVM_ObjectFormatType oformat) { + switch (oformat) { + case ZigLLVM_UnknownObjectFormat: return "unknown"; + case ZigLLVM_COFF: return "coff"; + case ZigLLVM_ELF: return "elf"; + case ZigLLVM_MachO: return "macho"; + } + zig_unreachable(); +} + int target_arch_count(void) { return array_length(arch_list); } -- cgit v1.2.3