[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-21 Thread Antonio Maiorano via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290319: Make FormatStyle.GetStyleOfFile test work on MSVC (authored by amaiorano). Changed prior to commit: https://reviews.llvm.org/D27971?vs=82185&id=82306#toc Repository: rL LLVM https://reviews.

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-21 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/Format.cpp:1920-1922 + std::error_code EC = FS->makeAbsolute(Path); + assert(!EC); + (void)EC; amaiorano wrote: > klimek wrote: > > I think if makeAbsolute doesn't work, we will probably want to err out here

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-21 Thread Antonio Maiorano via Phabricator via cfe-commits
amaiorano added inline comments. Comment at: lib/Format/Format.cpp:1920-1922 + std::error_code EC = FS->makeAbsolute(Path); + assert(!EC); + (void)EC; klimek wrote: > I think if makeAbsolute doesn't work, we will probably want to err out here: > if (EC) { >

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-21 Thread Manuel Klimek via Phabricator via cfe-commits
klimek accepted this revision. klimek added a comment. This revision is now accepted and ready to land. Apart from the error handling LG. Thanks! Comment at: lib/Format/Format.cpp:1920-1922 + std::error_code EC = FS->makeAbsolute(Path); + assert(!EC); + (void)EC; ---

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-20 Thread Antonio Maiorano via Phabricator via cfe-commits
amaiorano updated this revision to Diff 82185. amaiorano added a comment. As agreed, modified getStyle to make use of vfs::FileSystem::makeAbsolute. I would modify the body of the commit as follows: Modify getStyle to use vfs::FileSystem::makeAbsolute just like FS.addFile does, rather than sys::

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-20 Thread Antonio Maiorano via Phabricator via cfe-commits
amaiorano added a comment. In https://reviews.llvm.org/D27971#627543, @klimek wrote: > Why isn't the right solution to make getStyle() use vfs::FileSystem? > Generally, everything in clang-format (well, in clang) should use > vfs::FileSystem for file access. You're absolutely right, this is t

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-20 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. Why isn't the right solution to make getStyle() use vfs::FileSystem? Generally, everything in clang-format (well, in clang) should use vfs::FileSystem for file access. https://reviews.llvm.org/D27971 ___ cfe-commits mailing

[PATCH] D27971: Make FormatStyle.GetStyleOfFile test work on MSVC

2016-12-19 Thread Antonio Maiorano via Phabricator via cfe-commits
amaiorano created this revision. amaiorano added reviewers: klimek, djasper, hans, cfe-commits. This is more a workaround than a real fix. The real problem is that FS.addFile uses clang::vfs::FileSystem::makeAbsolute to convert the input path to an absolute path, while getStyle uses llvm::sys::f