This is an archive of the discontinued LLVM Phabricator instance.

TargetExtType: guard against the case that there is no layout type
AbandonedPublic

Authored by nhaehnle on May 11 2023, 7:34 AM.

Details

Summary

This is hit by the verifier when looking at call arguments / return
type. There is a test in a subsequent commit.

Diff Detail

Event Timeline

nhaehnle created this revision.May 11 2023, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 7:34 AM
nhaehnle requested review of this revision.May 11 2023, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 7:34 AM
nikic added a comment.May 16 2023, 7:13 AM

Hm, is this supposed to be allowed? I thought we'd always have a layout type -- an unsized one if nothing else?

There's nothing right now that would prevent this. Though we could default the layout type to something other than nullptr, if that is preferred. Maybe void?

nikic added a comment.May 16 2023, 8:10 AM

There's nothing right now that would prevent this. Though we could default the layout type to something other than nullptr, if that is preferred. Maybe void?

Isn't this already the default? https://github.com/llvm/llvm-project/blob/788e6ff4e5e6414c6707e91e95829f1d7c76b1aa/llvm/lib/IR/Type.cpp#L876

nhaehnle abandoned this revision.May 16 2023, 8:44 AM

Ah, my bad. I was working with local changes for so long that I hadn't noticed this got lost somehow. Sorry about that. I will follow-up with an adjustment to my later typeinfo diff.