Simplify control flow (NFC)

This commit is contained in:
Adrian Prantl 2021-10-06 14:30:02 -07:00
parent 14aa3f3703
commit 2edb9058ea
1 changed files with 24 additions and 24 deletions

View File

@ -661,13 +661,17 @@ bool DWARFUnit::Supports_unnamed_objc_bitfields() {
}
void DWARFUnit::ParseProducerInfo() {
m_producer = eProducerOther;
const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
if (die) {
const char *producer_cstr =
die->GetAttributeValueAsString(this, DW_AT_producer, nullptr);
llvm::StringRef producer(producer_cstr);
if (!producer.empty()) {
RegularExpression llvm_gcc_regex(
if (!die)
return;
llvm::StringRef producer(
die->GetAttributeValueAsString(this, DW_AT_producer, nullptr));
if (producer.empty())
return;
static RegularExpression llvm_gcc_regex(
llvm::StringRef("^4\\.[012]\\.[01] \\(Based on Apple "
"Inc\\. build [0-9]+\\) \\(LLVM build "
"[\\.0-9]+\\)$"));
@ -682,10 +686,6 @@ void DWARFUnit::ParseProducerInfo() {
m_producer = eProducerClang;
} else if (producer.contains("GNU"))
m_producer = eProducerGCC;
}
}
if (m_producer == eProducerInvalid)
m_producer = eProducerOther;
}
DWARFProducer DWARFUnit::GetProducer() {