<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
No, there's no API for that; you'll have to patch BugReporter from
the inside to make this happen.<br>
<br>
<br>
> Even disregarding the question of whether the criterion that I
mentioned for discarding path notes is possible<br>
<br>
This problem is not checker-specific and it's indeed a fairly hard
theoretical problem in general; we have some ideas but we don't have
a generic solution in mind. Extra notes are annoying and potentially
confusing but they're technically correct so it's not too bad.<br>
<br>
Say, if your code would have been slightly different:<br>
<br>
void f() {<br>
int foo = 2;<br>
<br>
if (!someResult())<br>
return;<br>
<br>
if (otherResult())<br>
foo = 3;<br>
<br>
neverCallThisAPIWith3(foo);<br>
}<br>
<br>
Then you'd definitely want to keep the note about otherResult() but
not probably still drop the note about someResult().<br>
<br>
Another example:<br>
<br>
void f() {<br>
bool bar = false;<br>
if (!someResult())<br>
bar = true;<br>
<br>
int foo = 2;<br>
if (bar)<br>
foo = 3;<br>
<br>
neverCallThisAPIWith3(foo);<br>
}<br>
<br>
In this case you'd want most likely want to keep the entire path
even though foo wasn't even declared at the first note.<br>
<br>
<div class="moz-cite-prefix">On 6/21/20 6:13 AM, via cfe-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAHbXgc3-_FiZTvSGyounHKOwn56yS6WVpyeLzDBU3Uj0-=+iZA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi list,</div>
<div><br>
</div>
<div>Is there any way to get a BugReporterVisitor to delete path
diagnostic notes that occur at program points that my plugin
doesn't consider interesting?</div>
<div><br>
</div>
<div>For example,</div>
<div><br>
</div>
<div>void f() {</div>
<div> if (!someResult())</div>
<div> return;</div>
<div> if (!otherResult())</div>
<div> return;<br>
</div>
<div> int foo = 3;</div>
<div> neverCallThisAPIWith3(foo);</div>
<div>}</div>
<div><br>
</div>
<div>If I am checking that neverCallThisAPIWith3() is never
called with 3, then in this case there are a lot of irrelevant
path diagnostic notes due to the early returns. (e.g. we
always see "note: Taking false branch" on the if-statements,
but if we took the true branch on either of them, then we
wouldn't get to the 'foo' part.) Really what I want to show in
my diagnostic is notes that concern the value of variable
'foo'. If possible, I'd like to prune the notes that
distinguish the path from other paths where 'foo' is never
even declared.</div>
<div><br>
</div>
<div>Is this possible? I don't see any method in the docs to
delete a note from a BugReport, in the first place. (Even
disregarding the question of whether the criterion that I
mentioned for discarding path notes is possible)<br>
</div>
<div><br>
</div>
<div>Cheers,<br>
</div>
<div>-- <br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">Philip C<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>