This is an archive of the discontinued LLVM Phabricator instance.

[OpaquePtr][BitcodeWriter] Handle attributes with types
ClosedPublic

Authored by aeubanks on Jun 29 2021, 11:45 AM.

Details

Reviewers
nikic
Group Reviewers
Restricted Project
Commits
rGcb3580e7ad24: [OpaquePtr][BitcodeWriter] Handle attributes with types
Summary

For example, byval.

Skip the type attribute auto-upgrade if we already have the type.

I've actually seen this error of the ValueEnumerator missing a type
attribute's type in a non-opaque pointer context.

Diff Detail

Event Timeline

aeubanks created this revision.Jun 29 2021, 11:45 AM
aeubanks requested review of this revision.Jun 29 2021, 11:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2021, 11:45 AM
aeubanks updated this revision to Diff 355314.Jun 29 2021, 11:51 AM

use better check

aeubanks added a reviewer: Restricted Project.Jun 29 2021, 11:51 AM
nikic added a subscriber: nikic.Jun 29 2021, 11:51 AM
nikic added inline comments.
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
3337

Shouldn't this only check for a type for the given kind, rather than all attribute kinds? I guess it doesn't matter if all of these are mutually incompatible.

llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
1049

Shouldn't this be inside the Entry == 0 condition, as it's something we only need to do once, not each time the AttributeSet is seen?

aeubanks updated this revision to Diff 355362.Jun 29 2021, 2:09 PM

only enumerate type attributes once

nikic accepted this revision.Jun 29 2021, 2:30 PM

LGTM

This revision is now accepted and ready to land.Jun 29 2021, 2:30 PM
This revision was landed with ongoing or failed builds.Jun 29 2021, 2:48 PM
This revision was automatically updated to reflect the committed changes.