[cfe-dev] A patch for integer promotions.

Enea Zaffanella zaffanella at cs.unipr.it
Sun Aug 16 04:44:33 PDT 2009


Enea Zaffanella wrote:
> Hello.
> 
> The attached program promotion_bug.c shows a bug in the current code 
> generating integer promotions: independently from the sizes of integer 
> types, all small integers are promoted to type `int'.

While at it, I would also like to ask for the reason(s) why a method such as

   QualType Sema::UsualArithmeticConversionsType(QualType, QualType);

belongs to Sema, whereas methods such as

   QualType ASTContext::mergeTypes(QualType, QualType);
   QualType ASTContext::mergeFunctionTypes(QualType, QualType);

belong to ASTContext.

As far as I can see, the former method looks very similar to the other 
two: it requires access to mostly the same info from the context and it 
does not need to directly access/change nodes in the AST or issue 
diagnostics.

If there are no objections, I would like to move the former method into 
ASTContext. This change, besides making things more consistent, would 
make the method easily accessible to clients (that was indeed the 
original motivation for my investigation).

If you agree, I can merge this with the patch previously sent.

Cheers,
Enea Zaffanella.




More information about the cfe-dev mailing list