diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2017-09-30 00:07:22 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2017-09-30 00:07:22 +0000 |
| commit | 40eb5130a5646cd917fd71ea4520e928e2432d71 (patch) | |
| tree | 77512d55b15e1ed86338cd0261d0f144265cd4c4 | |
| parent | af76b4a553fcce30240377b35669f8a031c2f1f3 (diff) | |
| download | bcm5719-llvm-40eb5130a5646cd917fd71ea4520e928e2432d71.tar.gz bcm5719-llvm-40eb5130a5646cd917fd71ea4520e928e2432d71.zip | |
[Analyzer] Document a gotcha: for C++ -analyze-function requires parameters in function name
Differential Revision: https://reviews.llvm.org/D37596
llvm-svn: 314573
| -rw-r--r-- | clang/include/clang/Driver/CC1Options.td | 2 | ||||
| -rw-r--r-- | clang/www/analyzer/checker_dev_manual.html | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index 385d34d4e71..5dbf0afd8df 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -70,7 +70,7 @@ def analyzer_opt_analyze_nested_blocks : Flag<["-"], "analyzer-opt-analyze-neste def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">, HelpText<"Emit verbose output about the analyzer's progress">; def analyze_function : Separate<["-"], "analyze-function">, - HelpText<"Run analysis on specific function">; + HelpText<"Run analysis on specific function (for C++ include parameters in name)">; def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>; def analyzer_eagerly_assume : Flag<["-"], "analyzer-eagerly-assume">, HelpText<"Eagerly assume the truth/falseness of some symbolic constraints">; diff --git a/clang/www/analyzer/checker_dev_manual.html b/clang/www/analyzer/checker_dev_manual.html index cdc2496b99c..4883556383f 100644 --- a/clang/www/analyzer/checker_dev_manual.html +++ b/clang/www/analyzer/checker_dev_manual.html @@ -575,8 +575,8 @@ execute a single checker: processing a large file use the <tt><b>-analyzer-display-progress</b></tt> option.</p> -<p>You can analyze a particular function within the file, which is often useful -because the problem is always in a certain function:</p> +<p>To selectively analyze only the given function, use the +<tt><b>-analyze-function</b></tt> option:</p> <pre class="code"> $ <b>clang -cc1 -analyze -analyzer-checker=core test.c -analyzer-display-progress</b> ANALYZE (Syntax): test.c foo @@ -588,6 +588,16 @@ because the problem is always in a certain function:</p> ANALYZE (Path, Inline_Regular): test.c foo </pre> +<b>Note: </b> a fully qualified function name has to be used when selecting +C++ functions and methods, Objective-C methods and blocks, e.g.: + +<pre class="code"> + $ <b>clang -cc1 -analyze -analyzer-checker=core test.cc -analyze-function=foo(int)</b> +</pre> + +The fully qualified name can be found from the +<tt><b>-analyzer-display-progress</b></tt> output. + <p>The bug reporter mechanism removes path diagnostics inside intermediate function calls that have returned by the time the bug was found and contain no interesting pieces. Usually it is up to the checkers to produce more |

