Make the analyzer site a single point of reference for info
on controlling diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158581 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/www/analyzer/faq.html b/www/analyzer/faq.html
index 3633e8e..5c132b5 100644
--- a/www/analyzer/faq.html
+++ b/www/analyzer/faq.html
@@ -28,6 +28,7 @@
null?</a></li>
<li><a href="#use_assert">The analyzer assumes that a loop body is never entered. How can I tell it that the loop body will be entered at least once?</a></li>
<li><a href="#suppress_issue">How can I suppress a specific analyzer warning?</a></li>
+ <li><a href="#exclude_code">How can I selectively exclude code the analyzer examines?</a></li>
</ol>
@@ -87,9 +88,30 @@
<h4 id="suppress_issue" class="faq">Q: How can I suppress a specific analyzer warning?</h4>
-<p>There is currently no mechanism for suppressing the analyzer warning,
-although this is currently being investigated. If you encounter an analyzer
-bug/false positive, please <a href = "filing_bugs.html">report it</a>.</p>
+<p>There is currently no solid mechanism for suppressing an analyzer warning,
+although this is currently being investigated. When you encounter an analyzer
+bug/false positive, check if it's one of the issues discussed above or if the
+analyzer <a href = "annotations.html#custom_assertions" >annotations</a> can
+resolve the issue. Second, please <a href = "filing_bugs.html">report it</a> to
+help us improve user experience. As the last resort, consider using <tt>__clang_analyzer__</tt> macro
+<a href = "faq.html#exclude_code" >described below</a>.</p>
+
+<h4 id="exclude_code" class="faq">Q: How can I selectively exclude code the analyzer examines?</h4>
+
+<p>When the static analyzer is using clang to parse source files, it implicitly
+defines the preprocessor macro <tt>__clang_analyzer__</tt>. One can use this
+macro to selectively exclude code the analyzer examines. Here is an example:
+
+<pre class="code_example">
+#ifndef __clang_analyzer__
+// Code not to be analyzed
+#endif
+</pre>
+
+This usage is discouraged because it makes the code dead to the analyzer from
+now on. Instead, we prefer that users file bugs against the analyzer when it flags
+false positives.
+</p>
</div>
</div>