r210780 - Replace llvm::error_code with std::error_code.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jun 12 07:02:16 PDT 2014
Author: rafael
Date: Thu Jun 12 09:02:15 2014
New Revision: 210780
URL: http://llvm.org/viewvc/llvm-project?rev=210780&view=rev
Log:
Replace llvm::error_code with std::error_code.
Modified:
cfe/trunk/include/clang/Basic/VirtualFileSystem.h
cfe/trunk/include/clang/Format/Format.h
cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
cfe/trunk/lib/Basic/FileManager.cpp
cfe/trunk/lib/Basic/FileSystemStatCache.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Driver/Compilation.cpp
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/FrontendAction.cpp
cfe/trunk/lib/Frontend/FrontendActions.cpp
cfe/trunk/lib/Lex/HeaderSearch.cpp
cfe/trunk/lib/Lex/ModuleMap.cpp
cfe/trunk/lib/Lex/PPLexerChange.cpp
cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
cfe/trunk/lib/Serialization/ModuleManager.cpp
cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
cfe/trunk/lib/Tooling/Refactoring.cpp
cfe/trunk/lib/Tooling/Tooling.cpp
cfe/trunk/tools/driver/driver.cpp
cfe/trunk/unittests/Tooling/RefactoringTest.cpp
cfe/trunk/unittests/Tooling/RewriterTestContext.h
Modified: cfe/trunk/include/clang/Basic/VirtualFileSystem.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VirtualFileSystem.h?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/VirtualFileSystem.h (original)
+++ cfe/trunk/include/clang/Basic/VirtualFileSystem.h Thu Jun 12 09:02:15 2014
@@ -89,12 +89,13 @@ public:
/// \brief Get the status of the file.
virtual llvm::ErrorOr<Status> status() = 0;
/// \brief Get the contents of the file as a \p MemoryBuffer.
- virtual llvm::error_code
- getBuffer(const Twine &Name, std::unique_ptr<llvm::MemoryBuffer> &Result,
- int64_t FileSize = -1, bool RequiresNullTerminator = true,
- bool IsVolatile = false) = 0;
+ virtual std::error_code getBuffer(const Twine &Name,
+ std::unique_ptr<llvm::MemoryBuffer> &Result,
+ int64_t FileSize = -1,
+ bool RequiresNullTerminator = true,
+ bool IsVolatile = false) = 0;
/// \brief Closes the file.
- virtual llvm::error_code close() = 0;
+ virtual std::error_code close() = 0;
/// \brief Sets the name to use for this file.
virtual void setName(StringRef Name) = 0;
};
@@ -107,16 +108,16 @@ public:
/// \brief Get the status of the entry at \p Path, if one exists.
virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0;
/// \brief Get a \p File object for the file at \p Path, if one exists.
- virtual llvm::error_code openFileForRead(const Twine &Path,
- std::unique_ptr<File> &Result) = 0;
+ virtual std::error_code openFileForRead(const Twine &Path,
+ std::unique_ptr<File> &Result) = 0;
/// This is a convenience method that opens a file, gets its content and then
/// closes the file.
- llvm::error_code getBufferForFile(const Twine &Name,
- std::unique_ptr<llvm::MemoryBuffer> &Result,
- int64_t FileSize = -1,
- bool RequiresNullTerminator = true,
- bool IsVolatile = false);
+ std::error_code getBufferForFile(const Twine &Name,
+ std::unique_ptr<llvm::MemoryBuffer> &Result,
+ int64_t FileSize = -1,
+ bool RequiresNullTerminator = true,
+ bool IsVolatile = false);
};
/// \brief Gets an \p vfs::FileSystem for the 'real' file system, as seen by
@@ -154,8 +155,8 @@ public:
void pushOverlay(IntrusiveRefCntPtr<FileSystem> FS);
llvm::ErrorOr<Status> status(const Twine &Path) override;
- llvm::error_code openFileForRead(const Twine &Path,
- std::unique_ptr<File> &Result) override;
+ std::error_code openFileForRead(const Twine &Path,
+ std::unique_ptr<File> &Result) override;
};
/// \brief Get a globally unique ID for a virtual file or directory.
Modified: cfe/trunk/include/clang/Format/Format.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/include/clang/Format/Format.h (original)
+++ cfe/trunk/include/clang/Format/Format.h Thu Jun 12 09:02:15 2014
@@ -453,7 +453,7 @@ bool getPredefinedStyle(StringRef Name,
///
/// When \c BasedOnStyle is not present, options not present in the YAML
/// document, are retained in \p Style.
-llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style);
+std::error_code parseConfiguration(StringRef Text, FormatStyle *Style);
/// \brief Gets configuration in a YAML string.
std::string configurationAsText(const FormatStyle &Style);
Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Thu Jun 12 09:02:15 2014
@@ -1853,8 +1853,8 @@ static std::vector<std::string> getWhite
std::vector<std::string> Filenames;
if (DirPath.empty() || !is_directory(DirPath))
return Filenames;
-
- llvm::error_code EC;
+
+ std::error_code EC;
directory_iterator DI = directory_iterator(DirPath, EC);
directory_iterator DE;
for (; !EC && DI != DE; DI = DI.increment(EC)) {
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Thu Jun 12 09:02:15 2014
@@ -390,7 +390,7 @@ llvm::MemoryBuffer *FileManager::
getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
bool isVolatile) {
std::unique_ptr<llvm::MemoryBuffer> Result;
- llvm::error_code ec;
+ std::error_code ec;
uint64_t FileSize = Entry->getSize();
// If there's a high enough chance that the file have changed since we
@@ -431,7 +431,7 @@ getBufferForFile(const FileEntry *Entry,
llvm::MemoryBuffer *FileManager::
getBufferForFile(StringRef Filename, std::string *ErrorStr) {
std::unique_ptr<llvm::MemoryBuffer> Result;
- llvm::error_code ec;
+ std::error_code ec;
if (FileSystemOpts.WorkingDir.empty()) {
ec = FS->getBufferForFile(Filename, Result);
if (ec && ErrorStr)
Modified: cfe/trunk/lib/Basic/FileSystemStatCache.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileSystemStatCache.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileSystemStatCache.cpp (original)
+++ cfe/trunk/lib/Basic/FileSystemStatCache.cpp Thu Jun 12 09:02:15 2014
@@ -79,7 +79,7 @@ bool FileSystemStatCache::get(const char
// Because of this, check to see if the file exists with 'open'. If the
// open succeeds, use fstat to get the stat info.
std::unique_ptr<vfs::File> OwnedFile;
- llvm::error_code EC = FS.openFileForRead(Path, OwnedFile);
+ std::error_code EC = FS.openFileForRead(Path, OwnedFile);
if (EC) {
// If the open fails, our "stat" fails.
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Jun 12 09:02:15 2014
@@ -141,7 +141,7 @@ CodeGenModule::CodeGenModule(ASTContext
RRData = new RREntrypoints();
if (!CodeGenOpts.InstrProfileInput.empty()) {
- if (llvm::error_code EC = llvm::IndexedInstrProfReader::create(
+ if (std::error_code EC = llvm::IndexedInstrProfReader::create(
CodeGenOpts.InstrProfileInput, PGOReader)) {
unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
"Could not read profile: %0");
Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Thu Jun 12 09:02:15 2014
@@ -86,7 +86,7 @@ bool Compilation::CleanupFile(const char
if (!llvm::sys::fs::can_write(File) || !llvm::sys::fs::is_regular_file(File))
return true;
- if (llvm::error_code EC = llvm::sys::fs::remove(File)) {
+ if (std::error_code EC = llvm::sys::fs::remove(File)) {
// Failure is only failure if the file exists and is "regular". We checked
// for it being regular before, and llvm::sys::fs::remove ignores ENOENT,
// so we don't need to check again.
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Jun 12 09:02:15 2014
@@ -1823,8 +1823,7 @@ std::string Driver::GetProgramPath(const
std::string Driver::GetTemporaryPath(StringRef Prefix, const char *Suffix)
const {
SmallString<128> Path;
- llvm::error_code EC =
- llvm::sys::fs::createTemporaryFile(Prefix, Suffix, Path);
+ std::error_code EC = llvm::sys::fs::createTemporaryFile(Prefix, Suffix, Path);
if (EC) {
Diag(clang::diag::err_unable_to_make_temp) << EC.message();
return "";
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Jun 12 09:02:15 2014
@@ -2018,7 +2018,7 @@ void Generic_GCC::GCCInstallationDetecto
(llvm::array_lengthof(LibSuffixes) - (TargetArch != llvm::Triple::x86));
for (unsigned i = 0; i < NumLibSuffixes; ++i) {
StringRef LibSuffix = LibSuffixes[i];
- llvm::error_code EC;
+ std::error_code EC;
for (llvm::sys::fs::directory_iterator LI(LibDir + LibSuffix, EC), LE;
!EC && LI != LE; LI = LI.increment(EC)) {
StringRef VersionText = llvm::sys::path::filename(LI->path());
@@ -2228,7 +2228,7 @@ Hexagon_TC::Hexagon_TC(const Driver &D,
// Determine version of GCC libraries and headers to use.
const std::string HexagonDir(GnuDir + "/lib/gcc/hexagon");
- llvm::error_code ec;
+ std::error_code ec;
GCCVersion MaxVersion= GCCVersion::Parse("0.0.0");
for (llvm::sys::fs::directory_iterator di(HexagonDir, ec), de;
!ec && di != de; di = di.increment(ec)) {
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Thu Jun 12 09:02:15 2014
@@ -465,7 +465,7 @@ bool getPredefinedStyle(StringRef Name,
return true;
}
-llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style) {
+std::error_code parseConfiguration(StringRef Text, FormatStyle *Style) {
assert(Style);
FormatStyle::LanguageKind Language = Style->Language;
assert(Language != FormatStyle::LK_None);
@@ -2025,7 +2025,7 @@ FormatStyle getStyle(StringRef StyleName
if (StyleName.startswith("{")) {
// Parse YAML/JSON style from the command line.
- if (llvm::error_code ec = parseConfiguration(StyleName, &Style)) {
+ if (std::error_code ec = parseConfiguration(StyleName, &Style)) {
llvm::errs() << "Error parsing -style: " << ec.message() << ", using "
<< FallbackStyle << " style\n";
}
@@ -2066,12 +2066,12 @@ FormatStyle getStyle(StringRef StyleName
if (IsFile) {
std::unique_ptr<llvm::MemoryBuffer> Text;
- if (llvm::error_code ec =
+ if (std::error_code ec =
llvm::MemoryBuffer::getFile(ConfigFile.c_str(), Text)) {
llvm::errs() << ec.message() << "\n";
break;
}
- if (llvm::error_code ec = parseConfiguration(Text->getBuffer(), &Style)) {
+ if (std::error_code ec = parseConfiguration(Text->getBuffer(), &Style)) {
if (ec == ParseError::Unsuitable) {
if (!UnsuitableConfigFiles.empty())
UnsuitableConfigFiles.append(", ");
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu Jun 12 09:02:15 2014
@@ -454,8 +454,8 @@ void CompilerInstance::clearOutputFiles(
// If '-working-directory' was passed, the output filename should be
// relative to that.
FileMgr->FixupRelativePath(NewOutFile);
- if (llvm::error_code ec = llvm::sys::fs::rename(it->TempFilename,
- NewOutFile.str())) {
+ if (std::error_code ec =
+ llvm::sys::fs::rename(it->TempFilename, NewOutFile.str())) {
getDiagnostics().Report(diag::err_unable_to_rename_temp)
<< it->TempFilename << it->Filename << ec.message();
@@ -568,7 +568,7 @@ CompilerInstance::createOutputFile(Strin
TempPath = OutFile;
TempPath += "-%%%%%%%%";
int fd;
- llvm::error_code EC =
+ std::error_code EC =
llvm::sys::fs::createUniqueFile(TempPath.str(), fd, TempPath);
if (CreateMissingDirectories &&
@@ -665,7 +665,7 @@ bool CompilerInstance::InitializeSourceM
SourceMgr.createFileID(File, SourceLocation(), Kind));
} else {
std::unique_ptr<llvm::MemoryBuffer> SB;
- if (llvm::error_code ec = llvm::MemoryBuffer::getSTDIN(SB)) {
+ if (std::error_code ec = llvm::MemoryBuffer::getSTDIN(SB)) {
Diags.Report(diag::err_fe_error_reading_stdin) << ec.message();
return false;
}
@@ -1051,7 +1051,7 @@ static void pruneModuleCache(const Heade
// Walk the entire module cache, looking for unused module files and module
// indices.
- llvm::error_code EC;
+ std::error_code EC;
SmallString<128> ModuleCachePathNative;
llvm::sys::path::native(HSOpts.ModuleCachePath, ModuleCachePathNative);
for (llvm::sys::fs::directory_iterator
Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Thu Jun 12 09:02:15 2014
@@ -260,7 +260,7 @@ bool FrontendAction::BeginSourceFile(Com
PreprocessorOptions &PPOpts = CI.getPreprocessorOpts();
StringRef PCHInclude = PPOpts.ImplicitPCHInclude;
if (const DirectoryEntry *PCHDir = FileMgr.getDirectory(PCHInclude)) {
- llvm::error_code EC;
+ std::error_code EC;
SmallString<128> DirNative;
llvm::sys::path::native(PCHDir->getName(), DirNative);
bool Found = false;
Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Thu Jun 12 09:02:15 2014
@@ -129,10 +129,10 @@ operator+=(SmallVectorImpl<char> &Includ
return Includes;
}
-static llvm::error_code addHeaderInclude(StringRef HeaderName,
- SmallVectorImpl<char> &Includes,
- const LangOptions &LangOpts,
- bool IsExternC) {
+static std::error_code addHeaderInclude(StringRef HeaderName,
+ SmallVectorImpl<char> &Includes,
+ const LangOptions &LangOpts,
+ bool IsExternC) {
if (IsExternC && LangOpts.CPlusPlus)
Includes += "extern \"C\" {\n";
if (LangOpts.ObjC1)
@@ -146,20 +146,20 @@ static llvm::error_code addHeaderInclude
Includes += HeaderName;
} else {
SmallString<256> Header = HeaderName;
- if (llvm::error_code Err = llvm::sys::fs::make_absolute(Header))
+ if (std::error_code Err = llvm::sys::fs::make_absolute(Header))
return Err;
Includes += Header;
}
Includes += "\"\n";
if (IsExternC && LangOpts.CPlusPlus)
Includes += "}\n";
- return llvm::error_code();
+ return std::error_code();
}
-static llvm::error_code addHeaderInclude(const FileEntry *Header,
- SmallVectorImpl<char> &Includes,
- const LangOptions &LangOpts,
- bool IsExternC) {
+static std::error_code addHeaderInclude(const FileEntry *Header,
+ SmallVectorImpl<char> &Includes,
+ const LangOptions &LangOpts,
+ bool IsExternC) {
return addHeaderInclude(Header->getName(), Includes, LangOpts, IsExternC);
}
@@ -170,19 +170,19 @@ static llvm::error_code addHeaderInclude
///
/// \param Includes Will be augmented with the set of \#includes or \#imports
/// needed to load all of the named headers.
-static llvm::error_code
+static std::error_code
collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr,
ModuleMap &ModMap, clang::Module *Module,
SmallVectorImpl<char> &Includes) {
// Don't collect any headers for unavailable modules.
if (!Module->isAvailable())
- return llvm::error_code();
+ return std::error_code();
// Add includes for each of these headers.
for (unsigned I = 0, N = Module->NormalHeaders.size(); I != N; ++I) {
const FileEntry *Header = Module->NormalHeaders[I];
Module->addTopHeader(Header);
- if (llvm::error_code Err =
+ if (std::error_code Err =
addHeaderInclude(Header, Includes, LangOpts, Module->IsExternC))
return Err;
}
@@ -192,13 +192,13 @@ collectModuleHeaderIncludes(const LangOp
Module->addTopHeader(UmbrellaHeader);
if (Module->Parent) {
// Include the umbrella header for submodules.
- if (llvm::error_code Err = addHeaderInclude(UmbrellaHeader, Includes,
- LangOpts, Module->IsExternC))
+ if (std::error_code Err = addHeaderInclude(UmbrellaHeader, Includes,
+ LangOpts, Module->IsExternC))
return Err;
}
} else if (const DirectoryEntry *UmbrellaDir = Module->getUmbrellaDir()) {
// Add all of the headers we find in this subdirectory.
- llvm::error_code EC;
+ std::error_code EC;
SmallString<128> DirNative;
llvm::sys::path::native(UmbrellaDir->getName(), DirNative);
for (llvm::sys::fs::recursive_directory_iterator Dir(DirNative.str(), EC),
@@ -220,8 +220,8 @@ collectModuleHeaderIncludes(const LangOp
}
// Include this header as part of the umbrella directory.
- if (llvm::error_code Err = addHeaderInclude(Dir->path(), Includes,
- LangOpts, Module->IsExternC))
+ if (std::error_code Err = addHeaderInclude(Dir->path(), Includes,
+ LangOpts, Module->IsExternC))
return Err;
}
@@ -233,11 +233,11 @@ collectModuleHeaderIncludes(const LangOp
for (clang::Module::submodule_iterator Sub = Module->submodule_begin(),
SubEnd = Module->submodule_end();
Sub != SubEnd; ++Sub)
- if (llvm::error_code Err = collectModuleHeaderIncludes(
+ if (std::error_code Err = collectModuleHeaderIncludes(
LangOpts, FileMgr, ModMap, *Sub, Includes))
return Err;
- return llvm::error_code();
+ return std::error_code();
}
bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI,
@@ -310,7 +310,7 @@ bool GenerateModuleAction::BeginSourceFi
// Collect the set of #includes we need to build the module.
SmallString<256> HeaderContents;
- llvm::error_code Err = llvm::error_code();
+ std::error_code Err = llvm::error_code();
if (const FileEntry *UmbrellaHeader = Module->getUmbrellaHeader())
Err = addHeaderInclude(UmbrellaHeader, HeaderContents, CI.getLangOpts(),
Module->IsExternC);
Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Thu Jun 12 09:02:15 2014
@@ -1275,7 +1275,7 @@ void HeaderSearch::collectAllModules(Sma
for (unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
bool IsSystem = SearchDirs[Idx].isSystemHeaderDirectory();
if (SearchDirs[Idx].isFramework()) {
- llvm::error_code EC;
+ std::error_code EC;
SmallString<128> DirNative;
llvm::sys::path::native(SearchDirs[Idx].getFrameworkDir()->getName(),
DirNative);
@@ -1335,8 +1335,8 @@ void HeaderSearch::loadTopLevelSystemMod
void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
if (SearchDir.haveSearchedAllModuleMaps())
return;
-
- llvm::error_code EC;
+
+ std::error_code EC;
SmallString<128> DirNative;
llvm::sys::path::native(SearchDir.getDir()->getName(), DirNative);
for (llvm::sys::fs::directory_iterator Dir(DirNative.str(), EC), DirEnd;
Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Thu Jun 12 09:02:15 2014
@@ -706,7 +706,7 @@ ModuleMap::inferFrameworkModule(StringRe
Result->InferExportWildcard = true;
// Look for subframeworks.
- llvm::error_code EC;
+ std::error_code EC;
SmallString<128> SubframeworksDirName
= StringRef(FrameworkDir->getName());
llvm::sys::path::append(SubframeworksDirName, "Frameworks");
Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Thu Jun 12 09:02:15 2014
@@ -456,7 +456,7 @@ bool Preprocessor::HandleEndOfFile(Token
typedef llvm::sys::fs::recursive_directory_iterator
recursive_directory_iterator;
const DirectoryEntry *Dir = Mod->getUmbrellaDir();
- llvm::error_code EC;
+ std::error_code EC;
for (recursive_directory_iterator Entry(Dir->getName(), EC), End;
Entry != End && !EC; Entry.increment(EC)) {
using llvm::StringSwitch;
Modified: cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Core/Rewriter.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Core/Rewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Core/Rewriter.cpp Thu Jun 12 09:02:15 2014
@@ -457,8 +457,8 @@ public:
// Win32 does not allow rename/removing opened files.
FileStream.reset();
#endif
- if (llvm::error_code ec =
- llvm::sys::fs::rename(TempFilename.str(), Filename)) {
+ if (std::error_code ec =
+ llvm::sys::fs::rename(TempFilename.str(), Filename)) {
AllWritten = false;
Diagnostics.Report(clang::diag::err_unable_to_rename_temp)
<< TempFilename << Filename << ec.message();
Modified: cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp (original)
+++ cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp Thu Jun 12 09:02:15 2014
@@ -787,7 +787,7 @@ GlobalModuleIndex::writeIndex(FileManage
GlobalModuleIndexBuilder Builder(FileMgr);
// Load each of the module files.
- llvm::error_code EC;
+ std::error_code EC;
for (llvm::sys::fs::directory_iterator D(Path, EC), DEnd;
D != DEnd && !EC;
D.increment(EC)) {
Modified: cfe/trunk/lib/Serialization/ModuleManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ModuleManager.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ModuleManager.cpp (original)
+++ cfe/trunk/lib/Serialization/ModuleManager.cpp Thu Jun 12 09:02:15 2014
@@ -104,7 +104,7 @@ ModuleManager::addModule(StringRef FileN
New->Buffer.reset(Buffer);
} else {
// Open the AST file.
- llvm::error_code ec;
+ std::error_code ec;
if (FileName == "-") {
ec = llvm::MemoryBuffer::getSTDIN(New->Buffer);
if (ec)
Modified: cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp Thu Jun 12 09:02:15 2014
@@ -99,7 +99,7 @@ void HTMLDiagnostics::ReportDiag(const P
// Create the HTML directory if it is missing.
if (!createdDir) {
createdDir = true;
- if (llvm::error_code ec = llvm::sys::fs::create_directories(Directory)) {
+ if (std::error_code ec = llvm::sys::fs::create_directories(Directory)) {
llvm::errs() << "warning: could not create directory '"
<< Directory << "': " << ec.message() << '\n';
@@ -249,7 +249,7 @@ void HTMLDiagnostics::ReportDiag(const P
SmallString<128> Model, ResultPath;
llvm::sys::path::append(Model, Directory, "report-%%%%%%.html");
- if (llvm::error_code EC =
+ if (std::error_code EC =
llvm::sys::fs::createUniqueFile(Model.str(), FD, ResultPath)) {
llvm::errs() << "warning: could not create file in '" << Directory
<< "': " << EC.message() << '\n';
Modified: cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp Thu Jun 12 09:02:15 2014
@@ -145,8 +145,8 @@ JSONCompilationDatabase *
JSONCompilationDatabase::loadFromFile(StringRef FilePath,
std::string &ErrorMessage) {
std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer;
- llvm::error_code Result =
- llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer);
+ std::error_code Result =
+ llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer);
if (Result) {
ErrorMessage = "Error while opening JSON database: " + Result.message();
return nullptr;
Modified: cfe/trunk/lib/Tooling/Refactoring.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Refactoring.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Refactoring.cpp (original)
+++ cfe/trunk/lib/Tooling/Refactoring.cpp Thu Jun 12 09:02:15 2014
@@ -110,7 +110,7 @@ void Replacement::setFromSourceLocation(
// Make FilePath absolute so replacements can be applied correctly when
// relative paths for files are used.
llvm::SmallString<256> FilePath(Entry->getName());
- llvm::error_code EC = llvm::sys::fs::make_absolute(FilePath);
+ std::error_code EC = llvm::sys::fs::make_absolute(FilePath);
this->FilePath = EC ? FilePath.c_str() : Entry->getName();
} else {
this->FilePath = InvalidLocation;
Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Thu Jun 12 09:02:15 2014
@@ -145,7 +145,7 @@ std::string getAbsolutePath(StringRef Fi
}
SmallString<1024> AbsolutePath = RelativePath;
- llvm::error_code EC = llvm::sys::fs::make_absolute(AbsolutePath);
+ std::error_code EC = llvm::sys::fs::make_absolute(AbsolutePath);
assert(!EC);
(void)EC;
llvm::sys::path::native(AbsolutePath);
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Thu Jun 12 09:02:15 2014
@@ -299,7 +299,7 @@ int main(int argc_, const char **argv_)
SmallVector<const char *, 256> argv;
llvm::SpecificBumpPtrAllocator<char> ArgAllocator;
- llvm::error_code EC = llvm::sys::Process::GetArgumentVector(
+ std::error_code EC = llvm::sys::Process::GetArgumentVector(
argv, llvm::ArrayRef<const char *>(argv_, argc_), ArgAllocator);
if (EC) {
llvm::errs() << "error: couldn't get arguments: " << EC.message() << '\n';
Modified: cfe/trunk/unittests/Tooling/RefactoringTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RefactoringTest.cpp?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/RefactoringTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/RefactoringTest.cpp Thu Jun 12 09:02:15 2014
@@ -218,7 +218,7 @@ public:
E = TemporaryFiles.end();
I != E; ++I) {
llvm::StringRef Name = I->second;
- llvm::error_code EC = llvm::sys::fs::remove(Name);
+ std::error_code EC = llvm::sys::fs::remove(Name);
(void)EC;
assert(!EC);
}
@@ -227,8 +227,7 @@ public:
FileID createFile(llvm::StringRef Name, llvm::StringRef Content) {
SmallString<1024> Path;
int FD;
- llvm::error_code EC =
- llvm::sys::fs::createTemporaryFile(Name, "", FD, Path);
+ std::error_code EC = llvm::sys::fs::createTemporaryFile(Name, "", FD, Path);
assert(!EC);
(void)EC;
Modified: cfe/trunk/unittests/Tooling/RewriterTestContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RewriterTestContext.h?rev=210780&r1=210779&r2=210780&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/RewriterTestContext.h (original)
+++ cfe/trunk/unittests/Tooling/RewriterTestContext.h Thu Jun 12 09:02:15 2014
@@ -62,8 +62,7 @@ class RewriterTestContext {
FileID createOnDiskFile(StringRef Name, StringRef Content) {
SmallString<1024> Path;
int FD;
- llvm::error_code EC =
- llvm::sys::fs::createTemporaryFile(Name, "", FD, Path);
+ std::error_code EC = llvm::sys::fs::createTemporaryFile(Name, "", FD, Path);
assert(!EC);
(void)EC;
More information about the cfe-commits
mailing list