[Lldb-commits] [PATCH] D59562: [SymbolFileDWARF] Introduce DWARFContext
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 20 13:15:41 PDT 2019
clayborg added inline comments.
================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp:24
+ // forward.
+ extractor.emplace();
+
----------------
clayborg wrote:
> Don't we want to put an empty DWARFDataExtractor in here? Maybe this code should be:
>
> ```
> const SectionList *section_list = module.GetSectionList();
> if (!section_list)
> return nullptr;
>
> auto section_sp = section_list->FindSectionByType(section_type, true);
> if (!section_sp)
> return nullptr;
>
> extractor.emplace();
> if (section_sp->GetSectionData(*extractor) == 0)
> extractor = llvm::None;
> return extractor.getPointer();
> ```
Or use a local DWARFDataExtractor and move it into "extractor" if we succeed?
```
DWARFDataExtractor data;
if (section_sp->GetSectionData(data) > 0)
extractor = std::move(data);
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59562/new/
https://reviews.llvm.org/D59562
More information about the lldb-commits
mailing list