Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 1 | //===- LexicalScopes.cpp - Collecting lexical scope info ------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements LexicalScopes analysis. |
| 11 | // |
| 12 | // This pass collects lexical scope information and maps machine instructions |
| 13 | // to respective lexical scopes. |
| 14 | // |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | #define DEBUG_TYPE "lexicalscopes" |
| 18 | #include "llvm/CodeGen/LexicalScopes.h" |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/MachineFunction.h" |
| 20 | #include "llvm/CodeGen/MachineInstr.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 21 | #include "llvm/DebugInfo.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 22 | #include "llvm/IR/Function.h" |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 23 | #include "llvm/Support/Debug.h" |
| 24 | #include "llvm/Support/ErrorHandling.h" |
| 25 | #include "llvm/Support/FormattedStream.h" |
| 26 | using namespace llvm; |
| 27 | |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 28 | LexicalScopes::~LexicalScopes() { releaseMemory(); } |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 29 | |
| 30 | /// releaseMemory - release memory. |
| 31 | void LexicalScopes::releaseMemory() { |
| 32 | MF = NULL; |
| 33 | CurrentFnLexicalScope = NULL; |
| 34 | DeleteContainerSeconds(LexicalScopeMap); |
| 35 | DeleteContainerSeconds(AbstractScopeMap); |
| 36 | InlinedLexicalScopeMap.clear(); |
| 37 | AbstractScopesList.clear(); |
| 38 | } |
| 39 | |
| 40 | /// initialize - Scan machine function and constuct lexical scope nest. |
| 41 | void LexicalScopes::initialize(const MachineFunction &Fn) { |
| 42 | releaseMemory(); |
| 43 | MF = &Fn; |
| 44 | SmallVector<InsnRange, 4> MIRanges; |
| 45 | DenseMap<const MachineInstr *, LexicalScope *> MI2ScopeMap; |
| 46 | extractLexicalScopes(MIRanges, MI2ScopeMap); |
| 47 | if (CurrentFnLexicalScope) { |
| 48 | constructScopeNest(CurrentFnLexicalScope); |
| 49 | assignInstructionRanges(MIRanges, MI2ScopeMap); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /// extractLexicalScopes - Extract instruction ranges for each lexical scopes |
| 54 | /// for the given machine function. |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 55 | void LexicalScopes::extractLexicalScopes( |
| 56 | SmallVectorImpl<InsnRange> &MIRanges, |
| 57 | DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 58 | |
| 59 | // Scan each instruction and create scopes. First build working set of scopes. |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 60 | for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; |
| 61 | ++I) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 62 | const MachineInstr *RangeBeginMI = NULL; |
| 63 | const MachineInstr *PrevMI = NULL; |
| 64 | DebugLoc PrevDL; |
| 65 | for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); |
| 66 | II != IE; ++II) { |
| 67 | const MachineInstr *MInsn = II; |
| 68 | |
| 69 | // Check if instruction has valid location information. |
| 70 | const DebugLoc MIDL = MInsn->getDebugLoc(); |
| 71 | if (MIDL.isUnknown()) { |
| 72 | PrevMI = MInsn; |
| 73 | continue; |
| 74 | } |
| 75 | |
| 76 | // If scope has not changed then skip this instruction. |
| 77 | if (MIDL == PrevDL) { |
| 78 | PrevMI = MInsn; |
| 79 | continue; |
| 80 | } |
| 81 | |
| 82 | // Ignore DBG_VALUE. It does not contribute to any instruction in output. |
| 83 | if (MInsn->isDebugValue()) |
| 84 | continue; |
| 85 | |
| 86 | if (RangeBeginMI) { |
| 87 | // If we have already seen a beginning of an instruction range and |
| 88 | // current instruction scope does not match scope of first instruction |
| 89 | // in this range then create a new instruction range. |
| 90 | InsnRange R(RangeBeginMI, PrevMI); |
| 91 | MI2ScopeMap[RangeBeginMI] = getOrCreateLexicalScope(PrevDL); |
| 92 | MIRanges.push_back(R); |
| 93 | } |
| 94 | |
| 95 | // This is a beginning of a new instruction range. |
| 96 | RangeBeginMI = MInsn; |
| 97 | |
| 98 | // Reset previous markers. |
| 99 | PrevMI = MInsn; |
| 100 | PrevDL = MIDL; |
| 101 | } |
| 102 | |
| 103 | // Create last instruction range. |
| 104 | if (RangeBeginMI && PrevMI && !PrevDL.isUnknown()) { |
| 105 | InsnRange R(RangeBeginMI, PrevMI); |
| 106 | MIRanges.push_back(R); |
| 107 | MI2ScopeMap[RangeBeginMI] = getOrCreateLexicalScope(PrevDL); |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /// findLexicalScope - Find lexical scope, either regular or inlined, for the |
| 113 | /// given DebugLoc. Return NULL if not found. |
| 114 | LexicalScope *LexicalScopes::findLexicalScope(DebugLoc DL) { |
| 115 | MDNode *Scope = NULL; |
| 116 | MDNode *IA = NULL; |
| 117 | DL.getScopeAndInlinedAt(Scope, IA, MF->getFunction()->getContext()); |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 118 | if (!Scope) |
| 119 | return NULL; |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 120 | |
| 121 | // The scope that we were created with could have an extra file - which |
| 122 | // isn't what we care about in this case. |
| 123 | DIDescriptor D = DIDescriptor(Scope); |
| 124 | if (D.isLexicalBlockFile()) |
| 125 | Scope = DILexicalBlockFile(Scope).getScope(); |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 126 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 127 | if (IA) |
| 128 | return InlinedLexicalScopeMap.lookup(DebugLoc::getFromDILocation(IA)); |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 129 | return LexicalScopeMap.lookup(Scope); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /// getOrCreateLexicalScope - Find lexical scope for the given DebugLoc. If |
| 133 | /// not available then create new lexical scope. |
| 134 | LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) { |
| 135 | MDNode *Scope = NULL; |
| 136 | MDNode *InlinedAt = NULL; |
| 137 | DL.getScopeAndInlinedAt(Scope, InlinedAt, MF->getFunction()->getContext()); |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 138 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 139 | if (InlinedAt) { |
| 140 | // Create an abstract scope for inlined function. |
| 141 | getOrCreateAbstractScope(Scope); |
| 142 | // Create an inlined scope for inlined function. |
| 143 | return getOrCreateInlinedScope(Scope, InlinedAt); |
| 144 | } |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 145 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 146 | return getOrCreateRegularScope(Scope); |
| 147 | } |
| 148 | |
| 149 | /// getOrCreateRegularScope - Find or create a regular lexical scope. |
| 150 | LexicalScope *LexicalScopes::getOrCreateRegularScope(MDNode *Scope) { |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 151 | DIDescriptor D = DIDescriptor(Scope); |
Eric Christopher | 76933f4 | 2011-10-13 21:43:44 +0000 | [diff] [blame] | 152 | if (D.isLexicalBlockFile()) { |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 153 | Scope = DILexicalBlockFile(Scope).getScope(); |
Eric Christopher | 76933f4 | 2011-10-13 21:43:44 +0000 | [diff] [blame] | 154 | D = DIDescriptor(Scope); |
| 155 | } |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 156 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 157 | LexicalScope *WScope = LexicalScopeMap.lookup(Scope); |
| 158 | if (WScope) |
| 159 | return WScope; |
| 160 | |
| 161 | LexicalScope *Parent = NULL; |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 162 | if (D.isLexicalBlock()) |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 163 | Parent = getOrCreateLexicalScope(DebugLoc::getFromDILexicalBlock(Scope)); |
| 164 | WScope = new LexicalScope(Parent, DIDescriptor(Scope), NULL, false); |
| 165 | LexicalScopeMap.insert(std::make_pair(Scope, WScope)); |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 166 | if (!Parent && DIDescriptor(Scope).isSubprogram() && |
| 167 | DISubprogram(Scope).describes(MF->getFunction())) |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 168 | CurrentFnLexicalScope = WScope; |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 169 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 170 | return WScope; |
| 171 | } |
| 172 | |
| 173 | /// getOrCreateInlinedScope - Find or create an inlined lexical scope. |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 174 | LexicalScope *LexicalScopes::getOrCreateInlinedScope(MDNode *Scope, |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 175 | MDNode *InlinedAt) { |
| 176 | LexicalScope *InlinedScope = LexicalScopeMap.lookup(InlinedAt); |
| 177 | if (InlinedScope) |
| 178 | return InlinedScope; |
| 179 | |
| 180 | DebugLoc InlinedLoc = DebugLoc::getFromDILocation(InlinedAt); |
| 181 | InlinedScope = new LexicalScope(getOrCreateLexicalScope(InlinedLoc), |
| 182 | DIDescriptor(Scope), InlinedAt, false); |
| 183 | InlinedLexicalScopeMap[InlinedLoc] = InlinedScope; |
| 184 | LexicalScopeMap[InlinedAt] = InlinedScope; |
| 185 | return InlinedScope; |
| 186 | } |
| 187 | |
| 188 | /// getOrCreateAbstractScope - Find or create an abstract lexical scope. |
| 189 | LexicalScope *LexicalScopes::getOrCreateAbstractScope(const MDNode *N) { |
| 190 | assert(N && "Invalid Scope encoding!"); |
| 191 | |
Eric Christopher | 6647b83 | 2011-10-11 22:59:11 +0000 | [diff] [blame] | 192 | DIDescriptor Scope(N); |
| 193 | if (Scope.isLexicalBlockFile()) |
| 194 | Scope = DILexicalBlockFile(Scope).getScope(); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 195 | LexicalScope *AScope = AbstractScopeMap.lookup(N); |
| 196 | if (AScope) |
| 197 | return AScope; |
| 198 | |
| 199 | LexicalScope *Parent = NULL; |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 200 | if (Scope.isLexicalBlock()) { |
| 201 | DILexicalBlock DB(N); |
| 202 | DIDescriptor ParentDesc = DB.getContext(); |
| 203 | Parent = getOrCreateAbstractScope(ParentDesc); |
| 204 | } |
| 205 | AScope = new LexicalScope(Parent, DIDescriptor(N), NULL, true); |
| 206 | AbstractScopeMap[N] = AScope; |
| 207 | if (DIDescriptor(N).isSubprogram()) |
| 208 | AbstractScopesList.push_back(AScope); |
| 209 | return AScope; |
| 210 | } |
| 211 | |
| 212 | /// constructScopeNest |
| 213 | void LexicalScopes::constructScopeNest(LexicalScope *Scope) { |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 214 | assert(Scope && "Unable to calculate scope dominance graph!"); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 215 | SmallVector<LexicalScope *, 4> WorkStack; |
| 216 | WorkStack.push_back(Scope); |
| 217 | unsigned Counter = 0; |
| 218 | while (!WorkStack.empty()) { |
| 219 | LexicalScope *WS = WorkStack.back(); |
Craig Topper | 80170e5 | 2013-07-03 04:30:58 +0000 | [diff] [blame] | 220 | const SmallVectorImpl<LexicalScope *> &Children = WS->getChildren(); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 221 | bool visitedChildren = false; |
Craig Topper | 24fd7ee | 2013-07-03 04:42:33 +0000 | [diff] [blame] | 222 | for (SmallVectorImpl<LexicalScope *>::const_iterator SI = Children.begin(), |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 223 | SE = Children.end(); |
| 224 | SI != SE; ++SI) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 225 | LexicalScope *ChildScope = *SI; |
| 226 | if (!ChildScope->getDFSOut()) { |
| 227 | WorkStack.push_back(ChildScope); |
| 228 | visitedChildren = true; |
| 229 | ChildScope->setDFSIn(++Counter); |
| 230 | break; |
| 231 | } |
| 232 | } |
| 233 | if (!visitedChildren) { |
| 234 | WorkStack.pop_back(); |
| 235 | WS->setDFSOut(++Counter); |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
Devang Patel | 784077e | 2011-08-10 23:58:09 +0000 | [diff] [blame] | 240 | /// assignInstructionRanges - Find ranges of instructions covered by each |
| 241 | /// lexical scope. |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 242 | void LexicalScopes::assignInstructionRanges( |
| 243 | SmallVectorImpl<InsnRange> &MIRanges, |
| 244 | DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap) { |
| 245 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 246 | LexicalScope *PrevLexicalScope = NULL; |
| 247 | for (SmallVectorImpl<InsnRange>::const_iterator RI = MIRanges.begin(), |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 248 | RE = MIRanges.end(); |
| 249 | RI != RE; ++RI) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 250 | const InsnRange &R = *RI; |
| 251 | LexicalScope *S = MI2ScopeMap.lookup(R.first); |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 252 | assert(S && "Lost LexicalScope for a machine instruction!"); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 253 | if (PrevLexicalScope && !PrevLexicalScope->dominates(S)) |
| 254 | PrevLexicalScope->closeInsnRange(S); |
| 255 | S->openInsnRange(R.first); |
| 256 | S->extendInsnRange(R.second); |
| 257 | PrevLexicalScope = S; |
| 258 | } |
| 259 | |
| 260 | if (PrevLexicalScope) |
| 261 | PrevLexicalScope->closeInsnRange(); |
| 262 | } |
| 263 | |
| 264 | /// getMachineBasicBlocks - Populate given set using machine basic blocks which |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 265 | /// have machine instructions that belong to lexical scope identified by |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 266 | /// DebugLoc. |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 267 | void LexicalScopes::getMachineBasicBlocks( |
| 268 | DebugLoc DL, SmallPtrSet<const MachineBasicBlock *, 4> &MBBs) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 269 | MBBs.clear(); |
| 270 | LexicalScope *Scope = getOrCreateLexicalScope(DL); |
| 271 | if (!Scope) |
| 272 | return; |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 273 | |
Devang Patel | db4374a | 2011-08-12 18:01:34 +0000 | [diff] [blame] | 274 | if (Scope == CurrentFnLexicalScope) { |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 275 | for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; |
| 276 | ++I) |
Devang Patel | db4374a | 2011-08-12 18:01:34 +0000 | [diff] [blame] | 277 | MBBs.insert(I); |
| 278 | return; |
| 279 | } |
| 280 | |
Craig Topper | 80170e5 | 2013-07-03 04:30:58 +0000 | [diff] [blame] | 281 | SmallVectorImpl<InsnRange> &InsnRanges = Scope->getRanges(); |
Craig Topper | 24fd7ee | 2013-07-03 04:42:33 +0000 | [diff] [blame] | 282 | for (SmallVectorImpl<InsnRange>::iterator I = InsnRanges.begin(), |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 283 | E = InsnRanges.end(); |
| 284 | I != E; ++I) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 285 | InsnRange &R = *I; |
| 286 | MBBs.insert(R.first->getParent()); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | /// dominates - Return true if DebugLoc's lexical scope dominates at least one |
| 291 | /// machine instruction's lexical scope in a given machine basic block. |
| 292 | bool LexicalScopes::dominates(DebugLoc DL, MachineBasicBlock *MBB) { |
| 293 | LexicalScope *Scope = getOrCreateLexicalScope(DL); |
| 294 | if (!Scope) |
| 295 | return false; |
Devang Patel | db4374a | 2011-08-12 18:01:34 +0000 | [diff] [blame] | 296 | |
| 297 | // Current function scope covers all basic blocks in the function. |
| 298 | if (Scope == CurrentFnLexicalScope && MBB->getParent() == MF) |
| 299 | return true; |
| 300 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 301 | bool Result = false; |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 302 | for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; |
| 303 | ++I) { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 304 | DebugLoc IDL = I->getDebugLoc(); |
| 305 | if (IDL.isUnknown()) |
| 306 | continue; |
| 307 | if (LexicalScope *IScope = getOrCreateLexicalScope(IDL)) |
| 308 | if (Scope->dominates(IScope)) |
| 309 | return true; |
| 310 | } |
| 311 | return Result; |
| 312 | } |
| 313 | |
Eric Christopher | 6211e4b | 2013-11-20 00:54:19 +0000 | [diff] [blame^] | 314 | void LexicalScope::anchor() {} |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 315 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 316 | /// dump - Print data structures. |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 317 | void LexicalScope::dump(unsigned Indent) const { |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 318 | #ifndef NDEBUG |
| 319 | raw_ostream &err = dbgs(); |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 320 | err.indent(Indent); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 321 | err << "DFSIn: " << DFSIn << " DFSOut: " << DFSOut << "\n"; |
| 322 | const MDNode *N = Desc; |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 323 | err.indent(Indent); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 324 | N->dump(); |
| 325 | if (AbstractScope) |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 326 | err << std::string(Indent, ' ') << "Abstract Scope\n"; |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 327 | |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 328 | if (!Children.empty()) |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 329 | err << std::string(Indent + 2, ' ') << "Children ...\n"; |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 330 | for (unsigned i = 0, e = Children.size(); i != e; ++i) |
| 331 | if (Children[i] != this) |
Manman Ren | e498b25 | 2013-02-02 00:02:03 +0000 | [diff] [blame] | 332 | Children[i]->dump(Indent + 2); |
Devang Patel | e1649c3 | 2011-08-10 19:04:06 +0000 | [diff] [blame] | 333 | #endif |
| 334 | } |