<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 4:03 PM, Will Dietz <span dir="ltr"><<a href="mailto:wdietz2@illinois.edu" target="_blank">wdietz2@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: wdietz2<br>
Date: Wed May 27 18:03:18 2015<br>
New Revision: 238377<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238377-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=OlZqWz9QOipruxBw-pIBsdYBi-65rPmsTQWGYfKNx4g&s=Ae7nhAF8Th-vmBJRZ0uMURTxHkosuziFGJdqOs98q-Q&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238377&view=rev</a><br>
Log:<br>
CallTargets: Sort and unique callee lists by function name.<br>
<br>
Modified:<br>
poolalloc/trunk/lib/DSA/CallTargets.cpp<br>
<br>
Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_poolalloc_trunk_lib_DSA_CallTargets.cpp-3Frev-3D238377-26r1-3D238376-26r2-3D238377-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=OlZqWz9QOipruxBw-pIBsdYBi-65rPmsTQWGYfKNx4g&s=Pc-ljWhzK3Xs8UYKZqOPNFFZa0Wve4ve7fF1e0HnCyQ&e=" target="_blank">http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=238377&r1=238376&r2=238377&view=diff</a><br>
==============================================================================<br>
--- poolalloc/trunk/lib/DSA/CallTargets.cpp (original)<br>
+++ poolalloc/trunk/lib/DSA/CallTargets.cpp Wed May 27 18:03:18 2015<br>
@@ -162,6 +162,17 @@ void CallTargetFinder<dsa>::print(llvm::<br>
template<class dsa><br>
bool CallTargetFinder<dsa>::runOnModule(Module &M) {<br>
findIndTargets(M);<br>
+<br>
+ // Sort callees alphabetically, remove duplicates<br>
+ for(auto &i: IndMap) {<br>
+ auto &callees = i.second;<br>
+ std::sort(callees.begin(), callees.end(),<br>
+ [](const Function *a, const Function *b) {<br>
+ return a->getName() < b->getName();<br>
+ });<br>
+ std::unique(callees.begin(), callees.end());<br></blockquote><div><br>You probably want to call erase(unique(...), end) - otehrwise the duplicates will still be present, just hiding in the tail of the sequence.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ }<br>
+<br>
return false;<br>
}<br>
<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>