[PATCH] D80959: [llvm-dwarfdump] Print =<offset> after --debug-* options in help output.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 10:58:17 PDT 2020


MaskRay added a comment.

Generally looks good, only a couple of nits



================
Comment at: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:94
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, BoolOption &Val) {
+    if (Arg != "")
+      return O.error("this is a flag and does not take a value.");
----------------
I think this code path should be impossible.

`assert(!Arg.empty() && "this is a flag and does not take a value")`


================
Comment at: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:106
+
+  StringRef getValueName() const override { return StringRef(""); }
+
----------------
Either `{}` or `StringRef()` should work.


================
Comment at: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:114
+  // An out-of-line virtual method to provide a 'home' for this class.
+  void anchor() override{};
+};
----------------
A key function is only useful if the class can be included by multiple files. The whole class is defined in the .cpp file. This should be unnecessary.


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

https://reviews.llvm.org/D80959





More information about the llvm-commits mailing list