summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/VirtualFileSystem.h29
-rw-r--r--include/clang/Format/Format.h2
-rw-r--r--lib/ARCMigrate/ObjCMT.cpp4
-rw-r--r--lib/Basic/FileManager.cpp4
-rw-r--r--lib/Basic/FileSystemStatCache.cpp2
-rw-r--r--lib/CodeGen/CodeGenModule.cpp2
-rw-r--r--lib/Driver/Compilation.cpp2
-rw-r--r--lib/Driver/Driver.cpp3
-rw-r--r--lib/Driver/ToolChains.cpp4
-rw-r--r--lib/Format/Format.cpp8
-rw-r--r--lib/Frontend/CompilerInstance.cpp10
-rw-r--r--lib/Frontend/FrontendAction.cpp2
-rw-r--r--lib/Frontend/FrontendActions.cpp42
-rw-r--r--lib/Lex/HeaderSearch.cpp6
-rw-r--r--lib/Lex/ModuleMap.cpp2
-rw-r--r--lib/Lex/PPLexerChange.cpp2
-rw-r--r--lib/Rewrite/Core/Rewriter.cpp4
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp2
-rw-r--r--lib/Serialization/ModuleManager.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp4
-rw-r--r--lib/Tooling/JSONCompilationDatabase.cpp4
-rw-r--r--lib/Tooling/Refactoring.cpp2
-rw-r--r--lib/Tooling/Tooling.cpp2
-rw-r--r--tools/driver/driver.cpp2
-rw-r--r--unittests/Tooling/RefactoringTest.cpp5
-rw-r--r--unittests/Tooling/RewriterTestContext.h3
26 files changed, 76 insertions, 78 deletions
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h
index 0a9949612c..83e0fb52e5 100644
--- a/include/clang/Basic/VirtualFileSystem.h
+++ b/include/clang/Basic/VirtualFileSystem.h
@@ -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.
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h
index 0c08a4c2f6..23be07e71d 100644
--- a/include/clang/Format/Format.h
+++ b/include/clang/Format/Format.h
@@ -453,7 +453,7 @@ bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language,
///
/// 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);
diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp
index a52c32f08f..b31672960c 100644
--- a/lib/ARCMigrate/ObjCMT.cpp
+++ b/lib/ARCMigrate/ObjCMT.cpp
@@ -1853,8 +1853,8 @@ static std::vector<std::string> getWhiteListFilenames(StringRef DirPath) {
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)) {
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp
index 14731f6b09..9446d89266 100644
--- a/lib/Basic/FileManager.cpp
+++ b/lib/Basic/FileManager.cpp
@@ -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, std::string *ErrorStr,
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)
diff --git a/lib/Basic/FileSystemStatCache.cpp b/lib/Basic/FileSystemStatCache.cpp
index 0f16e94a05..61f745d8bb 100644
--- a/lib/Basic/FileSystemStatCache.cpp
+++ b/lib/Basic/FileSystemStatCache.cpp
@@ -79,7 +79,7 @@ bool FileSystemStatCache::get(const char *Path, FileData &Data, bool isFile,
// 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.
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 7933878796..3c709f21c4 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -141,7 +141,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
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");
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp
index 8ec643c4a4..4baa195d3b 100644
--- a/lib/Driver/Compilation.cpp
+++ b/lib/Driver/Compilation.cpp
@@ -86,7 +86,7 @@ bool Compilation::CleanupFile(const char *File, bool IssueErrors) const {
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.
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 1d7f180554..67e0122435 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1823,8 +1823,7 @@ std::string Driver::GetProgramPath(const char *Name,
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 "";
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index dcbdd7175a..e18f71d298 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2018,7 +2018,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
(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, const llvm::Triple &Triple,
// 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)) {
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 6b57b184d2..176cb49df8 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -465,7 +465,7 @@ bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language,
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, StringRef FileName,
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, StringRef FileName,
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(", ");
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index bbcb71f3f1..1605012e8c 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -454,8 +454,8 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) {
// 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(StringRef OutputPath,
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::InitializeSourceManager(const FrontendInputFile &Input,
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 HeaderSearchOptions &HSOpts) {
// 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
diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp
index b085749074..ed8b66b218 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/lib/Frontend/FrontendAction.cpp
@@ -260,7 +260,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
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;
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index a783ca19d6..4cc73c4222 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -129,10 +129,10 @@ operator+=(SmallVectorImpl<char> &Includes, StringRef RHS) {
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(StringRef HeaderName,
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(const FileEntry *Header,
///
/// \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 LangOptions &LangOpts, FileManager &FileMgr,
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 LangOptions &LangOpts, FileManager &FileMgr,
}
// 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 LangOptions &LangOpts, FileManager &FileMgr,
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::BeginSourceFileAction(CompilerInstance &CI,
// 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);
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index a1dbe49434..a283f69d88 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -1275,7 +1275,7 @@ void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
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::loadTopLevelSystemModules() {
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;
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index 0538d33670..1416a26bd5 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -706,7 +706,7 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName,
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");
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index e79fbe192d..40d15d4bfa 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/lib/Lex/PPLexerChange.cpp
@@ -456,7 +456,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
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;
diff --git a/lib/Rewrite/Core/Rewriter.cpp b/lib/Rewrite/Core/Rewriter.cpp
index eb123ad702..eab4ccfead 100644
--- a/lib/Rewrite/Core/Rewriter.cpp
+++ b/lib/Rewrite/Core/Rewriter.cpp
@@ -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();
diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp
index 851695173f..a1bec89efb 100644
--- a/lib/Serialization/GlobalModuleIndex.cpp
+++ b/lib/Serialization/GlobalModuleIndex.cpp
@@ -787,7 +787,7 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, StringRef Path) {
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)) {
diff --git a/lib/Serialization/ModuleManager.cpp b/lib/Serialization/ModuleManager.cpp
index ca910befcd..419d049630 100644
--- a/lib/Serialization/ModuleManager.cpp
+++ b/lib/Serialization/ModuleManager.cpp
@@ -104,7 +104,7 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
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)
diff --git a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
index e8ec00535f..a7e42291f9 100644
--- a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -99,7 +99,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,
// 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 PathDiagnostic& D,
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';
diff --git a/lib/Tooling/JSONCompilationDatabase.cpp b/lib/Tooling/JSONCompilationDatabase.cpp
index 256b49c889..d99d7879ea 100644
--- a/lib/Tooling/JSONCompilationDatabase.cpp
+++ b/lib/Tooling/JSONCompilationDatabase.cpp
@@ -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;
diff --git a/lib/Tooling/Refactoring.cpp b/lib/Tooling/Refactoring.cpp
index 4b4056b8c0..c96b8c92a9 100644
--- a/lib/Tooling/Refactoring.cpp
+++ b/lib/Tooling/Refactoring.cpp
@@ -110,7 +110,7 @@ void Replacement::setFromSourceLocation(const SourceManager &Sources,
// 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;
diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp
index f8247418a9..5d3de8aa56 100644
--- a/lib/Tooling/Tooling.cpp
+++ b/lib/Tooling/Tooling.cpp
@@ -145,7 +145,7 @@ std::string getAbsolutePath(StringRef File) {
}
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);
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index d2e3b64a92..3285502522 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -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';
diff --git a/unittests/Tooling/RefactoringTest.cpp b/unittests/Tooling/RefactoringTest.cpp
index d600880efb..ddb974ac9f 100644
--- a/unittests/Tooling/RefactoringTest.cpp
+++ b/unittests/Tooling/RefactoringTest.cpp
@@ -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;
diff --git a/unittests/Tooling/RewriterTestContext.h b/unittests/Tooling/RewriterTestContext.h
index 6353cec596..ed29f8c04d 100644
--- a/unittests/Tooling/RewriterTestContext.h
+++ b/unittests/Tooling/RewriterTestContext.h
@@ -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;