summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-04-16 20:42:06 +0000
committerZachary Turner <zturner@google.com>2018-04-16 20:42:06 +0000
commitd8d97de51401e8953305613fdfcf8fd3f323f015 (patch)
treec00fd73c8f4320950659f1011673cbc7aee01c3f /llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
parent2c1dffece66610e30cc71b710b52f855a3738e43 (diff)
downloadbcm5719-llvm-d8d97de51401e8953305613fdfcf8fd3f323f015.tar.gz
bcm5719-llvm-d8d97de51401e8953305613fdfcf8fd3f323f015.zip
[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
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp5
1 files changed, 5 insertions, 0 deletions
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<pdb::PDB_Machine>(static_cast<unsigned>(M));
+}
+
void DbiStreamBuilder::setSectionMap(ArrayRef<SecMapEntry> SecMap) {
SectionMap = SecMap;
}
OpenPOWER on IntegriCloud