1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
llvm-mirror/unittests
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
..
ADT [BitVector] Add find_[first,last]_[set,unset]_in. 2017-05-17 15:49:45 +00:00
Analysis Add hasProfileSummary and has{Sample|Instrumentation}Profile methods 2017-05-16 20:14:39 +00:00
AsmParser
Bitcode
CodeGen [SVE] Fix mismatched sign comparison warning in unit test from r300842. 2017-04-20 16:54:49 +00:00
DebugInfo [CodeView] Simplify the use of visiting type records & streams. 2017-05-17 16:39:06 +00:00
ExecutionEngine [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
IR [ConstantRange] Fix what appear to be copy and paste mistakes in the unittest. 2017-05-15 04:40:19 +00:00
LineEditor
Linker
MC
MI Fix subreg value numbers in handleMoveUp 2017-03-11 00:14:52 +00:00
Object
ObjectYAML
Option Fix some ArgList uses after API change in r300135. 2017-04-12 23:43:58 +00:00
ProfileData Fix signed/unsigned comparison warning 2017-03-11 19:38:22 +00:00
Support Add test for FixedStreamArrayIterator::operator-> 2017-05-16 22:11:25 +00:00
Target [globalisel][tablegen] Compute available feature bits correctly. 2017-04-29 17:30:09 +00:00
Transforms Make it illegal for two Functions to point to the same DISubprogram 2017-05-09 19:47:37 +00:00
XRay
CMakeLists.txt