[DWARF] Rename a function and comment it for clarity.

Pointed out by Adrian.
This commit is contained in:
Davide Italiano 2020-04-16 15:36:43 -07:00
parent d10386e177
commit ce7790044f
4 changed files with 8 additions and 4 deletions

View File

@ -1016,7 +1016,7 @@ DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(const DWARFUnit *cu) const {
return nullptr;
}
bool DWARFDebugInfoEntry::IsGlobalOrStaticVariable() const {
bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable() const {
if (Tag() != DW_TAG_variable)
return false;
const DWARFDebugInfoEntry *parent_die = GetParent();

View File

@ -167,7 +167,10 @@ public:
void SetSiblingIndex(uint32_t idx) { m_sibling_idx = idx; }
void SetParentIndex(uint32_t idx) { m_parent_idx = idx; }
bool IsGlobalOrStaticVariable() const;
// This function returns true if the variable scope is either
// global or (file-static). It will return false for static variables
// that are local to a function, as they have local scope.
bool IsGlobalOrStaticScopeVariable() const;
protected:
static DWARFDeclContext

View File

@ -204,7 +204,7 @@ void ManualDWARFIndex::IndexUnitImpl(DWARFUnit &unit,
case DW_AT_location:
case DW_AT_const_value:
has_location_or_const_value = true;
is_global_or_static_variable = die.IsGlobalOrStaticVariable();
is_global_or_static_variable = die.IsGlobalOrStaticScopeVariable();
break;

View File

@ -3390,7 +3390,8 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
}
}
} else {
if (location_is_const_value_data && die.GetDIE()->IsGlobalOrStaticVariable())
if (location_is_const_value_data &&
die.GetDIE()->IsGlobalOrStaticScopeVariable())
scope = eValueTypeVariableStatic;
else {
scope = eValueTypeVariableLocal;