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 | 41af43092ccc8030bb49cea324d85eecd5ae68a8 (patch) | |
tree | f30038673dd27f2d4785068fffd510abe4fb23d7 /llvm/lib/LTO/LTO.cpp | |
parent | e8e98dcb74cd6d297c31c023bfacdf7f28cdaabc (diff) | |
download | bcm5719-llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.tar.gz bcm5719-llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.zip |
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
llvm-svn: 286561
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index b599830d092..12de8445568 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/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). |