-DIE *DwarfDebug::createScopeChildrenDIE(
- DwarfCompileUnit &TheCU, LexicalScope *Scope,
- SmallVectorImpl<std::unique_ptr<DIE>> &Children,
- unsigned *ChildScopeCount) {
- DIE *ObjectPointer = nullptr;
-
- for (DbgVariable *DV : ScopeVariables.lookup(Scope))
- Children.push_back(TheCU.constructVariableDIE(*DV, *Scope, ObjectPointer));
-
- unsigned ChildCountWithoutScopes = Children.size();
-
- for (LexicalScope *LS : Scope->getChildren())
- TheCU.constructScopeDIE(LS, Children);
-
- if (ChildScopeCount)
- *ChildScopeCount = Children.size() - ChildCountWithoutScopes;
-
- return ObjectPointer;
-}
-