[Lldb-commits] [lldb] 50b1276 - [lldb] Qualify `auto` in the lldb driver (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 25 07:40:44 PDT 2023
Author: Jonas Devlieghere
Date: 2023-08-25T07:40:37-07:00
New Revision: 50b127613abc1a3d52f4f0f98ef6cdff4f9d39c8
URL: https://github.com/llvm/llvm-project/commit/50b127613abc1a3d52f4f0f98ef6cdff4f9d39c8
DIFF: https://github.com/llvm/llvm-project/commit/50b127613abc1a3d52f4f0f98ef6cdff4f9d39c8.diff
LOG: [lldb] Qualify `auto` in the lldb driver (NFC)
The LLVM coding guidelines say to "[u]se auto & for values and auto *
for pointers unless you need to make a copy."
Added:
Modified:
lldb/tools/driver/Driver.cpp
Removed:
################################################################################
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index f6e17a63dbec90..f8058f868d53ff 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -206,7 +206,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_core)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
SBFileSpec file(arg_value);
if (!file.Exists()) {
error.SetErrorStringWithFormat(
@@ -232,7 +232,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_file)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
SBFileSpec file(arg_value);
if (file.Exists()) {
m_option_data.m_args.emplace_back(arg_value);
@@ -249,7 +249,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_arch)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
if (!lldb::SBDebugger::SetDefaultArchitecture(arg_value)) {
error.SetErrorStringWithFormat(
"invalid architecture in the -a or --arch option: '%s'", arg_value);
@@ -258,7 +258,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_script_language)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
m_debugger.SetScriptLanguage(m_debugger.GetScriptingLanguage(arg_value));
}
@@ -267,7 +267,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_attach_name)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
m_option_data.m_process_name = arg_value;
}
@@ -276,7 +276,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_attach_pid)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
char *remainder;
m_option_data.m_process_pid = strtol(arg_value, &remainder, 0);
if (remainder == arg_value || *remainder != '\0') {
@@ -287,7 +287,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
if (auto *arg = args.getLastArg(OPT_repl_language)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
m_option_data.m_repl_lang =
SBLanguageRuntime::GetLanguageTypeFromString(arg_value);
if (m_option_data.m_repl_lang == eLanguageTypeUnknown) {
@@ -304,7 +304,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
if (auto *arg = args.getLastArg(OPT_repl_)) {
m_option_data.m_repl = true;
- if (auto arg_value = arg->getValue())
+ if (auto *arg_value = arg->getValue())
m_option_data.m_repl_options = arg_value;
}
@@ -313,7 +313,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
for (auto *arg : args.filtered(OPT_source_on_crash, OPT_one_line_on_crash,
OPT_source, OPT_source_before_file,
OPT_one_line, OPT_one_line_before_file)) {
- auto arg_value = arg->getValue();
+ auto *arg_value = arg->getValue();
if (arg->getOption().matches(OPT_source_on_crash)) {
m_option_data.AddInitialCommand(arg_value, eCommandPlacementAfterCrash,
true, error);
@@ -365,7 +365,7 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
// Any argument following -- is an argument for the inferior.
if (auto *arg = args.getLastArgNoClaim(OPT_REM)) {
- for (auto value : arg->getValues())
+ for (auto *value : arg->getValues())
m_option_data.m_args.emplace_back(value);
}
} else if (args.getLastArgNoClaim() != nullptr) {
More information about the lldb-commits
mailing list