summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
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/Host
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/Host')
-rw-r--r--lldb/source/Host/common/NativeBreakpoint.cpp4
-rw-r--r--lldb/source/Host/common/NativeBreakpointList.cpp6
-rw-r--r--lldb/source/Host/common/NativeProcessProtocol.cpp2
-rw-r--r--lldb/source/Host/common/NativeWatchpointList.cpp4
-rw-r--r--lldb/source/Host/common/SoftwareBreakpoint.cpp4
-rw-r--r--lldb/source/Host/posix/FileSystem.cpp4
-rw-r--r--lldb/source/Host/posix/MainLoopPosix.cpp6
-rw-r--r--lldb/source/Host/posix/PipePosix.cpp2
8 files changed, 16 insertions, 16 deletions
diff --git a/lldb/source/Host/common/NativeBreakpoint.cpp b/lldb/source/Host/common/NativeBreakpoint.cpp
index a2cc04884a6..d61a2f531ac 100644
--- a/lldb/source/Host/common/NativeBreakpoint.cpp
+++ b/lldb/source/Host/common/NativeBreakpoint.cpp
@@ -53,7 +53,7 @@ Error NativeBreakpoint::Enable() {
log->Printf("NativeBreakpoint::%s addr = 0x%" PRIx64
" already enabled, ignoring.",
__FUNCTION__, m_addr);
- return Error::success();
+ return Error();
}
// Log and enable.
@@ -85,7 +85,7 @@ Error NativeBreakpoint::Disable() {
log->Printf("NativeBreakpoint::%s addr = 0x%" PRIx64
" already disabled, ignoring.",
__FUNCTION__, m_addr);
- return Error::success();
+ return Error();
}
// Log and disable.
diff --git a/lldb/source/Host/common/NativeBreakpointList.cpp b/lldb/source/Host/common/NativeBreakpointList.cpp
index 58e1c3e9da6..df5bce8079e 100644
--- a/lldb/source/Host/common/NativeBreakpointList.cpp
+++ b/lldb/source/Host/common/NativeBreakpointList.cpp
@@ -40,7 +40,7 @@ Error NativeBreakpointList::AddRef(lldb::addr_t addr, size_t size_hint,
__FUNCTION__, addr);
iter->second->AddRef();
- return Error::success();
+ return Error();
}
// Create a new breakpoint using the given create func.
@@ -205,7 +205,7 @@ Error NativeBreakpointList::GetBreakpoint(lldb::addr_t addr,
// Disable it.
breakpoint_sp = iter->second;
- return Error::success();
+ return Error();
}
Error NativeBreakpointList::RemoveTrapsFromBuffer(lldb::addr_t addr, void *buf,
@@ -225,5 +225,5 @@ Error NativeBreakpointList::RemoveTrapsFromBuffer(lldb::addr_t addr, void *buf,
auto opcode_size = software_bp_sp->m_opcode_size;
::memcpy(opcode_addr, saved_opcodes, opcode_size);
}
- return Error::success();
+ return Error();
}
diff --git a/lldb/source/Host/common/NativeProcessProtocol.cpp b/lldb/source/Host/common/NativeProcessProtocol.cpp
index a22d7f8de7b..d77b8b2e974 100644
--- a/lldb/source/Host/common/NativeProcessProtocol.cpp
+++ b/lldb/source/Host/common/NativeProcessProtocol.cpp
@@ -405,7 +405,7 @@ Error NativeProcessProtocol::ResolveProcessArchitecture(lldb::pid_t pid,
arch = module_specs.GetModuleSpecRefAtIndex(0).GetArchitecture();
if (arch.IsValid())
- return Error::success();
+ return Error();
else
return Error("failed to retrieve a valid architecture from the exe module");
}
diff --git a/lldb/source/Host/common/NativeWatchpointList.cpp b/lldb/source/Host/common/NativeWatchpointList.cpp
index be9d2eba6a3..5948adf3c8d 100644
--- a/lldb/source/Host/common/NativeWatchpointList.cpp
+++ b/lldb/source/Host/common/NativeWatchpointList.cpp
@@ -17,12 +17,12 @@ using namespace lldb_private;
Error NativeWatchpointList::Add(addr_t addr, size_t size, uint32_t watch_flags,
bool hardware) {
m_watchpoints[addr] = {addr, size, watch_flags, hardware};
- return Error::success();
+ return Error();
}
Error NativeWatchpointList::Remove(addr_t addr) {
m_watchpoints.erase(addr);
- return Error::success();
+ return Error();
}
const NativeWatchpointList::WatchpointMap &
diff --git a/lldb/source/Host/common/SoftwareBreakpoint.cpp b/lldb/source/Host/common/SoftwareBreakpoint.cpp
index 6cb8126fb14..3d57b7dd6b8 100644
--- a/lldb/source/Host/common/SoftwareBreakpoint.cpp
+++ b/lldb/source/Host/common/SoftwareBreakpoint.cpp
@@ -103,7 +103,7 @@ Error SoftwareBreakpoint::CreateSoftwareBreakpoint(
// breakpoint.
breakpoint_sp.reset(new SoftwareBreakpoint(process, addr, saved_opcode_bytes,
bp_opcode_bytes, bp_opcode_size));
- return Error::success();
+ return Error();
}
Error SoftwareBreakpoint::EnableSoftwareBreakpoint(
@@ -219,7 +219,7 @@ Error SoftwareBreakpoint::EnableSoftwareBreakpoint(
log->Printf("SoftwareBreakpoint::%s addr = 0x%" PRIx64 " -- SUCCESS",
__FUNCTION__, addr);
- return Error::success();
+ return Error();
}
// -------------------------------------------------------------------
diff --git a/lldb/source/Host/posix/FileSystem.cpp b/lldb/source/Host/posix/FileSystem.cpp
index 0567f60a3cb..aaa53ce0772 100644
--- a/lldb/source/Host/posix/FileSystem.cpp
+++ b/lldb/source/Host/posix/FileSystem.cpp
@@ -62,7 +62,7 @@ Error FileSystem::MakeDirectory(const FileSpec &file_spec,
} break;
case EEXIST: {
if (file_spec.IsDirectory())
- return Error::success(); // It is a directory and it already exists
+ return Error(); // It is a directory and it already exists
} break;
}
}
@@ -210,7 +210,7 @@ Error FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) {
dst = FileSpec(real_path, false);
- return Error::success();
+ return Error();
}
#if defined(__NetBSD__)
diff --git a/lldb/source/Host/posix/MainLoopPosix.cpp b/lldb/source/Host/posix/MainLoopPosix.cpp
index 59a76121f6d..08c969e72a2 100644
--- a/lldb/source/Host/posix/MainLoopPosix.cpp
+++ b/lldb/source/Host/posix/MainLoopPosix.cpp
@@ -160,7 +160,7 @@ Error MainLoopPosix::Run() {
it->second.callback(*this); // Do the work
if (m_terminate_request)
- return Error::success();
+ return Error();
}
for (int fd : read_fds) {
@@ -175,8 +175,8 @@ Error MainLoopPosix::Run() {
it->second(*this); // Do the work
if (m_terminate_request)
- return Error::success();
+ return Error();
}
}
- return Error::success();
+ return Error();
}
diff --git a/lldb/source/Host/posix/PipePosix.cpp b/lldb/source/Host/posix/PipePosix.cpp
index 142f6c99cb2..4e0810c1a9b 100644
--- a/lldb/source/Host/posix/PipePosix.cpp
+++ b/lldb/source/Host/posix/PipePosix.cpp
@@ -206,7 +206,7 @@ Error PipePosix::OpenAsWriterWithTimeout(
}
}
- return Error::success();
+ return Error();
}
int PipePosix::GetReadFileDescriptor() const { return m_fds[READ]; }
OpenPOWER on IntegriCloud