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.
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
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) {
>
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;
---
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::
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
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
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