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 /lldb/source/Utility/ModuleCache.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 'lldb/source/Utility/ModuleCache.cpp')
-rw-r--r-- | lldb/source/Utility/ModuleCache.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Utility/ModuleCache.cpp b/lldb/source/Utility/ModuleCache.cpp index 889cd8f9466..c53be909164 100644 --- a/lldb/source/Utility/ModuleCache.cpp +++ b/lldb/source/Utility/ModuleCache.cpp @@ -70,7 +70,7 @@ Error MakeDirectory(const FileSpec &dir_path) { if (!dir_path.IsDirectory()) return Error("Invalid existing path"); - return Error(); + return Error::success(); } return FileSystem::MakeDirectory(dir_path, eFilePermissionsDirectoryDefault); @@ -141,7 +141,7 @@ Error CreateHostSysRootModuleLink(const FileSpec &root_dir_spec, platform_module_spec.GetPath().c_str()); if (sysroot_module_path_spec.Exists()) { if (!delete_existing) - return Error(); + return Error::success(); DecrementRefExistingModule(root_dir_spec, sysroot_module_path_spec); } @@ -210,7 +210,7 @@ Error ModuleCache::Put(const FileSpec &root_dir_spec, const char *hostname, if (error.Fail()) return Error("Failed to create link to %s: %s", module_file_path.GetPath().c_str(), error.AsCString()); - return Error(); + return Error::success(); } Error ModuleCache::Get(const FileSpec &root_dir_spec, const char *hostname, @@ -221,7 +221,7 @@ Error ModuleCache::Get(const FileSpec &root_dir_spec, const char *hostname, if (find_it != m_loaded_modules.end()) { cached_module_sp = (*find_it).second.lock(); if (cached_module_sp) - return Error(); + return Error::success(); m_loaded_modules.erase(find_it); } @@ -263,7 +263,7 @@ Error ModuleCache::Get(const FileSpec &root_dir_spec, const char *hostname, m_loaded_modules.insert( std::make_pair(module_spec.GetUUID().GetAsString(), cached_module_sp)); - return Error(); + return Error::success(); } Error ModuleCache::GetAndPut(const FileSpec &root_dir_spec, @@ -320,7 +320,7 @@ Error ModuleCache::GetAndPut(const FileSpec &root_dir_spec, // module might // contain the necessary symbols and the debugging is also possible without // a symfile. - return Error(); + return Error::success(); error = Put(root_dir_spec, escaped_hostname.c_str(), module_spec, tmp_download_sym_file_spec, @@ -332,5 +332,5 @@ Error ModuleCache::GetAndPut(const FileSpec &root_dir_spec, FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec()); cached_module_sp->SetSymbolFileFileSpec(symfile_spec); - return Error(); + return Error::success(); } |