This is an archive of the discontinued LLVM Phabricator instance.

[flang] Runtime: implement INDEX intrinsic function
ClosedPublic

Authored by klausler on Mar 12 2021, 1:49 PM.

Details

Summary

Implement INDEX in the runtime, reusing some infrastructure
(with generalization and renaming as needed) put into place
for its cousins SCAN and VERIFY.

I did not implement full Boyer-Moore substring searching
for the forward case, but did accelerate some advancement on
mismatches.

I (re)implemented unit testing for INDEX in the new gtest
framework, combining it with the tests that have recently
been ported to gtest for SCAN and VERIFY.

Diff Detail

Event Timeline

klausler created this revision.Mar 12 2021, 1:49 PM
klausler requested review of this revision.Mar 12 2021, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2021, 1:49 PM

LGTM

flang/unittests/RuntimeGTest/CharacterTest.cpp
191–195

This approach is far more concise and readable IMO. I'm impressed it's generic enough to work for all three SUT functions for all char types!

This revision is now accepted and ready to land.Mar 15 2021, 1:16 AM
This revision was landed with ongoing or failed builds.Mar 15 2021, 2:19 PM
This revision was automatically updated to reflect the committed changes.