[Lldb-commits] [PATCH] D100965: [lldb] Refactor argument group by SourceLocationSpec (NFCI)

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 23 12:31:19 PDT 2021


JDevlieghere added inline comments.


================
Comment at: lldb/source/API/SBThread.cpp:853-856
+      std::string err_msg = "Invalid SourceLocationSpec: ";
+      err_msg += llvm::toString(location_spec.takeError());
+      sb_error.SetErrorString(err_msg.c_str());
+      return sb_error;
----------------
Let's move `Invalid SourceLocationSpec:` (without the capitalization) into the error reported by `SourceLocationSpec::Create` and use the `Status` ctor that takes an `llvm::Error` to avoid this code duplication. 


================
Comment at: lldb/source/API/SBThread.cpp:852
+    auto location_spec = SourceLocationSpec::Create(
+        step_file_spec, line, column, check_inlines, exact);
+    lldbassert(location_spec && "Invalid SourceLocationSpec.");
----------------
shafik wrote:
> ```
> step_file_spec, line, /*column*/llvm::None, check_inlines, exact);
> ```
As @teemperor pointed out in another patch, the llvm style includes a `=` at the end (https://www.llvm.org/docs/CodingStandards.html#comment-formatting)

```
auto location_spec = SourceLocationSpec::Create(
        step_file_spec, line, /*colum=*/llvm::None, check_inlines, exact);```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100965



More information about the lldb-commits mailing list