[llvm] [Support] add vector::erase to JSON::Array (PR #168835)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 22:53:55 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Erick Velez (evelez7)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/168835.diff


1 Files Affected:

- (modified) llvm/include/llvm/Support/JSON.h (+2) 


``````````diff
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index 37baa7b45e4eb..a58332c912942 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -205,6 +205,7 @@ class Array {
   iterator insert(const_iterator P, Value &&E);
   template <typename It> iterator insert(const_iterator P, It A, It Z);
   template <typename... Args> iterator emplace(const_iterator P, Args &&...A);
+  iterator erase(const_iterator P);
 
   friend bool operator==(const Array &L, const Array &R);
 };
@@ -579,6 +580,7 @@ template <typename... Args>
 inline Array::iterator Array::emplace(const_iterator P, Args &&...A) {
   return V.emplace(P, std::forward<Args>(A)...);
 }
+inline Array::iterator Array::erase(const_iterator P) { return V.erase(P); }
 inline bool operator==(const Array &L, const Array &R) { return L.V == R.V; }
 
 /// ObjectKey is a used to capture keys in Object. Like Value but:

``````````

</details>


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


More information about the llvm-commits mailing list