OSDN Git Service

[codeview] Have visitTypeBegin return the record type.
authorZachary Turner <zturner@google.com>
Wed, 31 Aug 2016 23:14:31 +0000 (23:14 +0000)
committerZachary Turner <zturner@google.com>
Wed, 31 Aug 2016 23:14:31 +0000 (23:14 +0000)
commit0ae82de8f5c1e56384f3fef9f3c8ef902a36d1f4
treea32e1bba00dd621f26cea259930d91e4b696e587
parent0b94abfb45c2cb52a1824730908fcd75776de78d
[codeview] Have visitTypeBegin return the record type.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280307 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/CodeView/TypeDumper.h
include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
lib/DebugInfo/CodeView/CVTypeVisitor.cpp
lib/DebugInfo/CodeView/TypeDumper.cpp
lib/DebugInfo/CodeView/TypeStreamMerger.cpp
lib/DebugInfo/PDB/Raw/TpiStream.cpp
tools/llvm-pdbdump/CodeViewYaml.cpp
tools/llvm-pdbdump/CodeViewYaml.h