This is an archive of the discontinued LLVM Phabricator instance.

[BuildLibCalls] Use TLI to get 'int' and 'size_t' type sizes
ClosedPublic

Authored by bjope on Oct 3 2022, 1:56 AM.

Details

Summary

Stop assuming that an 'int' is 32 bits in helpers that emit libcalls
to lib functions that had 'int' in the signature. For most targets
this is NFC. For a target with 16 bit 'int' type this could help out
detecting if trying to emit a libcall with incorrect signature.

Similarly we now derive the type mapping to 'size_t' by asking TLI
about the size of 'size_t'. This should be NFC (at least for in-tree
targets) since getSizeTSize(), in TLI, is deriving the size in the
same way as DataLayout::getIntPtrType().

Diff Detail

Event Timeline

bjope created this revision.Oct 3 2022, 1:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 1:56 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
bjope requested review of this revision.Oct 3 2022, 1:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 1:56 AM
bjope added a reviewer: msebor.Oct 3 2022, 2:02 AM
bjope added a subscriber: Ka-Ka.
uabelho added a subscriber: uabelho.Oct 3 2022, 5:24 AM
nikic accepted this revision.Oct 4 2022, 3:04 AM
nikic added a subscriber: nikic.

LGTM

This revision is now accepted and ready to land.Oct 4 2022, 3:04 AM
This revision was landed with ongoing or failed builds.Oct 4 2022, 3:52 AM
This revision was automatically updated to reflect the committed changes.