@@ -40,6 +40,7 @@ const char *const KindTemplateAlias = "TemplateAlias";
40
40
const char *const KindTemplatePack = " TemplatePack" ;
41
41
const char *const KindUndefined = " Undefined" ;
42
42
const char *const KindUnion = " Union" ;
43
+ const char *const KindModule = " Module" ;
43
44
} // end anonymous namespace
44
45
45
46
// ===----------------------------------------------------------------------===//
@@ -50,6 +51,8 @@ const char *LVScope::kind() const {
50
51
const char *Kind = KindUndefined;
51
52
if (getIsArray ())
52
53
Kind = KindArray;
54
+ else if (getIsModule ())
55
+ Kind = KindModule;
53
56
else if (getIsBlock ())
54
57
Kind = KindBlock;
55
58
else if (getIsCallSite ())
@@ -101,7 +104,8 @@ LVScopeDispatch LVScope::Dispatch = {
101
104
{LVScopeKind::IsTemplateAlias, &LVScope::getIsTemplateAlias},
102
105
{LVScopeKind::IsTemplatePack, &LVScope::getIsTemplatePack},
103
106
{LVScopeKind::IsTryBlock, &LVScope::getIsTryBlock},
104
- {LVScopeKind::IsUnion, &LVScope::getIsUnion}};
107
+ {LVScopeKind::IsUnion, &LVScope::getIsUnion},
108
+ {LVScopeKind::IsModule, &LVScope::getIsModule}};
105
109
106
110
void LVScope::addToChildren (LVElement *Element) {
107
111
if (!Children)
@@ -2107,3 +2111,15 @@ bool LVScopeTemplatePack::equals(const LVScope *Scope) const {
2107
2111
void LVScopeTemplatePack::printExtra (raw_ostream &OS, bool Full) const {
2108
2112
OS << formattedKind (kind ()) << " " << formattedName (getName ()) << " \n " ;
2109
2113
}
2114
+
2115
+ // ===----------------------------------------------------------------------===//
2116
+ // DWARF module (DW_TAG_module).
2117
+ // ===----------------------------------------------------------------------===//
2118
+ bool LVScopeModule::equals (const LVScope *Scope) const {
2119
+ // For lexical blocks, LVScope::equals() compares the parent scope.
2120
+ return LVScope::equals (Scope) && (Scope->getName () == getName ());
2121
+ }
2122
+
2123
+ void LVScopeModule::printExtra (raw_ostream &OS, bool Full) const {
2124
+ OS << formattedKind (kind ()) << " " << formattedName (getName ()) << " \n " ;
2125
+ }
0 commit comments