1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/unittests/DebugInfo/PDB
Zachary Turner 5f8e1427eb [CodeView] Simplify the use of visiting type records & streams.
There is often a lot of boilerplate code required to visit a type
record or type stream.  The #1 use case is that you have a sequence
of bytes that represent one or more records, and you want to
deserialize each one, switch on it, and call a callback with the
deserialized record that the user can examine.  Currently this
requires at least 6 lines of code:

  codeview::TypeVisitorCallbackPipeline Pipeline;
  Pipeline.addCallbackToPipeline(Deserializer);
  Pipeline.addCallbackToPipeline(MyCallbacks);

  codeview::CVTypeVisitor Visitor(Pipeline);
  consumeError(Visitor.visitTypeRecord(Record));

With this patch, it becomes one line of code:

  consumeError(codeview::visitTypeRecord(Record, MyCallbacks));

This is done by having the deserialization happen internally inside
of the visitTypeRecord function.  Since this is occasionally not
desirable, the function provides a 3rd parameter that can be used
to change this behavior.

Hopefully this can significantly reduce the barrier to entry
to using the visitation infrastructure.

Differential Revision: https://reviews.llvm.org/D33245

llvm-svn: 303271
2017-05-17 16:39:06 +00:00
..
CMakeLists.txt [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
ErrorChecking.h [llvm-readobj] Update readobj to re-use parsing code. 2017-05-03 17:11:11 +00:00
HashTableTest.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
MappedBlockStreamTest.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
MSFBuilderTest.cpp
PDBApiTest.cpp [llvm-pdbdump] More advanced class definition dumping. 2017-04-12 23:18:21 +00:00
StringTableBuilderTest.cpp Delete dead function causing compilation failure. 2017-05-03 17:38:49 +00:00
TypeServerHandlerTest.cpp [CodeView] Simplify the use of visiting type records & streams. 2017-05-17 16:39:06 +00:00