[PATCH] D25108: Do not pass a superblock to PDBFileBuilder.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 14:01:17 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282944: Do not pass a superblock to PDBFileBuilder. (authored by ruiu).
Changed prior to commit:
https://reviews.llvm.org/D25108?vs=73132&id=73135#toc
Repository:
rL LLVM
https://reviews.llvm.org/D25108
Files:
llvm/trunk/include/llvm/DebugInfo/MSF/MSFBuilder.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
llvm/trunk/lib/DebugInfo/MSF/MSFBuilder.cpp
llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
Index: llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
@@ -32,18 +32,11 @@
PDBFileBuilder::PDBFileBuilder(BumpPtrAllocator &Allocator)
: Allocator(Allocator) {}
-Error PDBFileBuilder::initialize(const msf::SuperBlock &Super) {
- auto ExpectedMsf =
- MSFBuilder::create(Allocator, Super.BlockSize, Super.NumBlocks);
+Error PDBFileBuilder::initialize(uint32_t BlockSize) {
+ auto ExpectedMsf = MSFBuilder::create(Allocator, BlockSize);
if (!ExpectedMsf)
return ExpectedMsf.takeError();
-
- auto &MsfResult = *ExpectedMsf;
- if (auto EC = MsfResult.setBlockMapAddr(Super.BlockMapAddr))
- return EC;
- Msf = llvm::make_unique<MSFBuilder>(std::move(MsfResult));
- Msf->setFreePageMap(Super.FreeBlockMapBlock);
- Msf->setUnknown1(Super.Unknown1);
+ Msf = llvm::make_unique<MSFBuilder>(std::move(*ExpectedMsf));
return Error::success();
}
Index: llvm/trunk/lib/DebugInfo/MSF/MSFBuilder.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/MSF/MSFBuilder.cpp
+++ llvm/trunk/lib/DebugInfo/MSF/MSFBuilder.cpp
@@ -19,12 +19,14 @@
const uint32_t kFreePageMap1Block = 2;
const uint32_t kNumReservedPages = 3;
+const uint32_t kDefaultFreePageMap = kFreePageMap0Block;
const uint32_t kDefaultBlockMapAddr = kNumReservedPages;
}
MSFBuilder::MSFBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow,
BumpPtrAllocator &Allocator)
- : Allocator(Allocator), IsGrowable(CanGrow), BlockSize(BlockSize),
+ : Allocator(Allocator), IsGrowable(CanGrow),
+ FreePageMap(kDefaultFreePageMap), BlockSize(BlockSize),
MininumBlocks(MinBlockCount), BlockMapAddr(kDefaultBlockMapAddr),
FreeBlocks(MinBlockCount, true) {
FreeBlocks[kSuperBlockBlock] = false;
Index: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
===================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -323,7 +323,7 @@
PDBFileBuilder Builder(Allocator);
- ExitOnErr(Builder.initialize(YamlObj.Headers->SuperBlock));
+ ExitOnErr(Builder.initialize(YamlObj.Headers->SuperBlock.BlockSize));
// Add each of the reserved streams. We ignore stream metadata in the
// yaml, because we will reconstruct our own view of the streams. For
// example, the YAML may say that there were 20 streams in the original
Index: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
===================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
@@ -36,7 +36,7 @@
PDBFileBuilder(const PDBFileBuilder &) = delete;
PDBFileBuilder &operator=(const PDBFileBuilder &) = delete;
- Error initialize(const msf::SuperBlock &Super);
+ Error initialize(uint32_t BlockSize);
msf::MSFBuilder &getMsfBuilder();
InfoStreamBuilder &getInfoBuilder();
Index: llvm/trunk/include/llvm/DebugInfo/MSF/MSFBuilder.h
===================================================================
--- llvm/trunk/include/llvm/DebugInfo/MSF/MSFBuilder.h
+++ llvm/trunk/include/llvm/DebugInfo/MSF/MSFBuilder.h
@@ -128,7 +128,7 @@
bool IsGrowable;
uint32_t FreePageMap;
- uint32_t Unknown1;
+ uint32_t Unknown1 = 0;
uint32_t BlockSize;
uint32_t MininumBlocks;
uint32_t BlockMapAddr;
Index: llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
===================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
@@ -8,8 +8,8 @@
CHECK: FileHeaders {
CHECK-NEXT: BlockSize: 4096
-CHECK-NEXT: FreeBlockMap: 2
-CHECK-NEXT: NumBlocks: 25
+CHECK-NEXT: FreeBlockMap:
+CHECK-NEXT: NumBlocks:
CHECK-NEXT: NumDirectoryBytes:
CHECK-NEXT: Unknown1: 0
CHECK-NEXT: BlockMapAddr:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25108.73135.patch
Type: text/x-patch
Size: 4127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160930/2966f53d/attachment.bin>
More information about the llvm-commits
mailing list