Skip to content

Commit 96000f5

Browse files
committed
[lldb] Simplify SBCommandInterpreter::SourceInitFileInHomeDirectory
just have it delegate to the new overload.
1 parent 370ea1a commit 96000f5

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lldb/include/lldb/Interpreter/CommandInterpreter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class CommandInterpreter : public Broadcaster,
252252
}
253253

254254
void SourceInitFileCwd(CommandReturnObject &result);
255-
void SourceInitFileHome(CommandReturnObject &result, bool is_repl = false);
255+
void SourceInitFileHome(CommandReturnObject &result, bool is_repl);
256256

257257
bool AddCommand(llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp,
258258
bool can_replace);

lldb/source/API/SBCommandInterpreter.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,7 @@ void SBCommandInterpreter::SourceInitFileInHomeDirectory(
421421
SBCommandReturnObject &result) {
422422
LLDB_INSTRUMENT_VA(this, result);
423423

424-
result.Clear();
425-
if (IsValid()) {
426-
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
427-
std::unique_lock<std::recursive_mutex> lock;
428-
if (target_sp)
429-
lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
430-
m_opaque_ptr->SourceInitFileHome(result.ref());
431-
} else {
432-
result->AppendError("SBCommandInterpreter is not valid");
433-
}
424+
SourceInitFileInHomeDirectory(result, /*is_repl=*/false);
434425
}
435426

436427
void SBCommandInterpreter::SourceInitFileInHomeDirectory(

0 commit comments

Comments
 (0)