[llvm] [LLVM[NFC] Refactor to allow debug_names entries to conatain DIE offset (PR #69399)
Alexander Yermolovich via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 15:15:34 PDT 2023
================
@@ -252,20 +252,27 @@ class DWARF5AccelTableData : public AccelTableData {
public:
static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
- DWARF5AccelTableData(const DIE &Die) : Die(Die) {}
+ DWARF5AccelTableData(const DIE &Die, const DwarfCompileUnit &CU);
#ifndef NDEBUG
void print(raw_ostream &OS) const override;
#endif
- const DIE &getDie() const { return Die; }
- uint64_t getDieOffset() const { return Die.getOffset(); }
- unsigned getDieTag() const { return Die.getTag(); }
+ uint64_t getDieOffset() const {
+ if (const DIE *const *TDie = std::get_if<const DIE *>(&OffsetVal))
+ return (*TDie)->getOffset();
+ return std::get<uint64_t>(OffsetVal);
----------------
ayermolo wrote:
I was thinking about assert, but there are release builds that have asserts turned off.... So will result in "weird" crash.
Also getDieOffset is used in order() from ccelTableBase::finalize which is invoked before normalization happens.
One of the unit tests was failing because of it.
https://github.com/llvm/llvm-project/pull/69399
More information about the llvm-commits
mailing list