Page MenuHomePhabricator

Added support for different VFSs in format::getStyle.
ClosedPublic

Authored by ioeric on Mar 23 2016, 9:01 AM.

Details

Summary

Previously, format::getStyle assumes that the given file resides in
the real file system, which prevents the use of virtual file system in testing etc.
This patch adds a parameter in format::getStyle interface so that users can specify
the right file system. By default, the file system is the real file system.

Diff Detail

Repository
rL LLVM

Event Timeline

ioeric updated this revision to Diff 51425.Mar 23 2016, 9:01 AM
ioeric retitled this revision from to Added support for different VFSs in format::getStyle..
ioeric updated this object.
ioeric added reviewers: klimek, djasper.
ioeric added a subscriber: cfe-commits.
klimek added inline comments.Mar 23 2016, 9:04 AM
lib/Format/Format.cpp
2103 ↗(On Diff #51425)

I think this comment is redundant. I'd remove it.

2149 ↗(On Diff #51425)

Any reason to not just reassign Status (here and below)?

2157 ↗(On Diff #51425)

I'm aware you didn't change this, but is Twine() really necessary?

ioeric updated this revision to Diff 51426.Mar 23 2016, 9:13 AM
  • removed redundant code.
ioeric updated this revision to Diff 51431.Mar 23 2016, 9:22 AM
ioeric marked 3 inline comments as done.
  • some more redundancy removed
klimek added inline comments.Mar 23 2016, 9:50 AM
lib/Format/Format.cpp
2148 ↗(On Diff #51431)

Prefer .str to .c_str, the former is nicely typed. (here and below)

ioeric updated this revision to Diff 51440.Mar 23 2016, 9:59 AM
  • changed c_str() to str()
klimek accepted this revision.Mar 23 2016, 10:00 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.Mar 23 2016, 10:00 AM
This revision was automatically updated to reflect the committed changes.