<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;background:white">There are two 64-bit bitmasks maintained in </span><a href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393846" title="Open AttributeImpl.h"><span style="background:white">AttributeImpl.h</span></a><span style="color:black;background:white">:</span><span style="color:black"><br>
<br>
<span style="background:white">- AvailableFunctionAttrs is part of the AttributeListImpl class, and</span><br>
<span style="background:white">- AvailableAttrs is part of the AttributeSetNode class</span><br>
<br>
<span style="background:white">Both of these assume that the number of available enum attributes is limited to 64. In fact, a static_assert in </span></span><a href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393848" title="Open Attributes.cpp"><span style="background:white">Attributes.cpp</span></a><span style="color:black;background:white"> enforces
that the number of enum attributes stays at 64 or below. However, the bitcode writer and reader don't communicate enum attributes via bitmask anymore. Enum attributes are encoded in attribute groups.</span><span style="color:black"><br>
<br>
<span style="background:white">The AvailableFunctionAttrs and AvailableAttrs bitmasks are leftovers that need to be updated to remove the limitation on the number of enum attributes that can be defined in the Attribute::AttrKind enum.</span><br>
<br>
<span style="background:white">Per a suggestion that I received a while ago from Reid Kleckner (on the llvm-dev list), I propose to implement both of these data members as std::bitset objects.</span><br>
<br>
<span style="background:white">Here are the details for this proposed change:</span><br>
<br>
<span style="background:white">llvm/lib/IR/</span></span><a href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393846" title="Open AttributeImpl.h"><span style="background:white">AttributeImpl.h</span></a><span style="color:black;background:white">:</span><span style="color:black"><br>
<span style="background:white">- Define AvailableAttrs and AvailableFunctionAttrs with type std::bitset<AttributeEndAttrKinds> instead of uint64_t</span><br>
<span style="background:white">- Update AttributeSetNode::hasAttribute() to use the std::bitset test function on AvailableAttrs to check if an enum attribute is present</span><br>
<span style="background:white">- Update AttributeListImpl::hasFnAttribute() to use the std::bitset test function on AvailableFunctionAttrs to check if an enum attribute is present</span><br>
<br>
<span style="background:white">llvm/lib/IR/</span></span><a href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393848" title="Open Attributes.cpp"><span style="background:white">Attributes.cpp</span></a><span style="color:black;background:white">:</span><span style="color:black"><br>
<span style="background:white">- Update AttributeSetNode::AttributeSetNode() constructor to use the std::bitset's set function to initialize AvailableAttrs</span><br>
<span style="background:white">- Update AttributeListImpl::AttributeListImpl() constructor to use the std::bitset's set function to initialize AvailableFunctionAttrs and remove the static_assert that enforces an upper limit of 64 on the number of enum attributes
allowed</span></span><o:p></o:p></p>
</div>
</body>
</html>