[PATCH] D57790: [CodeView] Fix cycles in debug info when merging Types with global hashes

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 16:15:37 PST 2019


zturner added inline comments.


================
Comment at: include/llvm/DebugInfo/CodeView/TypeCollection.h:33
   virtual uint32_t capacity() = 0;
+  virtual ArrayRef<ArrayRef<uint8_t>> records() const = 0;
 
----------------
rnk wrote:
> I guess this is a question for @zturner.
I'm not sold on this method.  It doesn't make much sense in the base class here, because you could theoretically have implementations that aren't backed by an array.  It sounds like you even ran into this in `LazyRandomTypeCollection`.  However, I don't actually think you need this anyway.  More on why later in a later comment.



================
Comment at: tools/llvm-readobj/COFFDumper.cpp:1929
 
   TypeTableCollection TpiTypes(CVTypes.records());
   {
----------------
Instead of constructing a `TypeTableCollection` here and passing it `CVTypes.records()`, I think you can just use the `CVTypes` directly.  Specifically, something like this should work:

```
{
  ListScope S(Writer, "MergedTypeStream");
  TypeDumpVisitor TDV(CVTypes, &Writer, opts::CodeViewSubsectionBytes);
  error(codeview::visitTypeStream(TpiTypes, TDV);
  Writer.flush();
}
```

and similarly for the code below.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57790/new/

https://reviews.llvm.org/D57790





More information about the llvm-commits mailing list