OSDN Git Service

[LLDB][NFC] Adding clarifying comment in SymbolFileDWARFDebugMap::DumpClangAST(...)
authorshafik <syaghmour@apple.com>
Fri, 24 Jan 2020 21:54:25 +0000 (13:54 -0800)
committershafik <syaghmour@apple.com>
Fri, 24 Jan 2020 22:01:15 +0000 (14:01 -0800)
It is not obvious that the code was correct since it would seem as if we want to perform the dump for
each symbol file.

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

index 5b0f46a..add05d1 100644 (file)
@@ -1225,6 +1225,9 @@ CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace(
 void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) {
   ForEachSymbolFile([&s](SymbolFileDWARF *oso_dwarf) -> bool {
     oso_dwarf->DumpClangAST(s);
+    // The underlying assumption is that DumpClangAST(...) will obtain the
+    // AST from the underlying TypeSystem and therefore we only need to do
+    // this once and can stop after the first iteration hence we return true.
     return true;
   });
 }