This is an archive of the discontinued LLVM Phabricator instance.

De-templatify EmitCallArgs argument type checking, NFCI
ClosedPublic

Authored by rnk on Dec 8 2020, 1:55 PM.

Details

Summary

This template exists to abstract over FunctionPrototype and
ObjCMethodDecl, which have similar APIs for storing parameter types. In
place of a template, use a PointerUnion with two cases to handle this.
Hopefully this improves readability, since the type of the prototype is
easier to discover. This allows me to sink this code, which is mostly
assertions, out of the header file and into the cpp file. I can also
simplify the overloaded methods for computing isGenericMethod, and get
rid of the second EmitCallArgs overload.

Diff Detail

Event Timeline

rnk requested review of this revision.Dec 8 2020, 1:55 PM
rnk created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2020, 1:55 PM
compnerd accepted this revision.Dec 8 2020, 2:14 PM
compnerd added inline comments.
clang/lib/CodeGen/CGCall.cpp
3824

This doesn't entirely match the style, but it is a shuffle after all. Id say that DC, and using if (const auto *CD = due to the dyn_cast would be nice, but that isn't important.

This revision is now accepted and ready to land.Dec 8 2020, 2:14 PM
rnk updated this revision to Diff 310569.Dec 9 2020, 9:41 AM
  • use assign instead of push_back
This revision was landed with ongoing or failed builds.Dec 9 2020, 11:12 AM
This revision was automatically updated to reflect the committed changes.