[PATCH] D79190: llvm rejects DWARF operator DW_OP_lit[1-31].

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 13:27:00 PDT 2020


probinson added a comment.

If I take your C input program and compile it to a .o file, I see that we do emit (DW_OP_lit13; DW_OP_lit0; DW_OP_mul; DW_OP_stack_value) for "var2".

I think what you are saying is, we do not accept DW_OP_litN as *input* in the IR.  Is that correct?  If so, please make sure the commit log states that.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:400
       continue;
     } else if (OpNum >= dwarf::DW_OP_breg0 && OpNum <= dwarf::DW_OP_breg31) {
       addBReg(OpNum - dwarf::DW_OP_breg0, Op->getArg(0));
----------------
I know you did not introduce this, so I won't insist you change it, but LLVM style says do not use `else` after a `continue`.


================
Comment at: llvm/test/DebugInfo/dwarfdump-litN.ll:4
+
+; RUN: %llc_dwarf %s -O2 -filetype=obj -mtriple x86_64-unknown-linux -o %t.o
+; RUN: llvm-dwarfdump  %t.o | FileCheck %s
----------------
Remove the `-mtriple`, because you are using the %llc_dwarf substitution, which will add `-mtriple` when necessary.


================
Comment at: llvm/test/DebugInfo/dwarfdump-litN.ll:14
+
+; 2. Test whetehr DW_OP_lit5 works.
+; CHECK-LABEL:       DW_TAG_variable
----------------
Typo, "whether"


================
Comment at: llvm/test/DebugInfo/dwarfdump-litN.ll:36
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
----------------
Remove the target triple line, so the input will work for any target.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79190





More information about the llvm-commits mailing list