<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
Hi all,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
I have some confusion about LoopUnrolling.cpp.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
For the code given below, the loop does not unroll because the counter is unsigned. I read the code of LoopUnrolling.cpp and I think the relevant function is `forLoopMatcher()`, see <a href="https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Core/LoopUnrolling.cpp#L152" id="LPlnk517032">https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Core/LoopUnrolling.cpp#L152</a>.</div>
<div id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2xsdm0tbWlycm9yL2NsYW5nL2Jsb2IvbWFzdGVyL2xpYi9TdGF0aWNBbmFseXplci9Db3JlL0xvb3BVbnJvbGxpbmcuY3BwI0wxNTI." class="LPBorder168579" contenteditable="false" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer168579" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer168579" style="position: relative; margin-right: 12px; height: 160px; overflow: hidden;">
<a target="_blank" id="LPImageAnchor168579" href="https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Core/LoopUnrolling.cpp#L152"><img data-imagetype="External" id="LPThumbnailImageId168579" alt="" width="160" style="display: block;" height="160" src="https://avatars2.githubusercontent.com/u/1386314?s=400&v=4"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle168579" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor168579" href="https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Core/LoopUnrolling.cpp#L152" style="text-decoration: none; color: rgb(0, 75, 139);">llvm-mirror/clang</a></div>
<div id="LPDescription168579" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Mirror of official clang git repository located at http://llvm.org/git/clang. Updated every five minutes.</div>
<div id="LPMetadata168579" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
github.com</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
```</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
<div>int func() {</div>
<div>  int sum = 0;</div>
<div>  unsigned i;</div>
<div>  for (i = 0; i < 10; ++i) {</div>
<div>    sum++;</div>
<div>  }</div>
<div>  return sum;</div>
<div>}</div>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
```</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
1.I want to known if loop-unrolling only considers the counter of type signed? </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">2.Since the `IntegerLiteral` is of signed type,  when matching
 `IntegerLiteral`, does it need to add `ignoringParenImpCasts` to match the unsigned counter?</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="signature">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Henry Wong</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Qihoo 360 Codesafe Team</div>
</div>
</body>
</html>