[llvm] [clang-tools-extra] [clang] [XCOFF][obj2yaml] support parsing auxiliary symbols for XCOFF (PR #70642)
Kai Luo via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 6 21:39:35 PST 2023
================
@@ -282,45 +282,57 @@ static void auxSymMapping(IO &IO, XCOFFYAML::SectAuxEntForStat &AuxSym) {
void MappingTraits<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>>::mapping(
IO &IO, std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym) {
- assert(!IO.outputting() && "We don't dump aux symbols currently.");
+
+ auto ResetAuxSym = [&](auto *AuxEnt) {
+ if (!IO.outputting())
+ AuxSym.reset(AuxEnt);
----------------
bzEq wrote:
Might use a templated helper function to replace this lambda.
```c++
template<typename AuxEntT>
static void ResetAuxSym(IO &IO, std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym) {
if (!IO.outputting()) AuxSym.reset(new AuxEntT);
}
```
https://github.com/llvm/llvm-project/pull/70642
More information about the cfe-commits
mailing list