summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Rename (PDB) RawSession to NativeSessionAdrian McCarthy2017-01-251-412/+0
| | | | | | | | This eliminates one overload on the term Raw. Differential Revision: https://reviews.llvm.org/D29098 llvm-svn: 293104
* Remove PDBFileBuilder::build() and related functions.Rui Ueyama2016-11-221-21/+0
| | | | | | | | | | | | | | | | | | | PDBFileBuilder supports two different ways to create files. One is PDBFileBuilder::commit. That function takes a filename and write a result to the file. The other is PDBFileBuilder::build. That returns a new PDBFile object. This patch removes the latter because no one is using it and in a real life situation we are very unlikely to need it. Even if you need it, it'd be easy to write a new PDB to a memory buffer and read it back. Removing PDBFileBuilder::build enables us to remove other classes build transitively. Differential Revision: https://reviews.llvm.org/D26987 llvm-svn: 287697
* Align Modi and FileInfo substreams on 32-byte offsets.Rui Ueyama2016-11-161-4/+4
| | | | | | | | | | This is required by DbiStream, but DbiStreamBuilder didn't align these substreams, so the output of DbiSTreamBuilder couldn't be read by DbiStream. Test will be added to LLD. llvm-svn: 287067
* Fix Modi and File count if there are more than 65535 modules/files.Rui Ueyama2016-11-161-2/+2
| | | | | | | | These numbers are intended to be capped at 65535, but `std::max<uint16_t>(UINT16_MAX, N)` always returns N for any N because the expression is the same as `std::max((uint16_t)UINT16_MAX, (uint16_t)N)`. llvm-svn: 287060
* Remove extra semicolon.Rui Ueyama2016-11-121-1/+1
| | | | llvm-svn: 286688
* Define DbiStreamBuilder::addSectionContribs.Rui Ueyama2016-11-111-3/+40
| | | | | | | | | | | | | | This patch defines a new function to add a SectionContribs stream to a PDB file. Unlike SectionMap, SectionContribs contains a list of input sections as opposed to output sections. Note that this patch needs improving because currently we do not set Module field in SectionContribs entries. In a follow-up patch, I'll add Modules and then fix it after that. Differential Revision: https://reviews.llvm.org/D26210 llvm-svn: 286677
* PDB: Fix some APIs to avoid use-after-freesJustin Bogner2016-11-031-3/+3
| | | | | | | The buffer is already owned by the PDBFile for all of these APIs, so don't pass it in separately. llvm-svn: 285953
* Define DbiStreamBuilder::addSectionMap.Rui Ueyama2016-10-311-2/+85
| | | | | | | | | | | | | This change enables LLD to construct a Section Map stream in a PDB file. I do not understand all these fields in the Section Map yet, but it seems like a copy of a COFF section header in another format. With this patch, DbiStreamBuilder can emit a Section Map which llvm-pdbdump can dump. Differential Revision: https://reviews.llvm.org/D26112 llvm-svn: 285606
* Define calculateDbgStreamSize for consistency.Rui Ueyama2016-10-291-1/+5
| | | | llvm-svn: 285487
* Avoid braced initialization for default member initializers for MSVC 2013Reid Kleckner2016-10-111-1/+1
| | | | llvm-svn: 283928
* Re-submit r283823: Define DbiStreamBuilder::addDbgStream to add stream.Rui Ueyama2016-10-111-2/+30
| | | | | | | The previous commit was failing because we filled empty slots of the debug stream index with kInvalidStreamIndex. It should've been 0. llvm-svn: 283925
* Revert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream.Rui Ueyama2016-10-111-30/+2
| | | | | | This reverts commit r283824 and r283823 to fix buildbots. llvm-svn: 283828
* Fix a bug in DbiStreamBuilder::addDbgStream.Rui Ueyama2016-10-101-1/+1
| | | | | | This feature will be tested in LLD unit tests. llvm-svn: 283824
* Define DbiStreamBuilder::addDbgStream to add stream.Rui Ueyama2016-10-101-2/+30
| | | | | | | | | | Previously, there is no way to create a stream other than pre-defined special stream such as DBI or IPI. This patch adds a new method, addDbgStream, to add a debug stream to a PDB file. Differential Revision: https://reviews.llvm.org/D25356 llvm-svn: 283823
* [pdb] Write TPI hash values to the TPI stream.Zachary Turner2016-09-141-3/+12
| | | | | | | | | | This completes being able to write all the interesting values of a PDB TPI stream. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24370 llvm-svn: 281555
* pdbdump: Fix crash bug.Rui Ueyama2016-08-031-1/+4
| | | | | | | | | | pdbdump calls DbiStreamBuilder::commit through PDBFileBuilder::commit without calling DbiStreamBuilder::finalize. Because `finalize` initializes `Header` member, `Header` remained nullptr which caused a crash bug. Differential Revision: https://reviews.llvm.org/D23143 llvm-svn: 277681
* [msf] Resubmit "Rename Msf -> MSF".Zachary Turner2016-07-291-3/+3
| | | | | | | | | | | | | Previously this change was submitted from a Windows machine, so changes made to the case of filenames and directory names did not survive the commit, and as a result the CMake source file names and the on-disk file names did not match on case-sensitive file systems. I'm resubmitting this patch from a Linux system, which hopefully allows the case changes to make it through unfettered. llvm-svn: 277213
* Revert "[msf] Rename Msf to MSF."Zachary Turner2016-07-291-3/+3
| | | | | | This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe. llvm-svn: 277194
* [msf] Rename Msf to MSF.Zachary Turner2016-07-291-3/+3
| | | | | | | | In a previous patch, it was suggested to use all caps instead of rolling caps for initialisms, so this patch changes everything to do this. llvm-svn: 277190
* [pdb] Fix some warnings that break -Werror builds.Zachary Turner2016-07-281-2/+2
| | | | llvm-svn: 277021
* [pdb] Refactor library to more clearly separate reading/writingZachary Turner2016-07-281-18/+48
| | | | | | | Reviewed By: amccarth, ruiu Differential Revision: https://reviews.llvm.org/D22693 llvm-svn: 277019
* [msf] Create LLVMDebugInfoMsfZachary Turner2016-07-221-2/+3
| | | | | | | | | | | | | | This provides a better layering of responsibilities among different aspects of PDB writing code. Some of the MSF related code was contained in CodeView, and some was in PDB prior to this. Further, we were often saying PDB when we meant MSF, and the two are actually independent of each other since in theory you can have other types of data besides PDB data in an MSF. So, this patch separates the MSF specific code into its own library, with no dependencies on anything else, and DebugInfoCodeView and DebugInfoPDB take dependencies on DebugInfoMsf. llvm-svn: 276458
* [pdb] Move file layout header structs to RawTypes.hZachary Turner2016-07-221-18/+9
| | | | | | | | This facilitates code reuse between the builder classes and the "frozen" read only versions of the classes used for parsing existing PDB files. llvm-svn: 276427
* [pdb] Round-trip module & file info to/from YAML.Zachary Turner2016-07-221-6/+172
| | | | | | | | | | This implements support for writing compiland and compiland source file info to a binary PDB. This is tested by adding support for dumping these fields from an existing PDB to yaml, reading them back in, and dumping them again and verifying the values are as expected. llvm-svn: 276426
* [pdb] Use MsfBuilder to handle the writing PDBs.Zachary Turner2016-07-151-4/+9
| | | | | | | | | | | | | | | Previously we would read a PDB, then write some of it back out, but write the directory, super block, and other pertinent metadata back out unchanged. This generates incorrect PDBs since the amount of data written was not always the same as the amount of data read. This patch changes things to use the newly introduced `MsfBuilder` class to write out a correct and accurate set of Msf metadata for the data *actually* written, which opens up the door for adding and removing type records, symbol records, and other types of data to an existing PDB. llvm-svn: 275627
* Refactor the PDB writing to use a builder approachZachary Turner2016-07-111-0/+76
llvm-svn: 275110
OpenPOWER on IntegriCloud