diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
commit | df0b8bce48aa981e5f33a754f66c95f8c46f7709 (patch) | |
tree | 6aa87f18590b764a2abe5dc932e09ff76a3f5e38 /lib/LTO/LTO.cpp | |
parent | 90ab4b2ee258f6437f0bea77db22fcb86d5c66d9 (diff) |
Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.
Differential Revision: https://reviews.llvm.org/D26481
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r-- | lib/LTO/LTO.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp index b599830d092..12de8445568 100644 --- a/lib/LTO/LTO.cpp +++ b/lib/LTO/LTO.cpp @@ -437,7 +437,7 @@ Error LTO::addThinLTO(std::unique_ptr<InputFile> Input, assert(ResI == Res.end()); ThinLTO.ModuleMap[MBRef.getBufferIdentifier()] = MBRef; - return Error(); + return Error::success(); } unsigned LTO::getMaxTasks() const { @@ -489,7 +489,7 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) { if (Conf.PreOptModuleHook && !Conf.PreOptModuleHook(0, *RegularLTO.CombinedModule)) - return Error(); + return Error::success(); if (!Conf.CodeGenOnly) { for (const auto &R : GlobalResolutions) { @@ -512,7 +512,7 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) { if (Conf.PostInternalizeModuleHook && !Conf.PostInternalizeModuleHook(0, *RegularLTO.CombinedModule)) - return Error(); + return Error::success(); } return backend(Conf, AddStream, RegularLTO.ParallelCodeGenParallelismLevel, std::move(RegularLTO.CombinedModule)); @@ -593,7 +593,7 @@ public: if (AddStreamFn CacheAddStream = Cache(Task, Key)) return RunThinBackend(CacheAddStream); - return Error(); + return Error::success(); } Error start( @@ -628,7 +628,7 @@ public: MBRef, std::ref(CombinedIndex), std::ref(ImportList), std::ref(ExportList), std::ref(ResolvedODR), std::ref(DefinedGlobals), std::ref(ModuleMap)); - return Error(); + return Error::success(); } Error wait() override { @@ -636,7 +636,7 @@ public: if (Err) return std::move(*Err); else - return Error(); + return Error::success(); } }; @@ -722,10 +722,10 @@ public: if (ShouldEmitImportsFiles) return errorCodeToError( EmitImportsFiles(ModulePath, NewModulePath + ".imports", ImportList)); - return Error(); + return Error::success(); } - Error wait() override { return Error(); } + Error wait() override { return Error::success(); } }; ThinBackend lto::createWriteIndexesThinBackend(std::string OldPrefix, @@ -744,10 +744,10 @@ ThinBackend lto::createWriteIndexesThinBackend(std::string OldPrefix, Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache, bool HasRegularLTO) { if (ThinLTO.ModuleMap.empty()) - return Error(); + return Error::success(); if (Conf.CombinedIndexHook && !Conf.CombinedIndexHook(ThinLTO.CombinedIndex)) - return Error(); + return Error::success(); // Collect for each module the list of function it defines (GUID -> // Summary). |