This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Require use of Address::invalid() for invalid address
ClosedPublic

Authored by nikic on Dec 13 2021, 5:50 AM.

Details

Summary

This no longer allows creating an invalid Address through the regular constructor. There were only two places that did this (AggValueSlot and EHCleanupScope) which did this by converting a potential nullptr into an Address. I've fixed both of these by directly storing an Address.

I'm going through a private nullptr_t constructor here, maybe there some kind of nicer pattern that I'm not aware of?

This is intended as a bit of preliminary cleanup for D103465.

Diff Detail

Event Timeline

nikic requested review of this revision.Dec 13 2021, 5:50 AM
nikic created this revision.
aeubanks accepted this revision.Dec 13 2021, 10:09 AM
This revision is now accepted and ready to land.Dec 13 2021, 10:09 AM
This revision was landed with ongoing or failed builds.Dec 14 2021, 3:06 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2021, 3:06 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yubing added a subscriber: yubing.Dec 14 2021, 4:27 AM
yubing added inline comments.
clang/lib/CodeGen/Address.h
79

Has anyone encountered buildfail due to missing "std" before nullptr_t?

nikic added inline comments.Dec 14 2021, 5:05 AM
clang/lib/CodeGen/Address.h
79

Yeah, this broke a lot of buildbots and should be fixed by https://github.com/llvm/llvm-project/commit/b81450afb6529cd4d1eece46e9945caa5de51c11. Please tell me if you still see a build failure.