This is an archive of the discontinued LLVM Phabricator instance.

Add emitWcsLen helper function
AcceptedPublic

Authored by anjankgk on Apr 14 2021, 11:16 AM.

Details

Summary

Add implementations for generic function of emitWcsLen on the similar lines to the existing helper functions of different types.

Diff Detail

Event Timeline

anjankgk requested review of this revision.Apr 14 2021, 11:16 AM
anjankgk created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2021, 11:16 AM
lebedev.ri added inline comments.
llvm/include/llvm/IR/IRBuilder.h
565 ↗(On Diff #337493)

These two don't carry their weight.
In LLVM IR, pointer types are going away soon.

anjankgk added inline comments.Apr 14 2021, 12:12 PM
llvm/include/llvm/IR/IRBuilder.h
565 ↗(On Diff #337493)

Is there another substitute type for the PointerType if this is going to be removed?

lebedev.ri added inline comments.Apr 14 2021, 12:17 PM
llvm/include/llvm/IR/IRBuilder.h
565 ↗(On Diff #337493)

I meant, the pointers will loose their pointee type.
I suggest to simply inline this into the only callee.

anjankgk marked an inline comment as done.Apr 15 2021, 7:05 AM
anjankgk updated this revision to Diff 337756.Apr 15 2021, 7:13 AM
anjankgk retitled this revision from Add emitWcsLen and getInt[16|32]PtrTy helper functions to Add emitWcsLen helper function.
anjankgk edited the summary of this revision. (Show Details)
Whitney added inline comments.Apr 15 2021, 12:11 PM
llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
53

Ptr is required to be wchar pointer type

can we assert that?

anjankgk updated this revision to Diff 338511.Apr 19 2021, 7:06 AM
anjankgk marked an inline comment as done.

Add an assert to check the pointer param

Where do you plan to use this new helper?

Where do you plan to use this new helper?

I have a patch (D88460) that replaces strlen idiom (for i8s), but shortly after I want to add another patch for generic type (i16/i32/wchar), this will be reqd there.

gentle ping for a review request..
Thanks!

xbolva00 accepted this revision.May 3 2021, 7:54 AM

Please commit this one when second patch is accepted

This revision is now accepted and ready to land.May 3 2021, 7:54 AM
lebedev.ri resigned from this revision.Jan 12 2023, 5:42 PM

This review seems to be stuck/dead, consider abandoning if no longer relevant.

Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 5:42 PM
Herald added a subscriber: StephenFan. · View Herald Transcript