[PATCH] D21149: [CodeView] Add support for emitting S_UDT for typedefs

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 12:53:39 PDT 2016


rnk added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:780
@@ +779,3 @@
+  }
+  if (ClosestSubprogram == CurrentSubprogram) {
+    std::string FullyQualifiedName;
----------------
Why do we need this condition? Don't we want to emit typdefs at global scope? I'd expect we can reference function local typedefs from outside the function, with something like return type deduction:
  auto f() {
    typedef int myty;
    struct A {
      myty a;
    };
    return A();
  }
  decltype(f()) gv;

Maybe that's contrived, but the reliance on type emission order here feels fragile.

I was envisioning that we'd have a vector of plain DIType*'s, and we'd iterate them at end of TU and call getCompleteTypeIndex on them, which would trigger emission of all non-forward decl record types.


http://reviews.llvm.org/D21149





More information about the llvm-commits mailing list