diff options
author | Jason Molenda <jmolenda@apple.com> | 2015-07-31 05:47:00 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2015-07-31 05:47:00 +0000 |
commit | c7099585726f9baddcc6a952b192f219a53d8723 (patch) | |
tree | c3235d17e78f907608ce17ee9b12dc00dc63ef21 /lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | |
parent | e7107ec03bff019427dbbbdd8ea2403d6492f439 (diff) | |
download | bcm5719-llvm-c7099585726f9baddcc6a952b192f219a53d8723.tar.gz bcm5719-llvm-c7099585726f9baddcc6a952b192f219a53d8723.zip |
Move the computation of whether a DWARF compile unit
is optimized into DWARFCompileUnit, where it should have
been. Next I'll need to call this from another section
of code for DWARF-in-.o-file behavior correctness.
llvm-svn: 243736
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 60933108c97..98d4c1d673d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -52,7 +52,8 @@ DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* dwarf2Data) : 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) { } @@ -71,6 +72,7 @@ DWARFCompileUnit::Clear() m_producer = eProducerInvalid; m_language_type = eLanguageTypeUnknown; m_is_dwarf64 = false; + m_is_optimized = eLazyBoolCalculate; } bool @@ -1108,3 +1110,27 @@ DWARFCompileUnit::IsDWARF64() const 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; + } +} |