This introduces the overload for reportUniqueWarning which allows
to avoid using createError in many places.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
There are still many places where it is used.
E.g.:
std::string SymbolName; if (Expected<StringRef> NameOrErr = Symbol.getName(*StrTable)) { SymbolName = maybeDemangle(*NameOrErr); } else { reportUniqueWarning(NameOrErr.takeError()); return "<?>"; } if (SymbolName.empty() && Symbol.getType() == ELF::STT_SECTION) { Expected<unsigned> SectionIndex = getSymbolSectionIndex(Symbol, SymIndex); if (!SectionIndex) { reportUniqueWarning(SectionIndex.takeError()); return "<?>"; } Expected<StringRef> NameOrErr = getSymbolSectionName(Symbol, *SectionIndex); if (!NameOrErr) { reportUniqueWarning(NameOrErr.takeError()); return ("<section " + Twine(*SectionIndex) + ">").str(); } return std::string(*NameOrErr); }
We might use toString() for such places or rewrite them to provide more context probably.