This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Implement __builtin_strlen
ClosedPublic

Authored by tbaeder on Jul 22 2023, 10:45 PM.

Diff Detail

Event Timeline

tbaeder created this revision.Jul 22 2023, 10:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2023, 10:45 PM
tbaeder requested review of this revision.Jul 22 2023, 10:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2023, 10:45 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin added inline comments.Jul 23 2023, 1:17 AM
clang/lib/AST/Interp/InterpBuiltin.cpp
136–147

maybe a do while would be cleaner

149

Why not do that in this patch?

tbaeder updated this revision to Diff 543317.Jul 23 2023, 11:48 AM
tbaeder marked an inline comment as done.
tbaeder added inline comments.
clang/lib/AST/Interp/InterpBuiltin.cpp
149

I was trying to keep the patch small but here it is.

tbaeder updated this revision to Diff 543414.Jul 24 2023, 1:44 AM
tbaeder marked an inline comment as done.
cor3ntin accepted this revision.Jul 24 2023, 5:16 AM

LGTM, modulo suggestion

clang/lib/AST/Interp/InterpBuiltin.cpp
63–69

Maybe we could have

pushSignedInteger(InterpState &S, unsigned bit width, int64_t Val);
pushUnsignedInteger(InterpState &S, unsigned bit width, int64_t Val)

to simplify pushSizeT and pushInt

This revision is now accepted and ready to land.Jul 24 2023, 5:16 AM
This revision was landed with ongoing or failed builds.Aug 17 2023, 4:11 AM
This revision was automatically updated to reflect the committed changes.
vitalybuka reopened this revision.Aug 17 2023, 6:11 PM
This revision is now accepted and ready to land.Aug 17 2023, 6:11 PM
tbaeder closed this revision.Sep 5 2023, 4:12 AM

This has been pushed already.