aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2024-09-18 14:54:49 -0700
committerGitHub <noreply@github.com>2024-09-18 14:54:49 -0700
commit06939fa2e140a171132275ec0ea1857d20c5dbdd (patch)
tree115d56c60eab30d4a41e3dd9b1d82a87f97e8af4 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
parenta7c174502aef45b2d33291129cce10c085fef944 (diff)
downloadllvm-06939fa2e140a171132275ec0ea1857d20c5dbdd.zip
llvm-06939fa2e140a171132275ec0ea1857d20c5dbdd.tar.gz
llvm-06939fa2e140a171132275ec0ea1857d20c5dbdd.tar.bz2
[lldb] Change the implementation of Status to store an llvm::Error (NFC) (#106774)
(based on a conversation I had with @labath yesterday in https://github.com/llvm/llvm-project/pull/106442) Most APIs that currently vend a Status would be better served by returning llvm::Expected<> instead. If possibles APIs should be refactored to avoid Status. The only legitimate long-term uses of Status are objects that need to store an error for a long time (which should be questioned as a design decision, too). This patch makes the transition to llvm::Error easier by making the places that cannot switch to llvm::Error explicit: They are marked with a call to Status::clone(). Every other API can and should be refactored to use llvm::Expected. In the end Status should only be used in very few places. Whenever an unchecked Error is dropped by Status it logs this to the verbose API channel. Implementation notes: This patch introduces two new kinds of error_category as well as new llvm::Error types. Here is the mapping of lldb::ErrorType to llvm::Errors: ``` (eErrorTypeInvalid) eErrorTypeGeneric llvm::StringError eErrorTypePOSIX llvm::ECError eErrorTypeMachKernel MachKernelError eErrorTypeExpression llvm::ErrorList<ExpressionError> eErrorTypeWin32 Win32Error ```
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
0 files changed, 0 insertions, 0 deletions