[PATCH] D20147: [WIP] DebugInfo: New metadata representation for global variables.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 17:54:47 PDT 2016


pcc added a comment.

> If you happen to have a script to upgrade the testcases, it would be great if you could file a PR for this and attach the script there and comment in the commit message


Filed PR30362 with an upgrade program.


================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:2605
@@ +2604,3 @@
+      // Upgrade old metadata, which stored a global variable reference or a
+      // ConstantInt here.
+      Metadata *Expr = getMDOrNull(Record[9]);
----------------
aprantl wrote:
> Please make sure to add a binary bitcode upgrade test case for this.
After this patch `test/Bitcode/diglobalvariable-3.8.ll` and `test/Bitcode/dityperefs-3.8.ll` will respectively be testing the constant and variable cases.

================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:129
@@ +128,3 @@
+  // DW_AT_const_value(X).
+  if (Expr && Expr->getNumElements() == 3 &&
+      Expr->getElement(0) == dwarf::DW_OP_constu &&
----------------
aprantl wrote:
> Since we already have a special createConstantValueExpression() method we could also add an Optional<uint64> getConstantValueExpression() accessor?
Maybe if we need to query this in more than one place. For now it seems clearer to be direct here.


https://reviews.llvm.org/D20147





More information about the llvm-commits mailing list