<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 4, 2015 at 5:35 AM, Michael Kuperstein <span dir="ltr"><<a href="mailto:michael.m.kuperstein@intel.com" target="_blank">michael.m.kuperstein@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mkuper<br>
Date: Sun Jan 4 07:35:44 2015<br>
New Revision: 225133<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=225133&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=225133&view=rev</a><br>
Log:<br>
Fix unused variable warning for non-asserts builds. NFC.<br>
<br>
Modified:<br>
llvm/trunk/lib/Analysis/ValueTracking.cpp<br>
<br>
Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=225133&r1=225132&r2=225133&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=225133&r1=225132&r2=225133&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Sun Jan 4 07:35:44 2015<br>
@@ -485,12 +485,12 @@ static void computeKnownBitsFromAssume(V<br>
<br>
unsigned BitWidth = KnownZero.getBitWidth();<br>
<br>
- Function *F = const_cast<Function*>(Q.CxtI->getParent()->getParent());<br>
for (auto &AssumeVH : Q.AC->assumptions()) {<br>
if (!AssumeVH)<br>
continue;<br>
CallInst *I = cast<CallInst>(AssumeVH);<br>
- assert(I->getParent()->getParent() == F &&<br>
+ assert((I->getParent()->getParent() ==<br>
+ const_cast<Function*>(Q.CxtI->getParent()->getParent()))</blockquote><div><br></div><div>Is that const_cast necessary? You should be able to compare const T* and T* just fine without casting away constness...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> &&<br>
"Got assumption for the wrong function!");<br>
if (Q.ExclInvs.count(I))<br>
continue;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>