Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error". Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around. Hopefully nothing too
serious.
llvm-svn: 302872
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index a3cdfa9..256d46a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -43,8 +43,8 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/Endian.h"
-#include "lldb/Utility/Error.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Status.h"
#include "lldb/lldb-private.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
@@ -191,7 +191,7 @@
return false;
if (m_parser_vars->m_materializer && is_result) {
- Error err;
+ Status err;
ExecutionContext &exe_ctx = m_parser_vars->m_exe_ctx;
Target *target = exe_ctx.GetTargetPtr();
@@ -364,7 +364,7 @@
if (m_parser_vars->m_materializer) {
uint32_t offset = 0;
- Error err;
+ Status err;
if (is_persistent_variable) {
ExpressionVariableSP var_sp(var->shared_from_this());
@@ -1630,7 +1630,7 @@
DWARFExpression &var_location_expr = var->LocationExpression();
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
- Error err;
+ Status err;
if (var->GetLocationIsConstantValueData()) {
DataExtractor const_value_extractor;
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 6c923ce..4e20be7 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -756,7 +756,7 @@
return false;
}
-lldb_private::Error ClangExpressionParser::PrepareForExecution(
+lldb_private::Status ClangExpressionParser::PrepareForExecution(
lldb::addr_t &func_addr, lldb::addr_t &func_end,
lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx,
bool &can_interpret, ExecutionPolicy execution_policy) {
@@ -764,7 +764,7 @@
func_end = LLDB_INVALID_ADDRESS;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- lldb_private::Error err;
+ lldb_private::Status err;
std::unique_ptr<llvm::Module> llvm_module_ap(
m_code_generator->ReleaseModule());
@@ -857,7 +857,7 @@
if (execution_policy != eExecutionPolicyAlways &&
execution_policy != eExecutionPolicyTopLevel) {
- lldb_private::Error interpret_error;
+ lldb_private::Status interpret_error;
bool interpret_function_calls =
!process ? false : process->CanInterpretFunctionCalls();
@@ -941,9 +941,9 @@
return err;
}
-lldb_private::Error ClangExpressionParser::RunStaticInitializers(
+lldb_private::Status ClangExpressionParser::RunStaticInitializers(
lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx) {
- lldb_private::Error err;
+ lldb_private::Status err;
lldbassert(execution_unit_sp.get());
lldbassert(exe_ctx.HasThreadScope());
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
index f0203f3..3e6a109 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
@@ -14,7 +14,7 @@
#include "lldb/Core/ClangForward.h"
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Expression/ExpressionParser.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "lldb/lldb-public.h"
#include <string>
@@ -110,7 +110,7 @@
/// An error code indicating the success or failure of the operation.
/// Test with Success().
//------------------------------------------------------------------
- Error
+ Status
PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end,
lldb::IRExecutionUnitSP &execution_unit_sp,
ExecutionContext &exe_ctx, bool &can_interpret,
@@ -128,8 +128,8 @@
/// @return
/// The error code indicating the
//------------------------------------------------------------------
- Error RunStaticInitializers(lldb::IRExecutionUnitSP &execution_unit_sp,
- ExecutionContext &exe_ctx);
+ Status RunStaticInitializers(lldb::IRExecutionUnitSP &execution_unit_sp,
+ ExecutionContext &exe_ctx);
//------------------------------------------------------------------
/// Returns a string representing current ABI.
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 95d81db..2a6261a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -83,7 +83,7 @@
ClangUserExpression::~ClangUserExpression() {}
-void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) {
+void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (log)
@@ -315,7 +315,7 @@
bool generate_debug_info) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- Error err;
+ Status err;
InstallContext(exe_ctx);
@@ -501,7 +501,7 @@
//
{
- Error jit_error = parser.PrepareForExecution(
+ Status jit_error = parser.PrepareForExecution(
m_jit_start_addr, m_jit_end_addr, m_execution_unit_sp, exe_ctx,
m_can_interpret, execution_policy);
@@ -517,7 +517,7 @@
}
if (exe_ctx.GetProcessPtr() && execution_policy == eExecutionPolicyTopLevel) {
- Error static_init_error =
+ Status static_init_error =
parser.RunStaticInitializers(m_execution_unit_sp, exe_ctx);
if (!static_init_error.Success()) {
@@ -603,7 +603,7 @@
return false;
}
- Error object_ptr_error;
+ Status object_ptr_error;
object_ptr = GetObjectPointer(frame_sp, object_name, object_ptr_error);
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index 155c153..88a7879 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -168,7 +168,7 @@
//------------------------------------------------------------------
void ScanContext(ExecutionContext &exe_ctx,
- lldb_private::Error &err) override;
+ lldb_private::Status &err) override;
bool AddArguments(ExecutionContext &exe_ctx, std::vector<lldb::addr_t> &args,
lldb::addr_t struct_address,
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index a54ab4a..065e5db 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -118,7 +118,7 @@
bool can_interpret = false; // should stay that way
- Error jit_error = parser.PrepareForExecution(
+ Status jit_error = parser.PrepareForExecution(
m_jit_start_addr, m_jit_end_addr, m_execution_unit_sp, exe_ctx,
can_interpret, eExecutionPolicyAlways);
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 68a214e..13f5657 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -1263,7 +1263,7 @@
lldb_private::Scalar scalar = int_initializer->getValue().zextOrTrunc(
llvm::NextPowerOf2(constant_size) * 8);
- lldb_private::Error get_data_error;
+ lldb_private::Status get_data_error;
if (!scalar.GetAsMemoryData(data, constant_size,
lldb_private::endian::InlHostByteOrder(),
get_data_error))
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
index eb52730..93ce8aa 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
@@ -13,7 +13,7 @@
#include "lldb/Symbol/TaggedASTType.h"
#include "lldb/Utility/ConstString.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/lldb-public.h"
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoParser.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoParser.cpp
index 0bae4a4..538bd05 100644
--- a/lldb/source/Plugins/ExpressionParser/Go/GoParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Go/GoParser.cpp
@@ -12,7 +12,7 @@
#include "GoParser.h"
#include "Plugins/ExpressionParser/Go/GoAST.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "llvm/ADT/SmallString.h"
using namespace lldb_private;
@@ -860,7 +860,7 @@
return m_strings.insert(std::make_pair(s, 'x')).first->getKey();
}
-void GoParser::GetError(Error &error) {
+void GoParser::GetError(Status &error) {
llvm::StringRef want;
if (m_failed)
want =
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoParser.h b/lldb/source/Plugins/ExpressionParser/Go/GoParser.h
index bd12855..9ed2ae2 100644
--- a/lldb/source/Plugins/ExpressionParser/Go/GoParser.h
+++ b/lldb/source/Plugins/ExpressionParser/Go/GoParser.h
@@ -82,7 +82,7 @@
return m_lexer.BytesRemaining() == 0 && m_pos == m_tokens.size();
}
- void GetError(Error &error);
+ void GetError(Status &error);
private:
class Rule;
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
index 50d45a1..f4b8cfb 100644
--- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
@@ -150,7 +150,7 @@
CompilerType EvaluateType(const GoASTExpr *e);
- Error &error() { return m_error; }
+ Status &error() { return m_error; }
private:
std::nullptr_t NotImplemented(const GoASTExpr *e) {
@@ -163,7 +163,7 @@
lldb::StackFrameSP m_frame;
GoParser m_parser;
DynamicValueType m_use_dynamic;
- Error m_error;
+ Status m_error;
llvm::StringRef m_package;
std::vector<std::unique_ptr<GoASTStmt>> m_statements;
};
@@ -254,7 +254,7 @@
m_interpreter->set_use_dynamic(options.GetUseDynamic());
ValueObjectSP result_val_sp = m_interpreter->Evaluate(exe_ctx);
- Error err = m_interpreter->error();
+ Status err = m_interpreter->error();
m_interpreter.reset();
if (!result_val_sp) {