m_producer_version_minor (0),
m_producer_version_update (0),
m_language_type (eLanguageTypeUnknown),
- m_is_dwarf64 (false)
+ m_is_dwarf64 (false),
+ m_is_optimized (eLazyBoolCalculate)
{
}
m_producer = eProducerInvalid;
m_language_type = eLanguageTypeUnknown;
m_is_dwarf64 = false;
+ m_is_optimized = eLazyBoolCalculate;
}
bool
return m_is_dwarf64;
}
+bool
+DWARFCompileUnit::GetIsOptimized ()
+{
+ if (m_is_optimized == eLazyBoolCalculate)
+ {
+ const DWARFDebugInfoEntry *die = GetCompileUnitDIEOnly();
+ if (die)
+ {
+ m_is_optimized = eLazyBoolNo;
+ if (die->GetAttributeValueAsUnsigned (m_dwarf2Data, this, DW_AT_APPLE_optimized, 0) == 1)
+ {
+ m_is_optimized = eLazyBoolYes;
+ }
+ }
+ }
+ if (m_is_optimized == eLazyBoolYes)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
bool
IsDWARF64() const;
+ bool
+ GetIsOptimized ();
+
protected:
SymbolFileDWARF* m_dwarf2Data;
const DWARFAbbreviationDeclarationSet *m_abbrevs;
uint32_t m_producer_version_update;
lldb::LanguageType m_language_type;
bool m_is_dwarf64;
+ lldb_private::LazyBool m_is_optimized;
void
ParseProducerInfo ();
LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF(cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_language, 0));
- bool is_optimized = false;
- if (cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_APPLE_optimized, 0) == 1)
- {
- is_optimized = true;
- }
+ bool is_optimized = dwarf_cu->GetIsOptimized ();
cu_sp.reset(new CompileUnit (module_sp,
dwarf_cu,
cu_file_spec,