[PATCH] D34191: completely rewrite the llvm-pdbutil "raw" output style

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 10:45:27 PDT 2017


rnk added a comment.

I like the new format, it is more readable. Ideally we'd add an option to print the types in reverse order to make them more FileCheck friendly, so you can CHECK for a LF_STRUCT, it's name, it's field list, and use that to find the next field list. Seems like something for later.

This also seems suitable to use from `llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp`. I'll probably take that on.



================
Comment at: llvm/include/llvm/DebugInfo/CodeView/Formatters.h:50
+      Stream << formatv("{0:X+4}", V.getIndex());
+      if (V.isSimple())
+        Stream << " (" << codeview::TypeIndex::simpleTypeName(V) << ")";
----------------
Is it possible to thread a TypeDatabase into the formatter so that we can print the string? My first idea is to make it work like this:
```
struct TypeWithDB { TypeIndex TI; TypeDatabase &TDB; };
...
  // method of MinimalDumper
  TypeWithDB typeWithDB(TypeIndex TI) { return TypeWithDB{TI, TDB}; }
...
  // usage
  P.formatLine("referent = {0}, modifiers = {1}", typeWithDB(Mod.ModifiedType),
               modifierOptions(Mod.Modifiers));
```

Totally reasonable to leave as a follow up.


https://reviews.llvm.org/D34191





More information about the llvm-commits mailing list