summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-03-29 18:34:15 +0000
committerZachary Turner <zturner@google.com>2018-03-29 18:34:15 +0000
commit3203e274730ba8712a006ca5a961e33100b81e0e (patch)
treebdd375e31559ee4faa5087428853c4aed5b0f6a6 /llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp
parentfb1db6ae43c6d31811bf3f6f3246b3e07ef983de (diff)
downloadbcm5719-llvm-3203e274730ba8712a006ca5a961e33100b81e0e.tar.gz
bcm5719-llvm-3203e274730ba8712a006ca5a961e33100b81e0e.zip
[MSF] Default to FPM2, and always mark FPM pages allocated.
There are two FPMs in an MSF file, the idea being that for incremental updates you can write to the alternate one and then atomically swap them on commit. LLVM defaulted to using FPM1 on the first commit, but this differs from Microsoft's behavior which is to default to using FPM2 on the first commit. To eliminate some byte-level file differences, this patch changes LLVM's default to also be FPM2. Additionally, LLVM was trying to be "smart" about marking FPM pages allocated. In addition to marking every page belonging to the alternate FPM as unallocated, LLVM also marked pages at the end of the main FPM which were not needed as unallocated. In order to match the behavior of Microsoft-generated PDBs, we now always mark every FPM block as allocated, regardless of whether it is in the main FPM or the alt FPM, and regardless of whether or not it describes blocks which are actually in the file. This has the side benefit of simplifying our code. llvm-svn: 328812
Diffstat (limited to 'llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp b/llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp
index a91ac8d443f..2e317796250 100644
--- a/llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp
+++ b/llvm/unittests/DebugInfo/MSF/MSFBuilderTest.cpp
@@ -384,10 +384,9 @@ TEST_F(MSFBuilderTest, StreamDoesntUseFpmBlocks) {
EXPECT_EQ(StreamSize, L.StreamSizes[*SN]);
for (uint32_t I = 0; I <= 3; ++I) {
- // Pages from the regular FPM are allocated, while pages from the alt fpm
- // are free.
+ // Pages from both FPMs are always allocated.
+ EXPECT_FALSE(L.FreePageMap.test(2 + I * 4096));
EXPECT_FALSE(L.FreePageMap.test(1 + I * 4096));
- EXPECT_TRUE(L.FreePageMap.test(2 + I * 4096));
}
for (uint32_t I = 1; I <= 3; ++I) {
OpenPOWER on IntegriCloud