[PATCH] D28014: Support: Add YAML I/O support for string maps.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 20:00:50 PST 2017


pcc added a comment.

In https://reviews.llvm.org/D28014#629451, @mehdi_amini wrote:

> One nit: you're using `StringMap` everywhere and it can be confusing since it is not about the `llvm::StringMap`


The name `CustomMapping` seems a little better, I'll rename and commit.



================
Comment at: llvm/include/llvm/Support/YAMLTraits.h:1550-1557
+  static void inputOne(IO &io, StringRef key, T &v) {
+    io.mapRequired(key.str().c_str(), v[key]);
+  }
+  static void output(IO &io, T &v) {
+    for (auto &p : v)
+      io.mapRequired(p.first.c_str(), p.second);
+  }
----------------
davide wrote:
> nit: I think the variable names should start with a capital letter.
I'm just following the style in the rest of this file.


https://reviews.llvm.org/D28014





More information about the llvm-commits mailing list