[PATCH] D45438: [CodeView] Enable debugging of captured variables within C++ lambdas

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 15:04:43 PDT 2018


rnk added inline comments.


================
Comment at: llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:823-826
 /// In C++ mode, types have linkage, so we can rely on the ODR and
-/// on their mangled names, if they're external.
+/// on their mangled names, if they're external or when emitting a C++
+/// record using CodeView.
 static SmallString<256> getUniqueTagTypeName(const TagType *Ty,
----------------
These comments and method names don't make sense anymore, though. We can't actually produce unique names for internal types, it's impossible without some kind of per-TU GUID.

I think this code would be a lot less confusing if we rename this to something more mechanical like `getTypeIdentifier`. CodeView needs identifiers for all C++ types, even if the names aren't unique and might collide across TUs. For DWARF, we only use identifiers if we have a unique C++ mangled name. The comment should say something about that.

Does that make sense?


https://reviews.llvm.org/D45438





More information about the llvm-commits mailing list