summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/CodeViewYaml.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [pdb] Dump Module Symbols to Yaml.Zachary Turner2016-10-081-594/+0
| | | | | | | | | | | | | | This is the first step towards round-tripping symbol information, and thusly being able to write symbol information to a PDB. This patch writes the symbol information for each compiland to the Yaml when running in pdb2yaml mode. There's still some loose ends, such as what to do about relocations (necessary in order to print linkage names), how to print enums with friendly names, and how to give the dumper access to the StringTable, but this is a good first start. llvm-svn: 283641
* [pdb] Get rid of Data and RawData in CVType.Zachary Turner2016-09-141-9/+50
| | | | | | | | | | | The `CVType` had two redundant fields which were confusing and error-prone to fill out. By treating member records as a distinct type from leaf records, we are able to simplify this quite a bit. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24432 llvm-svn: 281556
* [pdb] Pass CVRecord's through the visitor as non-const references.Zachary Turner2016-09-091-12/+7
| | | | | | | | | | | | | | | | | | This simplifies a lot of code, and will actually be necessary for an upcoming patch to serialize TPI record hash values. The idea before was that visitors should be examining records, not modifying them. But this is no longer true with a visitor that constructs a CVRecord from Yaml. To handle this until now, we were doing some fixups on CVRecord objects at a higher level, but the code is really awkward, and it makes sense to just have the visitor write the bytes into the CVRecord. In doing so I uncovered a few bugs related to `Data` and `RawData` and fixed those. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24362 llvm-svn: 281067
* [pdb] Write PDB TPI Stream from Yaml.Zachary Turner2016-09-091-22/+19
| | | | | | | | | | This writes the full sequence of type records described in Yaml to the TPI stream of the PDB file. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24316 llvm-svn: 281063
* [pdb] Make YamlTypeDumperCallbacks reuse *this.Zachary Turner2016-09-081-7/+6
| | | | | | | | | | | | | | | Previously we were making new instances of YamlTypeDumperCallbacks in order to recurse down and serialize / deserialize nested records such as field lists. This meant you could not pass context from a higher operation to a lower operation because it would be using a new instance of the visitor callback delegate. YAMLIO library was updated to support context-sensitive mappings, so now we can reuse the same instance of the visitor callback delegate even for nested operations. llvm-svn: 280978
* Re-add "Make FieldList records print as a YAML sequence"Zachary Turner2016-09-061-0/+42
| | | | | | | | | | | | This was originally submitted in r280549, and reverted in r280577 due to breaking one MSVC buildbot. The issue is that MSVC 2013 doesn't synthesize move constructors. So even though i was writing std::move(A) it was copying it, leading to a bogus ArrayRef. The solution here is to simply remove the std::vector<> from the type, since it is unused and unnecessary. This way the ArrayRef continues to point into the original memory backing the CVType. llvm-svn: 280769
* Revert r280549.Nico Weber2016-09-031-45/+0
| | | | | | | | | | | | | | | | | | | The test it added doesn't pass: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15318/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Apdbdump-yaml-types.test Command Output (stdout): -- $ "D:/buildslave/clang-x64-ninja-win7/stage1/./bin\llvm-pdbdump.EXE" "pdb2yaml" "-tpi-stream" "D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB/Inputs/empty.pdb" $ "D:/buildslave/clang-x64-ninja-win7/stage1/./bin\FileCheck.EXE" "-check-prefix=YAML" "D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB\pdbdump-yaml-types.test" # command stderr: D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB\pdbdump-yaml-types.test:36:7: error: expected string not found in input YAML: Name: apartment ^ <stdin>:153:10: note: scanning from here Value: 161 ^ llvm-svn: 280577
* [codeview] Make FieldList records print as a yaml sequence.Zachary Turner2016-09-021-0/+45
| | | | | | | | | | | Before we were kind of imitating the behavior of a Yaml sequence by outputting each record one after the other. This makes it a little cumbersome when we want to go the other direction -- from Yaml to Pdb. So this treats FieldList records as no different than any other list of records, by printing them as a Yaml sequence with the exact same format. llvm-svn: 280549
* [codeview] Have visitTypeBegin return the record type.Zachary Turner2016-08-311-2/+6
| | | | | | | | | | | | | | | | | | | Previously we were assuming that any visitation of types would necessarily be against a type we had binary data for. Reasonable assumption when were just reading PDBs and dumping them, but once we start writing PDBs from Yaml this breaks down, because we have no binary data yet, only Yaml, and from that we need to read the record kind and perform the switch based on that. So this patch does that. Instead of having the visitor switch on the kind that is already in the CVType record, we change the visitTypeBegin() method to return the Kind, and switch on the returned value. This way, the default implementation can still return the value from the CVType, but the implementation which visits Yaml records and serializes binary PDB type records can use the field in the Yaml as the source of the switch. llvm-svn: 280307
* [codeview] Add TypeVisitorCallbackPipeline.Zachary Turner2016-08-311-4/+14
| | | | | | | | | | | | | | | | | We were kind of hacking this together before by embedding the ability to forward requests into the TypeDeserializer. When we want to start adding more different kinds of visitor callback interfaces though, this doesn't scale well and is very inflexible. So introduce the notion of a pipeline, which itself implements the TypeVisitorCallbacks interface, but which contains an internal list of other callbacks to invoke in sequence. Also update the existing uses of CVTypeVisitor to use this new pipeline class for deserializing records before visiting them with another visitor. llvm-svn: 280293
* Resubmit "Write the TPI stream from a PDB to Yaml."Zachary Turner2016-08-181-0/+506
| | | | | | | | The original patch was breaking some buildbots due to an incorrect ordering of function definitions which caused some compilers to recognize a definition but others to not. llvm-svn: 279089
* Revert "Write the TPI stream from a PDB to Yaml."Justin Bogner2016-08-161-506/+0
| | | | | | | | | This is hitting a "use of undeclared identifier 'skipPadding' error locally and on some bots. This reverts r278869. llvm-svn: 278871
* Write the TPI stream from a PDB to Yaml.Zachary Turner2016-08-161-0/+506
Reviewed By: ruiu, rnk Differential Revision: https://reviews.llvm.org/D23226 llvm-svn: 278869
OpenPOWER on IntegriCloud