[PATCH] D51289: [XRay] FDR Record Producer/Consumer Implementation

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 31 00:57:09 PDT 2018


dberris added inline comments.


================
Comment at: llvm/lib/XRay/FDRRecordProducer.cpp:31
+  // For metadata records, handle especially here.
+  if (FirstByte & 0x01) {
+    // FIXME: Use a registry, and dispatch based on record types more
----------------
eizan wrote:
> nit: Instead of doing the bitwise ops directly here and in the switch statement argument + elsewhere, why not declare something like bool is_metadata(uint8_t b) and enum MetadataType metadata_type(uint8t_t d). That way you don't need somebody to refer to your comment at the top of this function, and if you use enum values you don't need to annotate each 'case N:' line.
Good point -- I've refactored this a bit to make it easier to see the mapping between the loaded type and the type of the record to create.


https://reviews.llvm.org/D51289





More information about the llvm-commits mailing list