This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Fix pipe type printing in arg info metadata
ClosedPublic

Authored by Anastasia on Feb 5 2021, 9:20 AM.

Details

Summary

Pipe element type spelling for arg info metadata should follow the same behavior as normal type spelling. We should not return the canonical type.

This patch also removed type handling duplication.

Diff Detail

Event Timeline

Anastasia created this revision.Feb 5 2021, 9:20 AM
Anastasia requested review of this revision.Feb 5 2021, 9:20 AM
stuart added a subscriber: stuart.Feb 5 2021, 11:18 AM

This looks like a really good cleanup, in addition to fixing the metadata for pipes.

Minor nit: "matadata" -> "metadata" in the description, and there's a StringRef construction that could be sunk.

clang/lib/CodeGen/CodeGenModule.cpp
1496–1507

This seems far cleaner than the code it replaces!

1499

Would it be better to sink this into the if (Ty.isCanonical()) block?

mantognini accepted this revision.Feb 8 2021, 1:44 AM

Nice refactoring & fix! LGTM. I suppose Stuart's comment about moving typeNameRef can be addressed when pushing.

This revision is now accepted and ready to land.Feb 8 2021, 1:44 AM
Anastasia edited the summary of this revision. (Show Details)Feb 8 2021, 3:28 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2021, 8:05 AM