[PATCH] D103131: support debug info for alias variable

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 28 17:10:05 PDT 2021


dblaikie added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4957
+  auto Loc = getLineNumber(D->getLocation());
+  DBuilder.createGlobalVariableExpression(
+      DContext, Name, StringRef(), Unit, Loc, Ty,
----------------
probinson wrote:
> I wasn't saying that gcc did the right thing!  Quite the opposite, I think the imported declaration is preferable, and I believe @dblaikie also thought it would be okay.
Mixed feelings - somewhat in favor of "do the thing that's probably already fairly tested/known to work" (GCC's thing). But open to the idea that that approach has problems, for sure.

Though I'm still not sure about the status of this aspect, for instance:

> How's this work if the alias target isn't declared in the source - but in inline assembly instead? (I guess GCC probably handles that OK, but the Clang strategy here might not cope with it)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103131



More information about the cfe-commits mailing list