This is an archive of the discontinued LLVM Phabricator instance.

[Opaqueptrs][IR Serialization] Improve inlineasm [de]serialization
ClosedPublic

Authored by lebedev.ri on Dec 28 2021, 12:53 PM.

Details

Summary

The bitcode reader expected that the pointers are typed,
so that it can extract the function type for the assembly
so bitc::CST_CODE_INLINEASM did not explicitly store said function type.

I'm not really sure how the upgrade path will look for existing bitcode,
but i think we can easily support opaque pointers going forward,
by simply storing the function type.

Diff Detail

Event Timeline

lebedev.ri created this revision.Dec 28 2021, 12:53 PM
lebedev.ri requested review of this revision.Dec 28 2021, 12:53 PM
nikic added inline comments.Dec 29 2021, 10:01 AM
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
2898

Shouldn't this be a dyn_cast<FunctionType>? We don't want to crash on invalid type.

lebedev.ri marked an inline comment as done.

Use dyn_cast_or_null<>()

nikic accepted this revision.Dec 30 2021, 2:11 AM

LGTM

This revision is now accepted and ready to land.Dec 30 2021, 2:11 AM

LGTM

Thank you for the review.

This revision was landed with ongoing or failed builds.Dec 30 2021, 2:59 AM
This revision was automatically updated to reflect the committed changes.