<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/Analysis/ProgramPoint.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[NFC][analyzer] Rename getTagDescription to getDebugName (#141511)</title>
<updated>2025-05-26T19:29:09+00:00</updated>
<author>
<name>Donát Nagy</name>
<email>donat.nagy@ericsson.com</email>
</author>
<published>2025-05-26T19:29:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=73c49293220bb36e430d9c840568d45c886bd2ab'/>
<id>73c49293220bb36e430d9c840568d45c886bd2ab</id>
<content type='text'>
Co-authored-by: Balazs Benics &lt;benicsbalazs@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Balazs Benics &lt;benicsbalazs@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer][NFC] Introduce framework for checker families (#139256)</title>
<updated>2025-05-26T18:27:42+00:00</updated>
<author>
<name>Donát Nagy</name>
<email>donat.nagy@ericsson.com</email>
</author>
<published>2025-05-26T18:27:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6833076a5d9f5719539a24e900037da5a3979289'/>
<id>6833076a5d9f5719539a24e900037da5a3979289</id>
<content type='text'>
The checker classes (i.e. classes derived from `CheckerBase` via the
utility template `Checker&lt;...&gt;`) act as intermediates between the user
and the analyzer engine, so they have two interfaces:
- On the frontend side, they have a public name, can be enabled or
disabled, can accept checker options and can be reported as the source
of bug reports.
- On the backend side, they can handle various checker callbacks and
they "leave a mark" on the `ExplodedNode`s that are created by them.
(These `ProgramPointTag` marks are internal: they appear in debug logs
and can be queried by checker logic; but the user doesn't see them.)

In a significant majority of the checkers there is 1:1 correspondence
between these sides, but there are also many checker classes where
several related user-facing checkers share the same backend class.
Historically each of these "multi-part checker" classes had its own
hacks to juggle its multiple names, which led to lots of ugliness like
lazy initialization of `mutable std::unique_ptr&lt;BugType&gt;` members and
redundant data members (when a checker used its custom `CheckNames`
array and ignored the inherited single `Name`).

My recent commit 27099982da2f5a6c2d282d6b385e79d080669546 tried to unify
and standardize these existing solutions to get rid of some of the
technical debt, but it still used enum values to identify the checker
parts within a "multi-part" checker class, which led to some ugliness.

This commit introduces a new framework which takes a more direct,
object-oriented approach: instead of identifying checker parts with
`{parent checker object, index of part}` pairs, the parts of a
multi-part checker become stand-alone objects that store their own name
(and enabled/disabled status) as a data member.

This is implemented by separating the functionality of `CheckerBase`
into two new classes: `CheckerFrontend` and `CheckerBackend`. The name
`CheckerBase` is kept (as a class derived from both `CheckerFrontend`
and `CheckerBackend`), so "simple" checkers that use `CheckerBase` and
`Checker&lt;...&gt;` continues to work without changes. However we also get
first-class support for the "many frontends - one backend" situation:
- The class `CheckerFamily&lt;...&gt;` works exactly like `Checker&lt;...&gt;` but
inherits from `CheckerBackend` instead of `CheckerBase`, so it won't
have a superfluous single `Name` member.
- Classes deriving from `CheckerFamily` can freely own multiple
`CheckerFrontend` data members, which are enabled within the
registration methods corresponding to their name and can be used to
initialize the `BugType`s that they can emit.

In this scheme each `CheckerFamily` needs to override the pure virtual
method `ProgramPointTag::getTagDescription()` which returns a string
which represents that class for debugging purposes. (Previously this
used the name of one arbitrary sub-checker, which was passable for
debugging purposes, but not too elegant.)

I'm planning to implement follow-up commits that convert all the
"multi-part" checkers to this `CheckerFamily` framework.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The checker classes (i.e. classes derived from `CheckerBase` via the
utility template `Checker&lt;...&gt;`) act as intermediates between the user
and the analyzer engine, so they have two interfaces:
- On the frontend side, they have a public name, can be enabled or
disabled, can accept checker options and can be reported as the source
of bug reports.
- On the backend side, they can handle various checker callbacks and
they "leave a mark" on the `ExplodedNode`s that are created by them.
(These `ProgramPointTag` marks are internal: they appear in debug logs
and can be queried by checker logic; but the user doesn't see them.)

In a significant majority of the checkers there is 1:1 correspondence
between these sides, but there are also many checker classes where
several related user-facing checkers share the same backend class.
Historically each of these "multi-part checker" classes had its own
hacks to juggle its multiple names, which led to lots of ugliness like
lazy initialization of `mutable std::unique_ptr&lt;BugType&gt;` members and
redundant data members (when a checker used its custom `CheckNames`
array and ignored the inherited single `Name`).

My recent commit 27099982da2f5a6c2d282d6b385e79d080669546 tried to unify
and standardize these existing solutions to get rid of some of the
technical debt, but it still used enum values to identify the checker
parts within a "multi-part" checker class, which led to some ugliness.

This commit introduces a new framework which takes a more direct,
object-oriented approach: instead of identifying checker parts with
`{parent checker object, index of part}` pairs, the parts of a
multi-part checker become stand-alone objects that store their own name
(and enabled/disabled status) as a data member.

This is implemented by separating the functionality of `CheckerBase`
into two new classes: `CheckerFrontend` and `CheckerBackend`. The name
`CheckerBase` is kept (as a class derived from both `CheckerFrontend`
and `CheckerBackend`), so "simple" checkers that use `CheckerBase` and
`Checker&lt;...&gt;` continues to work without changes. However we also get
first-class support for the "many frontends - one backend" situation:
- The class `CheckerFamily&lt;...&gt;` works exactly like `Checker&lt;...&gt;` but
inherits from `CheckerBackend` instead of `CheckerBase`, so it won't
have a superfluous single `Name` member.
- Classes deriving from `CheckerFamily` can freely own multiple
`CheckerFrontend` data members, which are enabled within the
registration methods corresponding to their name and can be used to
initialize the `BugType`s that they can emit.

In this scheme each `CheckerFamily` needs to override the pure virtual
method `ProgramPointTag::getTagDescription()` which returns a string
which represents that class for debugging purposes. (Previously this
used the name of one arbitrary sub-checker, which was passable for
debugging purposes, but not too elegant.)

I'm planning to implement follow-up commits that convert all the
"multi-part" checkers to this `CheckerFamily` framework.</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] Add time-trace scopes for high-level analyzer steps (#125508)</title>
<updated>2025-02-05T16:22:18+00:00</updated>
<author>
<name>Arseniy Zaostrovnykh</name>
<email>necto.ne@gmail.com</email>
</author>
<published>2025-02-05T16:22:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1d5be8f7fa24b95e652593f9a780005e6604920'/>
<id>c1d5be8f7fa24b95e652593f9a780005e6604920</id>
<content type='text'>
Specifically, add a scope for 
- each work-list step,
- each entry point,
- each checker run within a step, and
- bug-suppression phase at the end of the analysis of an entry-point.

These scopes add no perceptible run-time overhead when time-tracing is
disabled. You can enable it and generate a time trace using the
`-ftime-trace=file.json` option.

See also the RFC:
https://discourse.llvm.org/t/analyzer-rfc-ftime-trace-time-scopes-for-steps-and-entry-points/84343

--
CPP-6065</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Specifically, add a scope for 
- each work-list step,
- each entry point,
- each checker run within a step, and
- bug-suppression phase at the end of the analysis of an entry-point.

These scopes add no perceptible run-time overhead when time-tracing is
disabled. You can enable it and generate a time trace using the
`-ftime-trace=file.json` option.

See also the RFC:
https://discourse.llvm.org/t/analyzer-rfc-ftime-trace-time-scopes-for-steps-and-entry-points/84343

--
CPP-6065</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] Print the callee name in CallEnter in exploded-graph-rewriter (#116225)</title>
<updated>2024-11-15T13:21:35+00:00</updated>
<author>
<name>Balazs Benics</name>
<email>benicsbalazs@gmail.com</email>
</author>
<published>2024-11-15T13:21:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9cbf2dd6f3900045f1bbbdf44142f572d8f3b339'/>
<id>9cbf2dd6f3900045f1bbbdf44142f572d8f3b339</id>
<content type='text'>
![image](https://github.com/user-attachments/assets/22a82950-d6e1-4e1f-8f82-2f33240b382a)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
![image](https://github.com/user-attachments/assets/22a82950-d6e1-4e1f-8f82-2f33240b382a)</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][analyzer][NFC] Fix strange bracket placement</title>
<updated>2024-10-10T15:51:06+00:00</updated>
<author>
<name>David Spickett</name>
<email>david.spickett@linaro.org</email>
</author>
<published>2024-10-10T15:50:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f5aec03f6dd2f92590ecec9e3419b38b11d8476e'/>
<id>f5aec03f6dd2f92590ecec9e3419b38b11d8476e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[AST] Remove DeclCXX.h dep on ASTContext.h</title>
<updated>2020-04-06T17:09:01+00:00</updated>
<author>
<name>Reid Kleckner</name>
<email>rnk@google.com</email>
</author>
<published>2020-04-06T16:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b36c19bc4f2110a8e33f8d93751ef28b6dcd0292'/>
<id>b36c19bc4f2110a8e33f8d93751ef28b6dcd0292</id>
<content type='text'>
Saves only 36 includes of ASTContext.h and related headers.

There are two deps on ASTContext.h:
- C++ method overrides iterator types (TinyPtrVector)
- getting LangOptions

For #1, duplicate the iterator type, which is
TinyPtrVector&lt;&gt;::const_iterator.

For #2, add an out-of-line accessor to get the language options. Getting
the ASTContext from a Decl is already an out of line method that loops
over the parent DeclContexts, so if it is ever performance critical, the
proper fix is to pass the context (or LangOpts) into the predicate in
question.

Other changes are just header fixups.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Saves only 36 includes of ASTContext.h and related headers.

There are two deps on ASTContext.h:
- C++ method overrides iterator types (TinyPtrVector)
- getting LangOptions

For #1, duplicate the iterator type, which is
TinyPtrVector&lt;&gt;::const_iterator.

For #2, add an out-of-line accessor to get the language options. Getting
the ASTContext from a Decl is already an out of line method that loops
over the parent DeclContexts, so if it is ever performance critical, the
proper fix is to pass the context (or LangOpts) into the predicate in
question.

Other changes are just header fixups.
</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] Display cast kinds in program point dumps.</title>
<updated>2019-10-17T23:10:05+00:00</updated>
<author>
<name>Artem Dergachev</name>
<email>artem.dergachev@gmail.com</email>
</author>
<published>2019-10-17T23:10:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d325196f19bfecff59252f3d214278fb6ee4ad61'/>
<id>d325196f19bfecff59252f3d214278fb6ee4ad61</id>
<content type='text'>
Because cast expressions have their own hierarchy, it's extremely useful
to have some information about what kind of casts are we dealing with.

llvm-svn: 375185
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because cast expressions have their own hierarchy, it's extremely useful
to have some information about what kind of casts are we dealing with.

llvm-svn: 375185
</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] exploded-graph-rewriter: Improve source location dumps.</title>
<updated>2019-07-12T02:10:33+00:00</updated>
<author>
<name>Artem Dergachev</name>
<email>artem.dergachev@gmail.com</email>
</author>
<published>2019-07-12T02:10:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ed035ff8264fcfd8ba380a6966c8f29097deb251'/>
<id>ed035ff8264fcfd8ba380a6966c8f29097deb251</id>
<content type='text'>
- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site locations.
- Display statement IDs for program points.

llvm-svn: 365861
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site locations.
- Display statement IDs for program points.

llvm-svn: 365861
</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] print() JSONify: ProgramPoint revision</title>
<updated>2019-06-24T16:19:39+00:00</updated>
<author>
<name>Csaba Dabis</name>
<email>dabis.csaba98@gmail.com</email>
</author>
<published>2019-06-24T16:19:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3a4a60eb6a73e4f927895ca567bb714885648c36'/>
<id>3a4a60eb6a73e4f927895ca567bb714885648c36</id>
<content type='text'>
Summary: Now we also print out the filename with its path.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin,
             mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63438

llvm-svn: 364197
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary: Now we also print out the filename with its path.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin,
             mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63438

llvm-svn: 364197
</pre>
</div>
</content>
</entry>
<entry>
<title>[analyzer] ProgramPoint: more explicit printJson()</title>
<updated>2019-06-12T18:24:02+00:00</updated>
<author>
<name>Csaba Dabis</name>
<email>dabis.csaba98@gmail.com</email>
</author>
<published>2019-06-12T18:24:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa880e6114c37a11bfe6cd1b600f2ba392c4fac8'/>
<id>fa880e6114c37a11bfe6cd1b600f2ba392c4fac8</id>
<content type='text'>
Summary: Now we print out every possible kinds of ProgramPoints.

Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy,
             dkrupp, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62946

llvm-svn: 363187
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary: Now we print out every possible kinds of ProgramPoints.

Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy,
             dkrupp, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62946

llvm-svn: 363187
</pre>
</div>
</content>
</entry>
</feed>
