This is an archive of the discontinued LLVM Phabricator instance.

Support: Add YAML I/O support for string maps.
ClosedPublic

Authored by pcc on Dec 20 2016, 7:21 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 82193.Dec 20 2016, 7:21 PM
pcc retitled this revision from to Support: Add YAML I/O support for string maps..
pcc updated this object.
pcc added a reviewer: mehdi_amini.
pcc added a subscriber: llvm-commits.
mehdi_amini accepted this revision.Dec 21 2016, 10:32 PM
mehdi_amini edited edge metadata.

I'm not very familiar with the YAML library, but this seems OK to me.

This revision is now accepted and ready to land.Dec 21 2016, 10:32 PM

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

davide added a subscriber: davide.Dec 22 2016, 2:14 AM
davide added inline comments.
llvm/include/llvm/Support/YAMLTraits.h
1550–1557 ↗(On Diff #82193)

nit: I think the variable names should start with a capital letter.

pcc added a comment.Jan 3 2017, 8:00 PM

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.

llvm/include/llvm/Support/YAMLTraits.h
1550–1557 ↗(On Diff #82193)

I'm just following the style in the rest of this file.

This revision was automatically updated to reflect the committed changes.
majnemer added inline comments.
llvm/trunk/lib/Support/YAMLTraits.cpp
389–393

Isn't this: return is_contained(ValidKeys, Key);?

mehdi_amini added inline comments.Jan 3 2017, 9:35 PM
llvm/trunk/lib/Support/YAMLTraits.cpp
389–393

Sweet, I didn't know about llvm::is_contained!

pcc added inline comments.Jan 4 2017, 12:21 PM
llvm/trunk/lib/Support/YAMLTraits.cpp
389–393

Thanks. I changed the code to use is_contained in r290999.