From: Rafael Espindola Date: Sat, 31 May 2014 01:26:30 +0000 (+0000) Subject: Use error_code() instead of error_code::succes() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbb96d49ad234382a87e259c160379615e55dc86;p=clang Use error_code() instead of error_code::succes() There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209949 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/VirtualFileSystem.cpp b/lib/Basic/VirtualFileSystem.cpp index a469c9abc3..1892839e2b 100644 --- a/lib/Basic/VirtualFileSystem.cpp +++ b/lib/Basic/VirtualFileSystem.cpp @@ -142,7 +142,7 @@ error_code RealFile::close() { if (::close(FD)) return error_code(errno, system_category()); FD = -1; - return error_code::success(); + return error_code(); } void RealFile::setName(StringRef Name) { @@ -175,7 +175,7 @@ error_code RealFileSystem::openFileForRead(const Twine &Name, return EC; Result.reset(new RealFile(FD)); Result->setName(Name.str()); - return error_code::success(); + return error_code(); } IntrusiveRefCntPtr vfs::getRealFileSystem() { @@ -829,7 +829,7 @@ error_code VFSFromYAML::openFileForRead(const Twine &Path, if (!F->useExternalName(UseExternalNames)) Result->setName(Path.str()); - return error_code::success(); + return error_code(); } IntrusiveRefCntPtr diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 7d0e102d63..ba87b87dd0 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -482,7 +482,7 @@ llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style) { Styles[i].Language == FormatStyle::LK_None) { *Style = Styles[i]; Style->Language = Language; - return llvm::error_code::success(); + return llvm::error_code(); } } return llvm::make_error_code(llvm::errc::not_supported); diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index 5c56ee399c..a783ca19d6 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -153,7 +153,7 @@ static llvm::error_code addHeaderInclude(StringRef HeaderName, Includes += "\"\n"; if (IsExternC && LangOpts.CPlusPlus) Includes += "}\n"; - return llvm::error_code::success(); + return llvm::error_code(); } static llvm::error_code addHeaderInclude(const FileEntry *Header, @@ -176,7 +176,7 @@ collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr, SmallVectorImpl &Includes) { // Don't collect any headers for unavailable modules. if (!Module->isAvailable()) - return llvm::error_code::success(); + return llvm::error_code(); // Add includes for each of these headers. for (unsigned I = 0, N = Module->NormalHeaders.size(); I != N; ++I) { @@ -237,7 +237,7 @@ collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr, LangOpts, FileMgr, ModMap, *Sub, Includes)) return Err; - return llvm::error_code::success(); + return llvm::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::success(); + llvm::error_code Err = llvm::error_code(); if (const FileEntry *UmbrellaHeader = Module->getUmbrellaHeader()) Err = addHeaderInclude(UmbrellaHeader, HeaderContents, CI.getLangOpts(), Module->IsExternC);