summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/ModuleCache.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-11-11 04:29:25 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-11-11 04:29:25 +0000
commitc1edf566b9ba18806c9a69e77db1cc8e57a14c8d (patch)
treeea1b174a6e594d2b6929f9e4845cc2ba3d9d6f93 /lldb/source/Utility/ModuleCache.cpp
parent41af43092ccc8030bb49cea324d85eecd5ae68a8 (diff)
downloadbcm5719-llvm-c1edf566b9ba18806c9a69e77db1cc8e57a14c8d.tar.gz
bcm5719-llvm-c1edf566b9ba18806c9a69e77db1cc8e57a14c8d.zip
Prevent at compile time converting from Error::success() to Expected<T>
This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
Diffstat (limited to 'lldb/source/Utility/ModuleCache.cpp')
-rw-r--r--lldb/source/Utility/ModuleCache.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Utility/ModuleCache.cpp b/lldb/source/Utility/ModuleCache.cpp
index c53be909164..889cd8f9466 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::success();
+ return Error();
}
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::success();
+ return Error();
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::success();
+ return Error();
}
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::success();
+ return Error();
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::success();
+ return Error();
}
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::success();
+ return Error();
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::success();
+ return Error();
}
OpenPOWER on IntegriCloud