Page MenuHomePhabricator

[llvm] Improve the performance of getSymbols used by ArchiveWriter
ClosedPublic

Authored by alexander-shaposhnikov on Sep 6 2018, 4:51 PM.

Details

Summary

In this diff we adjust the code of getSymbols to avoid creating LLVMContext when it's not necessary.
Without this patch when the function getSymbols was called on a MachO object with a __bitcode section
it was parsing the embedded bitcode and then ignoring the result.

Test plan: make check-all (on both OSX and Linux)

Diff Detail

Repository
rL LLVM

Event Timeline

alexander-shaposhnikov changed the visibility from "Public (No Login Required)" to "All Users".
abdulras accepted this revision.Sep 6 2018, 5:01 PM
abdulras added a subscriber: abdulras.
abdulras added inline comments.
lib/Object/ArchiveWriter.cpp
376 ↗(On Diff #164317)

Can't this be sunk into the condition on L378? That will avoid the unnecessary construction.

This revision is now accepted and ready to land.Sep 6 2018, 5:01 PM

update the comment

This revision was automatically updated to reflect the committed changes.
Lekensteyn changed the visibility from "All Users" to "Public (No Login Required)".Dec 18 2018, 3:27 PM