[cfe-dev] Handling ignored calling conventions

John McCall rjmccall at apple.com
Tue Sep 25 00:47:37 PDT 2012


On Sep 14, 2012, at 2:11 PM, Aaron Ballman wrote:
> Here's the latest iteration of the patch; this time it pushes decision
> making down into the TargetInfo subclasses to decide whether a given
> calling convention is acceptable, and what the default calling
> convention should be.
> 
> This patch also updates a lot of the test cases and clarifies the
> target architecture for some of them (to ensure we're getting correct
> test coverage).

Sorry for the delay.  A couple points.

First, making Basic depend on an AST header isn't okay;  you need
to pull the enum into Basic, probably into Specifiers.h.

Second, the caps convention for method names isLikeThis. It's not
universally followed in clang because we don't like massive restyling
commits, but please don't introduce more counter-convention names.

Third, the boolean value for AcceptsCallConv is backwards.
That's okay given that you want to extend AcceptsCallConv later,
but it suggests that you shouldn't name your method like a
predicate, because I would totally be tempted to do something like:
  if (Target.acceptsCallingConv(...)) {

Fourth, the default for a target should not be to accept all CCs.
It's okay to expect targets to implement this function if they want
to support variant CCs.

Finally, I claim that CC_C should be accepted by all targets.

John.



More information about the cfe-dev mailing list