This is an archive of the discontinued LLVM Phabricator instance.

[llvm-extract] Fix basic block extraction by delaying search until the function is materialized
ClosedPublic

Authored by ddcc on May 20 2020, 5:33 PM.

Details

Summary

When I try to extract a basic block using llvm-extract, it erroneously reports that the named basic block doesn't exist. After digging into the code, it appears to be iterating over an unmaterialized function, which will fail to match any basic blocks.

Diff Detail

Event Timeline

ddcc created this revision.May 20 2020, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2020, 5:33 PM
volkan accepted this revision.May 21 2020, 5:26 PM

LGTM.

llvm/tools/llvm-extract/llvm-extract.cpp
339

It would be nice to have a comment here to explain why we verify the blocks here.

This revision is now accepted and ready to land.May 21 2020, 5:26 PM
ddcc added a comment.May 21 2020, 6:12 PM

Sure, I will add some comments and push. Thanks!

This revision was automatically updated to reflect the committed changes.