This is an archive of the discontinued LLVM Phabricator instance.

[LLVM][Casting.h] Add trivial self-cast
ClosedPublic

Authored by bzcheeseman on May 13 2022, 3:50 PM.

Details

Summary

Casting from a type to itself should always be possible. Make this simple for all users, and add tests to ensure we keep being able to do this. Ref: https://reviews.llvm.org/D125543

Diff Detail

Event Timeline

bzcheeseman created this revision.May 13 2022, 3:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 3:50 PM
bzcheeseman requested review of this revision.May 13 2022, 3:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 3:50 PM

The test failures look real here, can you take a look? Looks like this doesn't properly handle the non-const case.

The test failures look real here, can you take a look? Looks like this doesn't properly handle the non-const case.

Yeah agreed - I'll take a look when I get a chance.

bzcheeseman edited the summary of this revision. (Show Details)

Found a better way to do it (I think) that avoids yet another partial specialization of CastInfo to avoid future ambiguous partial specialization shenanigans.

rriddle accepted this revision.May 15 2022, 10:06 PM
This revision is now accepted and ready to land.May 15 2022, 10:06 PM
This revision was automatically updated to reflect the committed changes.