summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-31 01:26:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-31 01:26:30 +0000
commitcb82dfb11c95e671dbacd66a066114e7e88678ac (patch)
tree346de5579d44cff0f9af1e58b1d2a642576263ae /clang/lib
parent63ed1a35193abc706bd808931572b98e11502f25 (diff)
downloadbcm5719-llvm-cb82dfb11c95e671dbacd66a066114e7e88678ac.tar.gz
bcm5719-llvm-cb82dfb11c95e671dbacd66a066114e7e88678ac.zip
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. llvm-svn: 209949
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/VirtualFileSystem.cpp6
-rw-r--r--clang/lib/Format/Format.cpp2
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp
index a469c9abc39..1892839e2b1 100644
--- a/clang/lib/Basic/VirtualFileSystem.cpp
+++ b/clang/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<FileSystem> 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<FileSystem>
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 7d0e102d630..ba87b87dd0d 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/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/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 5c56ee399c1..a783ca19d6e 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/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<char> &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);
OpenPOWER on IntegriCloud