<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 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.gwt-inlinehtml
        {mso-style-name:gwt-inlinehtml;}
span.gwt-hyperlink1
        {mso-style-name:gwt-hyperlink1;
        color:#0084EA;
        text-decoration:none none;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:SimSun;}
span.svid
        {mso-style-name:sv_id;}
span.svidknown1
        {mso-style-name:sv_id_known1;
        color:blue;}
span.svnumber1
        {mso-style-name:sv_number1;
        color:blue;}
span.svidknown2
        {mso-style-name:sv_id_known2;
        color:blue;}
span.svkeyword1
        {mso-style-name:sv_keyword1;
        color:navy;
        font-weight:bold;}
span.svcomment1
        {mso-style-name:sv_comment1;
        color:gray;}
span.svidknown3
        {mso-style-name:sv_id_known3;
        color:blue;}
span.svidknown4
        {mso-style-name:sv_id_known4;
        color:blue;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
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="ZH-CN" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi Chandler,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I scanned the LLVM source code, and found some potential code issues, take the piece of code in file ‘./include/llvm/Support/Allocator.h’ for example:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">80<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> 
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">///</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">\brief</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">Deallocate</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">space</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">for</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">a</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">sequence</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">of</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">objects</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">without</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">constructing</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:gray">them.</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">81<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> 
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">template</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> <</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">typename</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
 T><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">82<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> 
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">typename</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">std</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">::enable_if<<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">83<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">      !</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">std</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">::is_same<</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">typename</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">std</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">::remove_cv<T>::</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">type</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">,
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">void</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">>::</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">value</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">,
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">void</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">>::</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">type</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">84<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#111111"><img width="11" height="15" id="Picture_x0020_6" src="cid:image005.png@01D1AB8E.674ADC00" alt="https://otckw.jf.intel.com:8080/review/review/images/folding/collapse_top.png"></span><span lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#111111"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">  Deallocate(T *Ptr,
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">size_t</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> Num =
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">1</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">) {<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">85<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">   
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:blue">Deallocate</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">(</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">static_cast</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"><</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">const</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">void</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111"> *>(Ptr), Num *
</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">sizeof</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">(T));<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="50" valign="top" style="width:30.0pt;border:none;border-right:solid lightgrey 1.0pt;padding:0cm 3.75pt 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#555555">86<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#111111"><img width="11" height="15" id="Picture_x0020_5" src="cid:image006.png@01D1AB8E.674ADC00" alt="https://otckw.jf.intel.com:8080/review/review/images/folding/collapse_bottom.png"></span><span lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#111111"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="margin-left:6.0pt;text-align:left"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#111111">  }<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">If the typename T is void, the std::is_same will be FALSE, which means the std::enable_if::type is UNDEFIED.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So do you think it need a fix?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span class="gwt-inlinehtml"><span lang="EN-US" style="font-size:8.5pt;font-family:"Helvetica",sans-serif;color:#111111"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Verdana",sans-serif;color:#44546A">Luo
</span><span lang="EN-US" style="font-family:"Verdana",sans-serif;color:#1F497D">Xionghu</span><span lang="EN-US" style="font-family:"Verdana",sans-serif;color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Verdana",sans-serif;color:#44546A">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>