This is an archive of the discontinued LLVM Phabricator instance.

BuildLibCalls: also set allocsize() attributes
ClosedPublic

Authored by durin42 on Feb 11 2022, 1:13 PM.

Details

Summary

This is part of being able to get rid of two more columns in
MemoryBuiltins.cpp's large table. We'll have two more changes before
we can finish the job.

Diff Detail

Event Timeline

durin42 created this revision.Feb 11 2022, 1:13 PM
durin42 requested review of this revision.Feb 11 2022, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2022, 1:13 PM
durin42 updated this revision to Diff 408100.Feb 11 2022, 4:15 PM
durin42 edited the summary of this revision. (Show Details)
durin42 updated this revision to Diff 408119.Feb 11 2022, 5:08 PM
durin42 updated this revision to Diff 410061.Feb 18 2022, 7:34 PM
durin42 updated this revision to Diff 410562.Feb 22 2022, 9:02 AM
durin42 updated this revision to Diff 410899.Feb 23 2022, 11:58 AM
durin42 updated this revision to Diff 415233.Mar 14 2022, 2:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 2:26 PM
nikic requested changes to this revision.Apr 6 2022, 2:18 AM
nikic added a subscriber: nikic.
nikic added inline comments.
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
234

Remove braces for single-line if.

375

This is incorrect: allocsize is a lower bound on the allocation size, while the strndup argument is an upper bound. strndup may allocate less if it encounters a null byte earlier.

This revision now requires changes to proceed.Apr 6 2022, 2:18 AM
durin42 requested review of this revision.Apr 6 2022, 7:41 AM
durin42 updated this revision to Diff 420849.
durin42 updated this revision to Diff 420910.Apr 6 2022, 9:10 AM
durin42 marked 2 inline comments as done.

good catch on strndup, fixed

nikic added a comment.Apr 7 2022, 2:38 AM

I'm missing the test update for calloc here.

durin42 updated this revision to Diff 421203.Apr 7 2022, 7:36 AM

I'm missing the test update for calloc here.

Whoops, fixed.

nikic accepted this revision.Apr 7 2022, 7:56 AM

LGTM

This revision is now accepted and ready to land.Apr 7 2022, 7:56 AM
This revision was landed with ongoing or failed builds.Apr 7 2022, 9:39 AM
This revision was automatically updated to reflect the committed changes.