This is an archive of the discontinued LLVM Phabricator instance.

[IR] Remove forward declaration of GraphTraits from Type.h
ClosedPublic

Authored by foad on Jun 11 2021, 7:25 AM.

Details

Summary

This has been unnecessary since r352353 removed GraphTraits
specializations for Type, except that a couple of other headers were
accidentally relying on this declaration.

Diff Detail

Event Timeline

foad created this revision.Jun 11 2021, 7:25 AM
foad requested review of this revision.Jun 11 2021, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2021, 7:25 AM
dblaikie accepted this revision.Jun 14 2021, 6:52 PM
dblaikie added a subscriber: dblaikie.

Sounds OK - though might be worth considering #including "GraphTraits.h" rather than the forward declaration - makes maintenance a bit easier later on, if default template arguments were added to GraphTraits or other changes are made.

This revision is now accepted and ready to land.Jun 14 2021, 6:52 PM
This revision was automatically updated to reflect the committed changes.
foad added a comment.Jun 15 2021, 1:25 AM

though might be worth considering #including "GraphTraits.h" rather than the forward declaration - makes maintenance a bit easier later on, if default template arguments were added to GraphTraits or other changes are made.

I considered and rejected it. I think the LLVM project as a whole prefers forward declarations to #includes, for the sake of build time.