[clang] [clang-tools-extra] [llvm] [Support][JSON] Use `std::map` for object storage (PR #171230)

Volodymyr Sapsai via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 21:02:41 PST 2025


================
@@ -94,9 +94,9 @@ class Value;
 template <typename T> Value toJSON(const std::optional<T> &Opt);
 
 /// An Object is a JSON object, which maps strings to heterogenous JSON values.
-/// It simulates DenseMap<ObjectKey, Value>. ObjectKey is a maybe-owned string.
+/// ObjectKey is a maybe-owned string.
 class Object {
-  using Storage = DenseMap<ObjectKey, Value, llvm::DenseMapInfo<StringRef>>;
+  using Storage = std::map<ObjectKey, Value>;
----------------
vsapsai wrote:

Should `ObjectKey` be a generic type or is it always a string? It seems stupid but I'm looking for ways not to use `std::map` and looking for alternatives.

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


More information about the llvm-commits mailing list