mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 16:24:51 +00:00
update for llvm 5.0.0rc1
This commit is contained in:
parent
6aa04c422b
commit
2bd6c60752
22
src/link.cpp
22
src/link.cpp
@ -437,12 +437,26 @@ static void construct_linker_job_coff(LinkJob *lj) {
|
||||
}
|
||||
}
|
||||
if (buf_len(def_contents) != 0) {
|
||||
Buf *dll_path = buf_alloc();
|
||||
os_path_join(g->cache_dir, buf_create_from_str("all.dll"), dll_path);
|
||||
ZigLLDDefToLib(def_contents, dll_path);
|
||||
Buf *def_path = buf_alloc();
|
||||
os_path_join(g->cache_dir, buf_create_from_str("all.def"), def_path);
|
||||
os_write_file(def_path, def_contents);
|
||||
|
||||
Buf *all_lib_path = buf_alloc();
|
||||
os_path_join(g->cache_dir, buf_create_from_str("all.lib"), all_lib_path);
|
||||
|
||||
//Buf *dll_path = buf_alloc();
|
||||
//os_path_join(g->cache_dir, buf_create_from_str("all.dll"), dll_path);
|
||||
|
||||
ZigList<const char *> args = {0};
|
||||
args.append("link");
|
||||
args.append(buf_ptr(buf_sprintf("-DEF:%s", buf_ptr(def_path))));
|
||||
args.append(buf_ptr(buf_sprintf("-OUT:%s", buf_ptr(all_lib_path))));
|
||||
Buf diag = BUF_INIT;
|
||||
if (!ZigLLDLink(g->zig_target.oformat, args.items, args.length, &diag)) {
|
||||
fprintf(stderr, "%s\n", buf_ptr(&diag));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
lj->args.append(buf_ptr(all_lib_path));
|
||||
}
|
||||
|
||||
@ -732,6 +746,8 @@ static void construct_linker_job(LinkJob *lj) {
|
||||
return construct_linker_job_elf(lj);
|
||||
case ZigLLVM_MachO:
|
||||
return construct_linker_job_macho(lj);
|
||||
case ZigLLVM_Wasm:
|
||||
zig_panic("TODO link wasm");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,6 @@ static TypeTableEntry *resolve_type_with_table(Context *c, const Type *ty, const
|
||||
case BuiltinType::OCLEvent:
|
||||
case BuiltinType::OCLClkEvent:
|
||||
case BuiltinType::OCLQueue:
|
||||
case BuiltinType::OCLNDRange:
|
||||
case BuiltinType::OCLReserveID:
|
||||
emit_warning(c, decl, "missed a builtin type");
|
||||
return c->codegen->builtin_types.entry_invalid;
|
||||
@ -445,8 +444,8 @@ static TypeTableEntry *resolve_type_with_table(Context *c, const Type *ty, const
|
||||
case CC_X86Pascal: // __attribute__((pascal))
|
||||
emit_warning(c, decl, "function type has x86 pascal calling convention");
|
||||
return c->codegen->builtin_types.entry_invalid;
|
||||
case CC_X86_64Win64: // __attribute__((ms_abi))
|
||||
emit_warning(c, decl, "function type has x86 64win64 calling convention");
|
||||
case CC_Win64: // __attribute__((ms_abi))
|
||||
emit_warning(c, decl, "function type has win64 calling convention");
|
||||
return c->codegen->builtin_types.entry_invalid;
|
||||
case CC_X86_64SysV: // __attribute__((sysv_abi))
|
||||
emit_warning(c, decl, "function type has x86 64sysv calling convention");
|
||||
@ -586,6 +585,7 @@ static TypeTableEntry *resolve_type_with_table(Context *c, const Type *ty, const
|
||||
case Type::Atomic:
|
||||
case Type::Pipe:
|
||||
case Type::ObjCTypeParam:
|
||||
case Type::DeducedTemplateSpecialization:
|
||||
emit_warning(c, decl, "missed a '%s' type", ty->getTypeClassName());
|
||||
return c->codegen->builtin_types.entry_invalid;
|
||||
}
|
||||
@ -1369,6 +1369,8 @@ int parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const ch
|
||||
bool capture_diagnostics = true;
|
||||
bool user_files_are_volatile = true;
|
||||
bool allow_pch_with_compiler_errors = false;
|
||||
bool single_file_parse = false;
|
||||
bool for_serialization = false;
|
||||
const char *resources_path = ZIG_HEADERS_DIR;
|
||||
std::unique_ptr<ASTUnit> err_unit;
|
||||
std::unique_ptr<ASTUnit> ast_unit(ASTUnit::LoadFromCommandLine(
|
||||
@ -1376,7 +1378,8 @@ int parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const ch
|
||||
pch_container_ops, diags, resources_path,
|
||||
only_local_decls, capture_diagnostics, None, true, 0, TU_Complete,
|
||||
false, false, allow_pch_with_compiler_errors, skip_function_bodies,
|
||||
user_files_are_volatile, false, None, &err_unit));
|
||||
single_file_parse, user_files_are_volatile, for_serialization, None, &err_unit,
|
||||
nullptr));
|
||||
|
||||
|
||||
// Early failures in LoadFromCommandLine may return with ErrUnit unset.
|
||||
|
||||
@ -24,6 +24,7 @@ static const ArchType arch_list[] = {
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v7m},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v7s},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v7k},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v7ve},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v6},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v6m},
|
||||
{ZigLLVM_arm, ZigLLVM_ARMSubArch_v6k},
|
||||
@ -44,6 +45,7 @@ static const ArchType arch_list[] = {
|
||||
{ZigLLVM_mips64, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_mips64el, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_msp430, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_nios2, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_ppc, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_ppc64, ZigLLVM_NoSubArch},
|
||||
{ZigLLVM_ppc64le, ZigLLVM_NoSubArch},
|
||||
@ -100,10 +102,12 @@ static const ZigLLVM_VendorType vendor_list[] = {
|
||||
ZigLLVM_Myriad,
|
||||
ZigLLVM_AMD,
|
||||
ZigLLVM_Mesa,
|
||||
ZigLLVM_SUSE,
|
||||
};
|
||||
|
||||
static const ZigLLVM_OSType os_list[] = {
|
||||
ZigLLVM_UnknownOS,
|
||||
ZigLLVM_Ananas,
|
||||
ZigLLVM_CloudABI,
|
||||
ZigLLVM_Darwin,
|
||||
ZigLLVM_DragonFly,
|
||||
@ -156,6 +160,7 @@ static const ZigLLVM_EnvironmentType environ_list[] = {
|
||||
ZigLLVM_Cygnus,
|
||||
ZigLLVM_AMDOpenCL,
|
||||
ZigLLVM_CoreCLR,
|
||||
ZigLLVM_OpenCL,
|
||||
};
|
||||
|
||||
static const ZigLLVM_ObjectFormatType oformat_list[] = {
|
||||
@ -163,6 +168,7 @@ static const ZigLLVM_ObjectFormatType oformat_list[] = {
|
||||
ZigLLVM_COFF,
|
||||
ZigLLVM_ELF,
|
||||
ZigLLVM_MachO,
|
||||
ZigLLVM_Wasm,
|
||||
};
|
||||
|
||||
size_t target_oformat_count(void) {
|
||||
@ -179,6 +185,7 @@ const char *get_target_oformat_name(ZigLLVM_ObjectFormatType oformat) {
|
||||
case ZigLLVM_COFF: return "coff";
|
||||
case ZigLLVM_ELF: return "elf";
|
||||
case ZigLLVM_MachO: return "macho";
|
||||
case ZigLLVM_Wasm: return "wasm";
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
@ -353,6 +360,7 @@ void resolve_target_object_format(ZigTarget *target) {
|
||||
case ZigLLVM_mips64el:
|
||||
case ZigLLVM_mipsel:
|
||||
case ZigLLVM_msp430:
|
||||
case ZigLLVM_nios2:
|
||||
case ZigLLVM_nvptx:
|
||||
case ZigLLVM_nvptx64:
|
||||
case ZigLLVM_ppc64le:
|
||||
@ -389,6 +397,7 @@ void resolve_target_object_format(ZigTarget *target) {
|
||||
}
|
||||
|
||||
// See lib/Support/Triple.cpp in LLVM for the source of this data.
|
||||
// getArchPointerBitWidth
|
||||
static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
|
||||
switch (arch) {
|
||||
case ZigLLVM_UnknownArch:
|
||||
@ -404,6 +413,7 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
|
||||
case ZigLLVM_le32:
|
||||
case ZigLLVM_mips:
|
||||
case ZigLLVM_mipsel:
|
||||
case ZigLLVM_nios2:
|
||||
case ZigLLVM_nvptx:
|
||||
case ZigLLVM_ppc:
|
||||
case ZigLLVM_r600:
|
||||
@ -504,6 +514,7 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
|
||||
case CIntTypeCount:
|
||||
zig_unreachable();
|
||||
}
|
||||
case ZigLLVM_Ananas:
|
||||
case ZigLLVM_CloudABI:
|
||||
case ZigLLVM_DragonFly:
|
||||
case ZigLLVM_FreeBSD:
|
||||
|
||||
181
src/zig_llvm.cpp
181
src/zig_llvm.cpp
@ -38,7 +38,6 @@
|
||||
#include <llvm/Support/FileSystem.h>
|
||||
#include <llvm/Support/TargetParser.h>
|
||||
#include <llvm/Support/raw_ostream.h>
|
||||
#include <llvm/Support/COFF.h>
|
||||
#include <llvm/Target/TargetMachine.h>
|
||||
#include <llvm/Transforms/IPO.h>
|
||||
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
|
||||
@ -105,11 +104,9 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
|
||||
PMBuilder->DisableTailCalls = is_debug;
|
||||
PMBuilder->DisableUnitAtATime = is_debug;
|
||||
PMBuilder->DisableUnrollLoops = is_debug;
|
||||
PMBuilder->BBVectorize = !is_debug;
|
||||
PMBuilder->SLPVectorize = !is_debug;
|
||||
PMBuilder->LoopVectorize = !is_debug;
|
||||
PMBuilder->RerollLoops = !is_debug;
|
||||
PMBuilder->LoadCombine = !is_debug;
|
||||
PMBuilder->NewGVN = !is_debug;
|
||||
PMBuilder->DisableGVNLoadPRE = is_debug;
|
||||
PMBuilder->VerifyInput = assertions_on;
|
||||
@ -125,13 +122,10 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
|
||||
if (is_debug) {
|
||||
PMBuilder->Inliner = createAlwaysInlinerLegacyPass(false);
|
||||
} else {
|
||||
PMBuilder->addExtension(PassManagerBuilder::EP_EarlyAsPossible,
|
||||
[&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
|
||||
target_machine->addEarlyAsPossiblePasses(PM);
|
||||
});
|
||||
target_machine->adjustPassManager(*PMBuilder);
|
||||
|
||||
PMBuilder->addExtension(PassManagerBuilder::EP_EarlyAsPossible, addDiscriminatorsPass);
|
||||
PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel);
|
||||
PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false);
|
||||
}
|
||||
|
||||
// Set up the per-function pass manager.
|
||||
@ -182,7 +176,7 @@ LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *A
|
||||
CallInst *call_inst = CallInst::Create(unwrap(Fn), makeArrayRef(unwrap(Args), NumArgs), Name);
|
||||
call_inst->setCallingConv(CC);
|
||||
if (always_inline) {
|
||||
call_inst->addAttribute(AttributeSet::FunctionIndex, Attribute::AlwaysInline);
|
||||
call_inst->addAttribute(AttributeList::FunctionIndex, Attribute::AlwaysInline);
|
||||
}
|
||||
return wrap(unwrap(B)->Insert(call_inst));
|
||||
}
|
||||
@ -198,7 +192,7 @@ ZigLLVMDIType *ZigLLVMCreateDebugPointerType(ZigLLVMDIBuilder *dibuilder, ZigLLV
|
||||
uint64_t size_in_bits, uint64_t align_in_bits, const char *name)
|
||||
{
|
||||
DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createPointerType(
|
||||
reinterpret_cast<DIType*>(pointee_type), size_in_bits, align_in_bits, name);
|
||||
reinterpret_cast<DIType*>(pointee_type), size_in_bits, align_in_bits, Optional<unsigned>(), name);
|
||||
return reinterpret_cast<ZigLLVMDIType*>(di_type);
|
||||
}
|
||||
|
||||
@ -599,23 +593,22 @@ void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) {
|
||||
|
||||
void ZigLLVMAddFunctionAttr(LLVMValueRef fn_ref, const char *attr_name, const char *attr_value) {
|
||||
Function *func = unwrap<Function>(fn_ref);
|
||||
const AttributeSet attr_set = func->getAttributes();
|
||||
const AttributeList attr_set = func->getAttributes();
|
||||
AttrBuilder attr_builder;
|
||||
if (attr_value) {
|
||||
attr_builder.addAttribute(attr_name, attr_value);
|
||||
} else {
|
||||
attr_builder.addAttribute(attr_name);
|
||||
}
|
||||
const AttributeSet new_attr_set = attr_set.addAttributes(func->getContext(),
|
||||
AttributeSet::FunctionIndex, AttributeSet::get(func->getContext(),
|
||||
AttributeSet::FunctionIndex, attr_builder));
|
||||
const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(),
|
||||
AttributeList::FunctionIndex, attr_builder);
|
||||
func->setAttributes(new_attr_set);
|
||||
}
|
||||
|
||||
void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn_ref) {
|
||||
Function *func = unwrap<Function>(fn_ref);
|
||||
const AttributeSet attr_set = func->getAttributes();
|
||||
const AttributeSet new_attr_set = attr_set.addAttribute(func->getContext(), AttributeSet::FunctionIndex,
|
||||
const AttributeList attr_set = func->getAttributes();
|
||||
const AttributeList new_attr_set = attr_set.addAttribute(func->getContext(), AttributeList::FunctionIndex,
|
||||
Attribute::Cold);
|
||||
func->setAttributes(new_attr_set);
|
||||
}
|
||||
@ -690,6 +683,8 @@ const char *ZigLLVMGetSubArchTypeName(ZigLLVM_SubArchType sub_arch) {
|
||||
return "v7s";
|
||||
case ZigLLVM_ARMSubArch_v7k:
|
||||
return "v7k";
|
||||
case ZigLLVM_ARMSubArch_v7ve:
|
||||
return "v7ve";
|
||||
case ZigLLVM_ARMSubArch_v6:
|
||||
return "v6";
|
||||
case ZigLLVM_ARMSubArch_v6m:
|
||||
@ -741,8 +736,7 @@ LLVMValueRef ZigLLVMBuildCmpXchg(LLVMBuilderRef builder, LLVMValueRef ptr, LLVMV
|
||||
LLVMAtomicOrdering failure_ordering)
|
||||
{
|
||||
return wrap(unwrap(builder)->CreateAtomicCmpXchg(unwrap(ptr), unwrap(cmp), unwrap(new_val),
|
||||
mapFromLLVMOrdering(success_ordering), mapFromLLVMOrdering(failure_ordering),
|
||||
CrossThread));
|
||||
mapFromLLVMOrdering(success_ordering), mapFromLLVMOrdering(failure_ordering)));
|
||||
}
|
||||
|
||||
LLVMValueRef ZigLLVMBuildNSWShl(LLVMBuilderRef builder, LLVMValueRef LHS, LLVMValueRef RHS,
|
||||
@ -802,154 +796,9 @@ bool ZigLLDLink(ZigLLVM_ObjectFormatType oformat, const char **args, size_t arg_
|
||||
|
||||
case ZigLLVM_MachO:
|
||||
return lld::mach_o::link(array_ref_args, diag);
|
||||
|
||||
case ZigLLVM_Wasm:
|
||||
zig_panic("ZigLLDLink for Wasm");
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
// workaround for LLD not exposing ability to convert .def to .lib
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
|
||||
class SymbolBody;
|
||||
class StringChunk;
|
||||
struct Symbol;
|
||||
|
||||
struct Export {
|
||||
StringRef Name; // N in /export:N or /export:E=N
|
||||
StringRef ExtName; // E in /export:E=N
|
||||
SymbolBody *Sym = nullptr;
|
||||
uint16_t Ordinal = 0;
|
||||
bool Noname = false;
|
||||
bool Data = false;
|
||||
bool Private = false;
|
||||
|
||||
// If an export is a form of /export:foo=dllname.bar, that means
|
||||
// that foo should be exported as an alias to bar in the DLL.
|
||||
// ForwardTo is set to "dllname.bar" part. Usually empty.
|
||||
StringRef ForwardTo;
|
||||
StringChunk *ForwardChunk = nullptr;
|
||||
|
||||
// True if this /export option was in .drectves section.
|
||||
bool Directives = false;
|
||||
StringRef SymbolName;
|
||||
StringRef ExportName; // Name in DLL
|
||||
|
||||
bool operator==(const Export &E) {
|
||||
return (Name == E.Name && ExtName == E.ExtName &&
|
||||
Ordinal == E.Ordinal && Noname == E.Noname &&
|
||||
Data == E.Data && Private == E.Private);
|
||||
}
|
||||
};
|
||||
|
||||
enum class DebugType {
|
||||
None = 0x0,
|
||||
CV = 0x1, /// CodeView
|
||||
PData = 0x2, /// Procedure Data
|
||||
Fixup = 0x4, /// Relocation Table
|
||||
};
|
||||
|
||||
struct Configuration {
|
||||
enum ManifestKind { SideBySide, Embed, No };
|
||||
llvm::COFF::MachineTypes Machine = llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN;
|
||||
bool Verbose = false;
|
||||
llvm::COFF::WindowsSubsystem Subsystem = llvm::COFF::IMAGE_SUBSYSTEM_UNKNOWN;
|
||||
SymbolBody *Entry = nullptr;
|
||||
bool NoEntry = false;
|
||||
std::string OutputFile;
|
||||
bool DoGC = true;
|
||||
bool DoICF = true;
|
||||
bool Relocatable = true;
|
||||
bool Force = false;
|
||||
bool Debug = false;
|
||||
bool WriteSymtab = true;
|
||||
unsigned DebugTypes = static_cast<unsigned>(DebugType::None);
|
||||
StringRef PDBPath;
|
||||
|
||||
// Symbols in this set are considered as live by the garbage collector.
|
||||
std::set<SymbolBody *> GCRoot;
|
||||
|
||||
std::set<StringRef> NoDefaultLibs;
|
||||
bool NoDefaultLibAll = false;
|
||||
|
||||
// True if we are creating a DLL.
|
||||
bool DLL = false;
|
||||
StringRef Implib;
|
||||
std::vector<Export> Exports;
|
||||
std::set<std::string> DelayLoads;
|
||||
std::map<std::string, int> DLLOrder;
|
||||
SymbolBody *DelayLoadHelper = nullptr;
|
||||
|
||||
// Used for SafeSEH.
|
||||
Symbol *SEHTable = nullptr;
|
||||
Symbol *SEHCount = nullptr;
|
||||
|
||||
// Used for /opt:lldlto=N
|
||||
unsigned LTOOptLevel = 2;
|
||||
|
||||
// Used for /opt:lldltojobs=N
|
||||
unsigned LTOJobs = 1;
|
||||
|
||||
// Used for /merge:from=to (e.g. /merge:.rdata=.text)
|
||||
std::map<StringRef, StringRef> Merge;
|
||||
|
||||
// Used for /section=.name,{DEKPRSW} to set section attributes.
|
||||
std::map<StringRef, uint32_t> Section;
|
||||
|
||||
// Options for manifest files.
|
||||
ManifestKind Manifest = SideBySide;
|
||||
int ManifestID = 1;
|
||||
StringRef ManifestDependency;
|
||||
bool ManifestUAC = true;
|
||||
std::vector<std::string> ManifestInput;
|
||||
StringRef ManifestLevel = "'asInvoker'";
|
||||
StringRef ManifestUIAccess = "'false'";
|
||||
StringRef ManifestFile;
|
||||
|
||||
// Used for /failifmismatch.
|
||||
std::map<StringRef, StringRef> MustMatch;
|
||||
|
||||
// Used for /alternatename.
|
||||
std::map<StringRef, StringRef> AlternateNames;
|
||||
|
||||
uint64_t ImageBase = -1;
|
||||
uint64_t StackReserve = 1024 * 1024;
|
||||
uint64_t StackCommit = 4096;
|
||||
uint64_t HeapReserve = 1024 * 1024;
|
||||
uint64_t HeapCommit = 4096;
|
||||
uint32_t MajorImageVersion = 0;
|
||||
uint32_t MinorImageVersion = 0;
|
||||
uint32_t MajorOSVersion = 6;
|
||||
uint32_t MinorOSVersion = 0;
|
||||
bool DynamicBase = true;
|
||||
bool AllowBind = true;
|
||||
bool NxCompat = true;
|
||||
bool AllowIsolation = true;
|
||||
bool TerminalServerAware = true;
|
||||
bool LargeAddressAware = false;
|
||||
bool HighEntropyVA = false;
|
||||
|
||||
// This is for debugging.
|
||||
bool DebugPdb = false;
|
||||
bool DumpPdb = false;
|
||||
};
|
||||
|
||||
extern Configuration *Config;
|
||||
|
||||
void writeImportLibrary();
|
||||
void parseModuleDefs(MemoryBufferRef MB);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
|
||||
// writes the output to dll_path with .dll replaced with .lib
|
||||
void ZigLLDDefToLib(Buf *def_contents, Buf *dll_path) {
|
||||
lld::coff::Config = new lld::coff::Configuration;
|
||||
auto mem_buf = MemoryBuffer::getMemBuffer(buf_ptr(def_contents));
|
||||
MemoryBufferRef mbref(*mem_buf);
|
||||
lld::coff::parseModuleDefs(mbref);
|
||||
lld::coff::Config->OutputFile = buf_ptr(dll_path);
|
||||
lld::coff::writeImportLibrary();
|
||||
}
|
||||
|
||||
@ -188,6 +188,7 @@ enum ZigLLVM_ArchType {
|
||||
ZigLLVM_mips64, // MIPS64: mips64
|
||||
ZigLLVM_mips64el, // MIPS64EL: mips64el
|
||||
ZigLLVM_msp430, // MSP430: msp430
|
||||
ZigLLVM_nios2, // NIOSII: nios2
|
||||
ZigLLVM_ppc, // PPC: powerpc
|
||||
ZigLLVM_ppc64, // PPC64: powerpc64, ppu
|
||||
ZigLLVM_ppc64le, // PPC64LE: powerpc64le
|
||||
@ -228,30 +229,31 @@ enum ZigLLVM_ArchType {
|
||||
};
|
||||
|
||||
enum ZigLLVM_SubArchType {
|
||||
ZigLLVM_NoSubArch,
|
||||
ZigLLVM_NoSubArch,
|
||||
|
||||
ZigLLVM_ARMSubArch_v8_2a,
|
||||
ZigLLVM_ARMSubArch_v8_1a,
|
||||
ZigLLVM_ARMSubArch_v8,
|
||||
ZigLLVM_ARMSubArch_v8r,
|
||||
ZigLLVM_ARMSubArch_v8m_baseline,
|
||||
ZigLLVM_ARMSubArch_v8m_mainline,
|
||||
ZigLLVM_ARMSubArch_v7,
|
||||
ZigLLVM_ARMSubArch_v7em,
|
||||
ZigLLVM_ARMSubArch_v7m,
|
||||
ZigLLVM_ARMSubArch_v7s,
|
||||
ZigLLVM_ARMSubArch_v7k,
|
||||
ZigLLVM_ARMSubArch_v6,
|
||||
ZigLLVM_ARMSubArch_v6m,
|
||||
ZigLLVM_ARMSubArch_v6k,
|
||||
ZigLLVM_ARMSubArch_v6t2,
|
||||
ZigLLVM_ARMSubArch_v5,
|
||||
ZigLLVM_ARMSubArch_v5te,
|
||||
ZigLLVM_ARMSubArch_v4t,
|
||||
ZigLLVM_ARMSubArch_v8_2a,
|
||||
ZigLLVM_ARMSubArch_v8_1a,
|
||||
ZigLLVM_ARMSubArch_v8,
|
||||
ZigLLVM_ARMSubArch_v8r,
|
||||
ZigLLVM_ARMSubArch_v8m_baseline,
|
||||
ZigLLVM_ARMSubArch_v8m_mainline,
|
||||
ZigLLVM_ARMSubArch_v7,
|
||||
ZigLLVM_ARMSubArch_v7em,
|
||||
ZigLLVM_ARMSubArch_v7m,
|
||||
ZigLLVM_ARMSubArch_v7s,
|
||||
ZigLLVM_ARMSubArch_v7k,
|
||||
ZigLLVM_ARMSubArch_v7ve,
|
||||
ZigLLVM_ARMSubArch_v6,
|
||||
ZigLLVM_ARMSubArch_v6m,
|
||||
ZigLLVM_ARMSubArch_v6k,
|
||||
ZigLLVM_ARMSubArch_v6t2,
|
||||
ZigLLVM_ARMSubArch_v5,
|
||||
ZigLLVM_ARMSubArch_v5te,
|
||||
ZigLLVM_ARMSubArch_v4t,
|
||||
|
||||
ZigLLVM_KalimbaSubArch_v3,
|
||||
ZigLLVM_KalimbaSubArch_v4,
|
||||
ZigLLVM_KalimbaSubArch_v5,
|
||||
ZigLLVM_KalimbaSubArch_v3,
|
||||
ZigLLVM_KalimbaSubArch_v4,
|
||||
ZigLLVM_KalimbaSubArch_v5,
|
||||
};
|
||||
|
||||
enum ZigLLVM_VendorType {
|
||||
@ -271,13 +273,15 @@ enum ZigLLVM_VendorType {
|
||||
ZigLLVM_Myriad,
|
||||
ZigLLVM_AMD,
|
||||
ZigLLVM_Mesa,
|
||||
ZigLLVM_SUSE,
|
||||
|
||||
ZigLLVM_LastVendorType = ZigLLVM_Mesa
|
||||
ZigLLVM_LastVendorType = ZigLLVM_SUSE
|
||||
};
|
||||
|
||||
enum ZigLLVM_OSType {
|
||||
ZigLLVM_UnknownOS,
|
||||
|
||||
ZigLLVM_Ananas,
|
||||
ZigLLVM_CloudABI,
|
||||
ZigLLVM_Darwin,
|
||||
ZigLLVM_DragonFly,
|
||||
@ -344,6 +348,7 @@ enum ZigLLVM_ObjectFormatType {
|
||||
ZigLLVM_COFF,
|
||||
ZigLLVM_ELF,
|
||||
ZigLLVM_MachO,
|
||||
ZigLLVM_Wasm,
|
||||
};
|
||||
|
||||
const char *ZigLLVMGetArchTypeName(ZigLLVM_ArchType arch);
|
||||
@ -363,6 +368,4 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
|
||||
ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type,
|
||||
ZigLLVM_ObjectFormatType *oformat);
|
||||
|
||||
void ZigLLDDefToLib(Buf *def_contents, Buf *dll_path);
|
||||
|
||||
#endif
|
||||
|
||||
@ -147,6 +147,9 @@ pub fn writeStackTrace(out_stream: &io.OutStream, allocator: &mem.Allocator, tty
|
||||
builtin.ObjectFormat.macho => {
|
||||
%return out_stream.write("(stack trace unavailable for Mach-O object format)\n");
|
||||
},
|
||||
builtin.ObjectFormat.wasm => {
|
||||
%return out_stream.write("(stack trace unavailable for WASM object format)\n");
|
||||
},
|
||||
builtin.ObjectFormat.unknown => {
|
||||
%return out_stream.write("(stack trace unavailable for unknown object format)\n");
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user