PR16752[PATCH]: 'mode' attribute for unusual targets doesn't work properly.

Stepan Dyatkovskiy stpworld at narod.ru
Fri Aug 2 07:35:29 PDT 2013


Hello everyone,
there are patches for PR16752.
Bug desciption (from bugzilla):
Troubles could be happened due to some assumptions in handleModeAttr 
function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 
16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' 
it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth 
virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.

1st patch extends TargetInfo::IntType (char types) and 
TargetInfo::RealType (NoFloat type).
2nd patch extends TargetInfo with getIntTypeByWidth and 
getRealTypeByWidth, it also fixes handleAttrMode function.
Patches are presented in GIT format and second patch should be applied 
after first one.

-Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-ModeAttr-2013-08-02-git-fix.patch
Type: text/x-diff
Size: 7463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130802/5055588a/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-ModeAttr-2013-08-02-git-types.patch
Type: text/x-diff
Size: 4161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130802/5055588a/attachment-0001.patch>


More information about the cfe-commits mailing list