[PATCH] D61926: Emit global variables as S_CONSTANT records for codeview debug info.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 12:56:52 PDT 2019


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm with some nits



================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3059
+    // This should also emit enums and static data members.
+    if (!DIE->isConstant())
+      return;
----------------
rnk wrote:
> I think it would be better to check `isConstant()` earlier, before we set up the pointer union, so that no non-constant expressions make it here.
nit: I guess we should assert isConstant() here. I wish there was some helper for pulling out the constant value. :(


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3063
+
+    uint8_t data[64];
+    BinaryStreamWriter Writer(data, llvm::support::endianness::little);
----------------
I think 10 bytes is all that's needed to write an encoded integer, so this might as well be 10 bytes long with a comment about it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61926





More information about the llvm-commits mailing list