[lld] r283392 - Add an empty IPI stream.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 14:37:25 PDT 2016
Author: ruiu
Date: Wed Oct 5 16:37:25 2016
New Revision: 283392
URL: http://llvm.org/viewvc/llvm-project?rev=283392&view=rev
Log:
Add an empty IPI stream.
With this, "llvm-pdbdump yaml -ipi-stream" prints out an IPI stream.
Previously it crashed because it can't handle the case where IPI
stream doesn't exist.
Modified:
lld/trunk/COFF/PDB.cpp
lld/trunk/test/COFF/pdb.test
Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=283392&r1=283391&r2=283392&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Wed Oct 5 16:37:25 2016
@@ -38,6 +38,8 @@ void coff::createPDB(StringRef Path) {
ExitOnErr(Builder.getMsfBuilder().addStream(1));
ExitOnErr(Builder.getMsfBuilder().addStream(1));
ExitOnErr(Builder.getMsfBuilder().addStream(1));
+ ExitOnErr(Builder.getMsfBuilder().addStream(1));
+ ExitOnErr(Builder.getMsfBuilder().addStream(1));
// Add an Info stream.
auto &InfoBuilder = Builder.getInfoBuilder();
@@ -55,6 +57,10 @@ void coff::createPDB(StringRef Path) {
auto &TpiBuilder = Builder.getTpiBuilder();
TpiBuilder.setVersionHeader(pdb::PdbTpiV80);
+ // Add an empty IPI stream.
+ auto &IpiBuilder = Builder.getIpiBuilder();
+ IpiBuilder.setVersionHeader(pdb::PdbTpiV80);
+
// Write to a file.
ExitOnErr(Builder.commit(Path));
}
Modified: lld/trunk/test/COFF/pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb.test?rev=283392&r1=283391&r2=283392&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb.test (original)
+++ lld/trunk/test/COFF/pdb.test Wed Oct 5 16:37:25 2016
@@ -1,31 +1,36 @@
# RUN: yaml2obj %s > %t.obj
# RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll /entry:DllMain %t.obj
# RUN: llvm-pdbdump pdb2yaml -stream-metadata -stream-directory -pdb-stream \
-# RUN: %t.pdb | FileCheck %s
+# RUN: -ipi-stream %t.pdb | FileCheck %s
# CHECK: MSF:
# CHECK-NEXT: SuperBlock:
# CHECK-NEXT: BlockSize: 4096
# CHECK-NEXT: FreeBlockMap:
-# CHECK-NEXT: NumBlocks: 8
-# CHECK-NEXT: NumDirectoryBytes: 28
+# CHECK-NEXT: NumBlocks: 10
+# CHECK-NEXT: NumDirectoryBytes: 44
# CHECK-NEXT: Unknown1: 0
# CHECK-NEXT: BlockMapAddr: 3
# CHECK-NEXT: NumDirectoryBlocks: 1
-# CHECK-NEXT: DirectoryBlocks: [ 7 ]
-# CHECK-NEXT: NumStreams: 3
-# CHECK-NEXT: FileSize: 32768
-# CHECK-NEXT: StreamSizes: [ 1, 48, 56 ]
+# CHECK-NEXT: DirectoryBlocks: [ 9 ]
+# CHECK-NEXT: NumStreams: 5
+# CHECK-NEXT: FileSize: 40960
+# CHECK-NEXT: StreamSizes: [ 1, 48, 56, 1, 56 ]
# CHECK-NEXT: StreamMap:
# CHECK-NEXT: - Stream: [ 4 ]
# CHECK-NEXT: - Stream: [ 5 ]
# CHECK-NEXT: - Stream: [ 6 ]
+# CHECK-NEXT: - Stream: [ 7 ]
+# CHECK-NEXT: - Stream: [ 8 ]
# CHECK-NEXT: PdbStream:
# CHECK-NEXT: Age: 1
# CHECK-NEXT: Guid: '{00000000-0000-0000-0000-000000000000}'
# CHECK-NEXT: Signature: 0
# CHECK-NEXT: Version: VC70
# CHECK-NEXT: NamedStreams:
+# CHECK-NEXT: IpiStream:
+# CHECK-NEXT: Version: VC80
+# CHECK-NEXT: Records:
--- !COFF
header:
More information about the llvm-commits
mailing list