This check is only meaningful for COFF and it is perfectly valid to create
such a GlobalValue in ELF.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 36162 Build 36161: arc lint + arc unit
Event Timeline
I haven't had time to really think about this, but I believe @majnemer felt it was important to add verifier checks like these. There's no reason we can't make this triple dependent, right? If there's no triple on the module, we can skip the check.
Making it conditional on the triple is fine with me I suppose. It's unfortunate that we use the same IR for ELF and COFF here, maybe longer term we should move towards exclusively using !associated in COFF.
In the past, Rafael advocated for having more verifier check more things that are unrepresentable at an object file level. That's how we ended up with most of the checks in Verifier::visitGlobalAlias. I think this is consistent with that, even if we have to check which object file invariant we're enforcing.
lgtm