This is an archive of the discontinued LLVM Phabricator instance.

[BuildLibCalls] Name types to identify when 'int' and 'size_t' is assumed. NFC
ClosedPublic

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

Details

Summary

Lots of BuildLibCalls helpers are using Builder::getInt32Ty to get
a type matching an 'int', and DataLayout::getIntPtrType to get a
type matching 'size_t'. The former is not true for all targets, since
and 'int' isn't always 32 bits. And the latter is a bit weird as well
as the definition of DataLayout::getIntPtrType isn't clearly mapping
it to 'size_t'.

This patch is not aiming at solving any such problems. It is merely
highlighting when a libcall is expecting to use 'int' and 'size_t'
by naming the types as IntTy and SizeTTy when preparing the type
signatures for the emitted libcalls.

Diff Detail

Event Timeline

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

LGTM

This revision is now accepted and ready to land.Oct 4 2022, 3:02 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.