FYI, I think this commit is causing the following warning:<div><br></div><div><pre id="TargetResultLogContent" style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;color:rgb(0,0,0);line-height:18px">llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:3726:13: error: 'void PrintPool(llvm::raw_ostream&, clang::ento::SymbolRef, clang::ento::ProgramStateRef)' defined but not used [-Werror=unused-function]</pre>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 13, 2012 at 5:36 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: zaks<br>
Date: Mon Aug 13 19:36:17 2012<br>
New Revision: 161821<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=161821&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=161821&view=rev</a><br>
Log:<br>
[analyzer] Disable autorelease pool tracking.<br>
<br>
The autorelease pool has not been implemented completely: we were adding<br>
the autoreleased symbols to the state, but never looking at them. Until<br>
we have a complete implementation, remove the overhead and comment out<br>
the unused code.<br>
<br>
Modified:<br>
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=161821&r1=161820&r2=161821&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=161821&r1=161820&r2=161821&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Mon Aug 13 19:36:17 2012<br>
@@ -1638,6 +1638,10 @@<br>
//===----------------------------------------------------------------------===//<br>
// AutoreleaseBindings - State used to track objects in autorelease pools.<br>
//===----------------------------------------------------------------------===//<br>
+#define AUTORELEASE_POOL_MODELING (0)<br>
+// We do not currently have complete modeling of autorelease pools.<br>
+<br>
+#if AUTORELEASE_POOL_MODELING<br>
<br>
typedef llvm::ImmutableMap<SymbolRef, unsigned> ARCounts;<br>
typedef llvm::ImmutableMap<SymbolRef, ARCounts> ARPoolContents;<br>
@@ -1685,6 +1689,7 @@<br>
<br>
return state->set<AutoreleasePoolContents>(pool, newCnts);<br>
}<br>
+#endif<br>
<br>
//===----------------------------------------------------------------------===//<br>
// Error reporting.<br>
@@ -2427,7 +2432,9 @@<br>
mutable OwningPtr<RetainSummaryManager> Summaries;<br>
mutable OwningPtr<RetainSummaryManager> SummariesGC;<br>
<br>
+#if AUTORELEASE_POOL_MODELING<br>
mutable ARCounts::Factory ARCountFactory;<br>
+#endif<br>
<br>
mutable SummaryLogTy SummaryLog;<br>
mutable bool ShouldResetSummaryLog;<br>
@@ -3004,7 +3011,10 @@<br>
<br>
case NewAutoreleasePool:<br>
assert(!C.isObjCGCEnabled());<br>
- return state->add<AutoreleaseStack>(sym);<br>
+#if AUTORELEASE_POOL_MODELING<br>
+ state = state->add<AutoreleaseStack>(sym);<br>
+#endif<br>
+ return state;<br>
<br>
case MayEscape:<br>
if (V.getKind() == RefVal::Owned) {<br>
@@ -3022,7 +3032,11 @@<br>
return state;<br>
<br>
// Update the autorelease counts.<br>
+ // TODO: AutoreleasePoolContents are not currently used. We will need to<br>
+ // call SendAutorelease after it's wired up.<br>
+#if AUTORELEASE_POOL_MODELING<br>
state = SendAutorelease(state, ARCountFactory, sym);<br>
+#endif<br>
V = V.autorelease();<br>
break;<br>
<br>
@@ -3718,20 +3732,23 @@<br>
Out << "<pool>";<br>
Out << ":{";<br>
<br>
+#if AUTORELEASE_POOL_MODELING<br>
// Get the contents of the pool.<br>
if (const ARCounts *Cnts = State->get<AutoreleasePoolContents>(Sym))<br>
for (ARCounts::iterator I = Cnts->begin(), E = Cnts->end(); I != E; ++I)<br>
Out << '(' << I.getKey() << ',' << I.getData() << ')';<br>
-<br>
+#endif<br>
Out << '}';<br>
}<br>
<br>
+#if AUTORELEASE_POOL_MODELING<br>
static bool UsesAutorelease(ProgramStateRef state) {<br>
// A state uses autorelease if it allocated an autorelease pool or if it has<br>
// objects in the caller's autorelease pool.<br>
return !state->get<AutoreleaseStack>().isEmpty() ||<br>
state->get<AutoreleasePoolContents>(SymbolRef());<br>
}<br>
+#endif<br>
<br>
void RetainCountChecker::printState(raw_ostream &Out, ProgramStateRef State,<br>
const char *NL, const char *Sep) const {<br>
@@ -3747,6 +3764,7 @@<br>
Out << NL;<br>
}<br>
<br>
+#if AUTORELEASE_POOL_MODELING<br>
// Print the autorelease stack.<br>
if (UsesAutorelease(State)) {<br>
Out << Sep << NL << "AR pool stack:";<br>
@@ -3758,6 +3776,7 @@<br>
<br>
Out << NL;<br>
}<br>
+#endif<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>