diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Basic/FileSystemStatCache.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Driver/Compilation.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Format/Format.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 42 | ||||
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Rewrite/Core/Rewriter.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Tooling/JSONCompilationDatabase.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Tooling/Refactoring.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Tooling/Tooling.cpp | 2 |
21 files changed, 56 insertions, 57 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index a52c32f08fa..b31672960ce 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/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/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 14731f6b09c..9446d892668 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/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/clang/lib/Basic/FileSystemStatCache.cpp b/clang/lib/Basic/FileSystemStatCache.cpp index 0f16e94a05e..61f745d8bba 100644 --- a/clang/lib/Basic/FileSystemStatCache.cpp +++ b/clang/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/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 79338787966..3c709f21c43 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 8ec643c4a4d..4baa195d3b8 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/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/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 1d7f1805543..67e01224356 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/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/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index dcbdd7175a6..e18f71d298b 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/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/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 6b57b184d2a..176cb49df8e 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/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/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index bbcb71f3f1f..1605012e8c4 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/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/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index b0857490743..ed8b66b2186 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/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/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index a783ca19d6e..4cc73c42228 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/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/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index a1dbe494345..a283f69d885 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/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/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 0538d33670c..1416a26bd5c 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/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/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index e79fbe192d6..40d15d4bfad 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/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/clang/lib/Rewrite/Core/Rewriter.cpp b/clang/lib/Rewrite/Core/Rewriter.cpp index eb123ad7024..eab4ccfeadc 100644 --- a/clang/lib/Rewrite/Core/Rewriter.cpp +++ b/clang/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/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 851695173f2..a1bec89efb9 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/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/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index ca910befcd2..419d0496303 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp index e8ec00535f9..a7e42291f93 100644 --- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ b/clang/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/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp index 256b49c8896..d99d7879ea6 100644 --- a/clang/lib/Tooling/JSONCompilationDatabase.cpp +++ b/clang/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/clang/lib/Tooling/Refactoring.cpp b/clang/lib/Tooling/Refactoring.cpp index 4b4056b8c0a..c96b8c92a90 100644 --- a/clang/lib/Tooling/Refactoring.cpp +++ b/clang/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/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index f8247418a9b..5d3de8aa56b 100644 --- a/clang/lib/Tooling/Tooling.cpp +++ b/clang/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); |