[llvm] [BOLT][DWARF] Add support for .debug_names (PR #81062)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 17:48:40 PST 2024


================
@@ -378,11 +377,13 @@ getUnitForOffset(DIEBuilder &Builder, DWARFContext &DWCtx,
   return nullptr;
 }
 
-uint32_t DIEBuilder::computeDIEOffset(const DWARFUnit &CU, DIE &Die,
+uint32_t DIEBuilder::computeDIEOffset(DWARFUnit &CU, DIE &Die,
----------------
ayermolo wrote:

Issue is 

```
 const std::optional<StrOffsetsContributionDescriptor> &
  getStringOffsetsTableContribution() {
    extractDIEsIfNeeded(true /*CUDIeOnly*/);
    return StringOffsetsTableContribution;
  }
```
It parses debug information and sets StringOffsetsTableContribution first time it's called.

I can add 

```
  const std::optional<StrOffsetsContributionDescriptor> &
  getStringOffsetsTableContribution() const {
    assert(StringOffsetsTableContribution);
    return StringOffsetsTableContribution;
  } 
```

But then implementation will rely on extractDIEsIfNeeded being invoked for this cu at some point. Probably will, but this seems flaky to me.

https://github.com/llvm/llvm-project/pull/81062


More information about the llvm-commits mailing list