Convert condition to early exit (NFC)

This commit is contained in:
Adrian Prantl 2019-11-14 09:38:49 -08:00
parent 0352007fdb
commit 268e11f95d
1 changed files with 44 additions and 42 deletions

View File

@ -1639,7 +1639,9 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
die.GetAttributeValueAsString(DW_AT_GNU_dwo_name, nullptr);
if (!dwo_path)
dwo_path = die.GetAttributeValueAsString(DW_AT_dwo_name, nullptr);
if (dwo_path) {
if (!dwo_path)
continue;
ModuleSpec dwo_module_spec;
dwo_module_spec.GetFileSpec().SetFile(dwo_path, FileSpec::Style::native);
if (dwo_module_spec.GetFileSpec().IsRelative()) {
@ -1655,11 +1657,11 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
dwo_module_spec.GetArchitecture() =
m_objfile_sp->GetModule()->GetArchitecture();
// When LLDB loads "external" modules it looks at the presence
// of DW_AT_dwo_name. However, when the already created module
// (corresponding to .dwo itself) is being processed, it will
// see the presence of DW_AT_dwo_name (which contains the name
// of dwo file) and will try to call ModuleList::GetSharedModule
// When LLDB loads "external" modules it looks at the presence of
// DW_AT_dwo_name. However, when the already created module
// (corresponding to .dwo itself) is being processed, it will see
// the presence of DW_AT_dwo_name (which contains the name of dwo
// file) and will try to call ModuleList::GetSharedModule
// again. In some cases (i.e., for empty files) Clang 4.0
// generates a *.dwo file which has DW_AT_dwo_name, but no
// DW_AT_comp_dir. In this case the method
@ -1683,7 +1685,7 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
"module files.",
die.GetOffset(), dwo_module_spec.GetFileSpec().GetPath().c_str(),
error.AsCString("unknown error"));
}
continue;
}
}
}