[PATCH] D52058: Add Parameters to DW_AT_name Attribute of Template Variables

Jonas Devlieghere via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 18 00:07:22 PDT 2018


JDevlieghere added a comment.

Generally this looks good, but I'd like for the other to have a look first (at this and the other patch) before accepting.



================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1783
+  if (auto *TS = dyn_cast<VarTemplateSpecializationDecl>(VL)) {
+    if (TS->getSpecializedTemplateOrPartial()
+            .is<VarTemplatePartialSpecializationDecl *>()) {
----------------
Might be nice to add a comment here saying what you're doing in this block and below. Looks like the top one is for partial specialization and the bottom one for the general case?


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1783
+  if (auto *TS = dyn_cast<VarTemplateSpecializationDecl>(VL)) {
+    if (TS->getSpecializedTemplateOrPartial()
+            .is<VarTemplatePartialSpecializationDecl *>()) {
----------------
JDevlieghere wrote:
> Might be nice to add a comment here saying what you're doing in this block and below. Looks like the top one is for partial specialization and the bottom one for the general case?
I also suggest to extract `TS->getSpecializedTemplateOrPartial()` into a variable to make this a little less dense.


Repository:
  rC Clang

https://reviews.llvm.org/D52058





More information about the cfe-commits mailing list