summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-04-16 16:27:49 +0000
committerZachary Turner <zturner@google.com>2018-04-16 16:27:49 +0000
commit1b06cc78177bec39509ae43583312fe3bab4468b (patch)
treeeda2113c7708618d0742437ff538d876223c8f2b /llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
parentd93b8a0740c8c5aecd53a7ffff1bff58647f2e20 (diff)
downloadbcm5719-llvm-1b06cc78177bec39509ae43583312fe3bab4468b.tar.gz
bcm5719-llvm-1b06cc78177bec39509ae43583312fe3bab4468b.zip
Fix some incorrect fields in our generated PDBs.
Most of these are pretty trivial and obvious. Setting the toolchain version to 14.11 is perhaps a little questionable, but we've been bitten in the past where one of our version fields sidn't match MSVC's, and I definitely don't want to go through that diagnosis again as it was pretty time consuming and hard to track down. I found all of these by using llvm-pdbutil export to dump the dbi and pdb streams to a file, then using fc followed by llvm-pdbutil explain to explain the mismatched bytes. There are still some more, these are just the low hanging fruit. Differential Revision: https://reviews.llvm.org/D45276 llvm-svn: 330130
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
index f17e0815ccf..52886d566e7 100644
--- a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
@@ -37,6 +37,14 @@ void DbiStreamBuilder::setAge(uint32_t A) { Age = A; }
void DbiStreamBuilder::setBuildNumber(uint16_t B) { BuildNumber = B; }
+void DbiStreamBuilder::setBuildNumber(uint8_t Major, uint8_t Minor) {
+ BuildNumber = (uint16_t(Major) << DbiBuildNo::BuildMajorShift) &
+ DbiBuildNo::BuildMajorMask;
+ BuildNumber |= (uint16_t(Minor) << DbiBuildNo::BuildMinorShift) &
+ DbiBuildNo::BuildMinorMask;
+ BuildNumber |= DbiBuildNo::NewVersionFormatMask;
+}
+
void DbiStreamBuilder::setPdbDllVersion(uint16_t V) { PdbDllVersion = V; }
void DbiStreamBuilder::setPdbDllRbld(uint16_t R) { PdbDllRbld = R; }
@@ -251,7 +259,7 @@ Error DbiStreamBuilder::finalize() {
H->TypeServerSize = 0;
H->SymRecordStreamIndex = SymRecordStreamIndex;
H->PublicSymbolStreamIndex = PublicsStreamIndex;
- H->MFCTypeServerIndex = kInvalidStreamIndex;
+ H->MFCTypeServerIndex = 0; // Not sure what this is, but link.exe writes 0.
H->GlobalSymbolStreamIndex = GlobalsStreamIndex;
Header = H;
OpenPOWER on IntegriCloud