r209956 - Use make_error_code in preparation for making errc an enum class.
Rafael Espindola
rafael.espindola at gmail.com
Fri May 30 19:23:01 PDT 2014
Author: rafael
Date: Fri May 30 21:23:01 2014
New Revision: 209956
URL: http://llvm.org/viewvc/llvm-project?rev=209956&view=rev
Log:
Use make_error_code in preparation for making errc an enum class.
Modified:
cfe/trunk/lib/Basic/VirtualFileSystem.cpp
cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=209956&r1=209955&r2=209956&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Fri May 30 21:23:01 2014
@@ -201,7 +201,7 @@ ErrorOr<Status> OverlayFileSystem::statu
if (Status || Status.getError() != errc::no_such_file_or_directory)
return Status;
}
- return error_code(errc::no_such_file_or_directory, system_category());
+ return make_error_code(errc::no_such_file_or_directory);
}
error_code OverlayFileSystem::openFileForRead(const llvm::Twine &Path,
@@ -212,7 +212,7 @@ error_code OverlayFileSystem::openFileFo
if (!EC || EC != errc::no_such_file_or_directory)
return EC;
}
- return error_code(errc::no_such_file_or_directory, system_category());
+ return make_error_code(errc::no_such_file_or_directory);
}
//===-----------------------------------------------------------------------===/
@@ -744,7 +744,7 @@ ErrorOr<Entry *> VFSFromYAML::lookupPath
return EC;
if (Path.empty())
- return error_code(errc::invalid_argument, system_category());
+ return make_error_code(errc::invalid_argument);
sys::path::const_iterator Start = sys::path::begin(Path);
sys::path::const_iterator End = sys::path::end(Path);
@@ -754,7 +754,7 @@ ErrorOr<Entry *> VFSFromYAML::lookupPath
if (Result || Result.getError() != errc::no_such_file_or_directory)
return Result;
}
- return error_code(errc::no_such_file_or_directory, system_category());
+ return make_error_code(errc::no_such_file_or_directory);
}
ErrorOr<Entry *> VFSFromYAML::lookupPath(sys::path::const_iterator Start,
@@ -767,7 +767,7 @@ ErrorOr<Entry *> VFSFromYAML::lookupPath
if (CaseSensitive ? !Start->equals(From->getName())
: !Start->equals_lower(From->getName()))
// failure to match
- return error_code(errc::no_such_file_or_directory, system_category());
+ return make_error_code(errc::no_such_file_or_directory);
++Start;
@@ -778,7 +778,7 @@ ErrorOr<Entry *> VFSFromYAML::lookupPath
DirectoryEntry *DE = dyn_cast<DirectoryEntry>(From);
if (!DE)
- return error_code(errc::not_a_directory, system_category());
+ return make_error_code(errc::not_a_directory);
for (DirectoryEntry::iterator I = DE->contents_begin(),
E = DE->contents_end();
@@ -787,7 +787,7 @@ ErrorOr<Entry *> VFSFromYAML::lookupPath
if (Result || Result.getError() != errc::no_such_file_or_directory)
return Result;
}
- return error_code(errc::no_such_file_or_directory, system_category());
+ return make_error_code(errc::no_such_file_or_directory);
}
ErrorOr<Status> VFSFromYAML::status(const Twine &Path) {
@@ -820,7 +820,7 @@ error_code VFSFromYAML::openFileForRead(
FileEntry *F = dyn_cast<FileEntry>(*E);
if (!F) // FIXME: errc::not_a_file?
- return error_code(errc::invalid_argument, system_category());
+ return make_error_code(errc::invalid_argument);
if (error_code EC = ExternalFS->openFileForRead(F->getExternalContentsPath(),
Result))
Modified: cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp?rev=209956&r1=209955&r2=209956&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp (original)
+++ cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp Fri May 30 21:23:01 2014
@@ -35,7 +35,7 @@ public:
std::map<std::string, vfs::Status>::iterator I =
FilesAndDirs.find(Path.str());
if (I == FilesAndDirs.end())
- return error_code(errc::no_such_file_or_directory, posix_category());
+ return make_error_code(errc::no_such_file_or_directory);
return I->second;
}
error_code openFileForRead(const Twine &Path,
More information about the cfe-commits
mailing list