[cfe-dev] How do I retrieve all non-local variables a function has access to?

Miklos Vajna via cfe-dev cfe-dev at lists.llvm.org
Sun Jul 21 11:58:34 PDT 2019


Hi Kristóf,

On Sun, Jul 21, 2019 at 12:42:34PM +0200, Kristóf Umann via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> I'm trying to implement a primitive reaching definitions algorithm for C++,
> but am struggling a bit.

Is this about finding unused data members and functions where the
compiler can't detect them as that requires CTU analysis?

If so, you might want to look at
<https://cgit.freedesktop.org/libreoffice/core/tree/compilerplugins/clang/unusedmethods.cxx>,
and other unused* files in the same directory, which use the clang AST
to find unused code; though they don't use AST matchers.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190721/de6edf2f/attachment.sig>


More information about the cfe-dev mailing list