This is an archive of the discontinued LLVM Phabricator instance.

[AsmPrinter] Use the McASMInfo to determine if we need descriptors.
ClosedPublic

Authored by sfertile on Feb 14 2020, 8:35 AM.

Details

Summary

In https://reviews.llvm.org/rG8b737688c21a9755cae14cb9343930e0882164ab I switched the condition gating the creation of the descriptor symbol from
checking the MCAsmInfo if we need to support descriptors, to if the OS was AIX. Technically the 2 should be interchangeable: if we are
targeting AIX then we need to emit XCOFF object files, and the MCAsmInfo must return true for needing function descriptors.

This doesn't account for lit test with runsteps that only set the arch. Eg: test/CodeGen/XCore/section-name.ll
which when run natively on AIX we end up with a target xcore-ibm-aix and needFunctionDescriptors is false.

This patch reverts to using the MCAsmInfo and adds an assert that the target OS must be AIX since that is the only target using the descriptor hook.

Diff Detail

Event Timeline

sfertile created this revision.Feb 14 2020, 8:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2020, 8:35 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
sfertile edited the summary of this revision. (Show Details)Feb 14 2020, 8:35 AM
This revision is now accepted and ready to land.Feb 14 2020, 9:56 AM
This revision was automatically updated to reflect the committed changes.