[PATCH] D120989: Support debug info for alias variable

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 16:05:51 PDT 2022


aprantl added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:3922
+      return cast<llvm::DINode>(GVE);
+    return dyn_cast_or_null<llvm::DINode>(N);
+  }
----------------
if we don't expect anything but non-null DINodes to be in the cache, then this whole condition should be
```
return cast<llvm::DINode>(N);
```
That will assert if N is null.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:5508
+    return;
+  else if (!(DI = getDeclarationOrDefinition(
+                 AliaseeDecl.getCanonicalDecl().getDecl())))
----------------
LLVM coding style says to remove the redundant `else` after a `return`.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:5518
+
+  // Record this DIE in the cache for nested declaration reference
+  ImportedDeclCache[GD.getCanonicalDecl().getDecl()].reset(ImportDI);
----------------
`.`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120989



More information about the cfe-commits mailing list