[PATCH] D80203: [ObjectYAML][DWARF] Add DWARF entry in ELFYAML.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 25 11:14:48 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:751
+  SetVector<StringRef> DebugSecNames = DWARF.getUsedSectionNames();
+  if (!Name.empty() && Name[0] == '.' && DebugSecNames.count(Name.drop_front()))
+    return true;
----------------
`return Name.consume_front(".") && DebugSecnames.count(Name);`


================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:784
+    if (RawSec && (RawSec->Content || RawSec->Size))
+      reportError("cannot specify the '" + Name +
+                  "' section contents in the 'DWARF' entry and the 'Content' "
----------------
Use `"section '" + Name + "' "` and omit `the`

ditto below


================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:792
+  else
+    reportError("the '" + Name +
+                "' section can only be initialized from the 'DWARF' entry or "
----------------
We usually use `("section '" + Name + "' " + ...`


================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/debug-str.yaml:16
+
+# RUN: llvm-readelf --section-headers %t1.o | FileCheck %s --check-prefix=SHDRS-DEFAULT
+
----------------
`--section-headers` is very common and people tend to recognize `-S`


================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/debug-str.yaml:192
+# RUN: yaml2obj --docnum=9 %s -o %t9.o
+# RUN: llvm-readelf --section-headers %t9.o | FileCheck %s --check-prefix=NO-DEBUGSTR --implicit-check-not=.debug_str
+
----------------
`FileCheck /dev/null --implicit-check-not=.debug_str`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80203





More information about the llvm-commits mailing list