[Lldb-commits] [lldb] Support inline diagnostics in CommandReturnObject (PR #110901)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 10 13:03:24 PDT 2024
================
@@ -38,19 +38,23 @@ class Args {
std::unique_ptr<char[]> ptr;
char quote = '\0';
+ /// The position of the argument in the original argument string.
+ std::optional<uint16_t> column;
char *data() { return ptr.get(); }
public:
ArgEntry() = default;
- ArgEntry(llvm::StringRef str, char quote);
+ ArgEntry(llvm::StringRef str, char quote, std::optional<uint16_t> column);
llvm::StringRef ref() const { return c_str(); }
const char *c_str() const { return ptr.get(); }
/// Returns true if this argument was quoted in any way.
bool IsQuoted() const { return quote != '\0'; }
char GetQuoteChar() const { return quote; }
+ std::optional<uint16_t> GetPos() const { return column; }
+ uint16_t GetLength() const { return ref().size(); }
----------------
JDevlieghere wrote:
I was talking specifically about `GetLength`, not `GetPos`. It makes sense that the column info is a `uint16_t`, but the length of the argument shouldn't be unnecessarily truncated (imho).
https://github.com/llvm/llvm-project/pull/110901
More information about the lldb-commits
mailing list