From d8d97de51401e8953305613fdfcf8fd3f323f015 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 16 Apr 2018 20:42:06 +0000 Subject: [PDB] Correctly use the target machine when writing DBI stream. Using Config->is64() will treat ARM64 as Amd64, which is incorrect. Furthermore, there are more esoteric architectures that could theoretically be encountered. Just set it directly to the machine type, which we already know anyway. llvm-svn: 330157 --- llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp index 52886d566e7..f6043bfd7cf 100644 --- a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp @@ -53,6 +53,11 @@ void DbiStreamBuilder::setFlags(uint16_t F) { Flags = F; } void DbiStreamBuilder::setMachineType(PDB_Machine M) { MachineType = M; } +void DbiStreamBuilder::setMachineType(COFF::MachineTypes M) { + // These enums are mirrors of each other, so we can just cast the value. + MachineType = static_cast(static_cast(M)); +} + void DbiStreamBuilder::setSectionMap(ArrayRef SecMap) { SectionMap = SecMap; } -- cgit v1.2.3