[Lldb-commits] [lldb] Support inline diagnostics in CommandReturnObject (PR #110901)

via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 10 11:09:23 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(); }
----------------
jimingham wrote:

These are transitory object, made by a command when executed and destroyed when it is done.  So I don't think we need to worry about how big they are.

https://github.com/llvm/llvm-project/pull/110901


More information about the lldb-commits mailing list