[llvm-nm] - Move MachO specific logic out from the dumpSymbolNamesFromObject(). NFC.
`dumpSymbolNamesFromObject` is the method that dumps symbol names. It has 563 lines, mostly because of huge piece of MachO specific code. In this patch I move it to separate helper method. The new size of `dumpSymbolNamesFromObject` is 93 lines. With it it becomes much easier to maintain it. I had to change the type of 2 name fields to `std::string`, because MachO logic uses temporarily buffer strings (e.g `ExportsNameBuffer`, `BindsNameBuffer` etc): ``` std::string ExportsNameBuffer; raw_string_ostream EOS(ExportsNameBuffer); ``` these buffers were moved to `dumpSymbolsFromDLInfoMachO` by this patch and invalidated after return. Technically, before this patch we had a situation when local pointers (symbol names) were assigned to members of global static `SymbolList`, what is dirty by itself. Differential revision: https://reviews.llvm.org/D94667
Loading
Please register or sign in to comment