annotate clang/docs/ExternalClangExamples.rst @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 =======================
anatofuz
parents:
diff changeset
2 External Clang Examples
anatofuz
parents:
diff changeset
3 =======================
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 Introduction
anatofuz
parents:
diff changeset
6 ============
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 This page provides some examples of the kinds of things that people have
anatofuz
parents:
diff changeset
9 done with Clang that might serve as useful guides (or starting points) from
anatofuz
parents:
diff changeset
10 which to develop your own tools. They may be helpful even for something as
anatofuz
parents:
diff changeset
11 banal (but necessary) as how to set up your build to integrate Clang.
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 Clang's library-based design is deliberately aimed at facilitating use by
anatofuz
parents:
diff changeset
14 external projects, and we are always interested in improving Clang to
anatofuz
parents:
diff changeset
15 better serve our external users. Some typical categories of applications
anatofuz
parents:
diff changeset
16 where Clang is used are:
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 - Static analysis.
anatofuz
parents:
diff changeset
19 - Documentation/cross-reference generation.
anatofuz
parents:
diff changeset
20
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
21 If you know of (or wrote!) a tool or project using Clang, please post on
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
22 `the Discourse forums (Clang Frontend category)
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
23 <https://discourse.llvm.org/c/clang/6>`_ to have it added.
150
anatofuz
parents:
diff changeset
24 (or if you are already a Clang contributor, feel free to directly commit
anatofuz
parents:
diff changeset
25 additions). Since the primary purpose of this page is to provide examples
anatofuz
parents:
diff changeset
26 that can help developers, generally they must have code available.
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 List of projects and tools
anatofuz
parents:
diff changeset
29 ==========================
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 `<https://github.com/Andersbakken/rtags/>`_
anatofuz
parents:
diff changeset
32 "RTags is a client/server application that indexes c/c++ code and keeps
anatofuz
parents:
diff changeset
33 a persistent in-memory database of references, symbolnames, completions
anatofuz
parents:
diff changeset
34 etc."
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 `<https://rprichard.github.com/sourceweb/>`_
anatofuz
parents:
diff changeset
37 "A C/C++ source code indexer and navigator"
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 `<https://github.com/etaoins/qconnectlint>`_
anatofuz
parents:
diff changeset
40 "qconnectlint is a Clang tool for statically verifying the consistency
anatofuz
parents:
diff changeset
41 of signal and slot connections made with Qt's ``QObject::connect``."
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 `<https://github.com/woboq/woboq_codebrowser>`_
anatofuz
parents:
diff changeset
44 "The Woboq Code Browser is a web-based code browser for C/C++ projects.
anatofuz
parents:
diff changeset
45 Check out `<https://code.woboq.org/>`_ for an example!"
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47 `<https://github.com/mozilla/dxr>`_
anatofuz
parents:
diff changeset
48 "DXR is a source code cross-reference tool that uses static analysis
anatofuz
parents:
diff changeset
49 data collected by instrumented compilers."
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 `<https://github.com/eschulte/clang-mutate>`_
anatofuz
parents:
diff changeset
52 "This tool performs a number of operations on C-language source files."
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 `<https://github.com/gmarpons/Crisp>`_
anatofuz
parents:
diff changeset
55 "A coding rule validation add-on for LLVM/clang. Crisp rules are written
anatofuz
parents:
diff changeset
56 in Prolog. A high-level declarative DSL to easily write new rules is under
anatofuz
parents:
diff changeset
57 development. It will be called CRISP, an acronym for *Coding Rules in
anatofuz
parents:
diff changeset
58 Sugared Prolog*."
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 `<https://github.com/drothlis/clang-ctags>`_
anatofuz
parents:
diff changeset
61 "Generate tag file for C++ source code."
anatofuz
parents:
diff changeset
62
anatofuz
parents:
diff changeset
63 `<https://github.com/exclipy/clang_indexer>`_
anatofuz
parents:
diff changeset
64 "This is an indexer for C and C++ based on the libclang library."
anatofuz
parents:
diff changeset
65
anatofuz
parents:
diff changeset
66 `<https://github.com/holtgrewe/linty>`_
anatofuz
parents:
diff changeset
67 "Linty - C/C++ Style Checking with Python & libclang."
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 `<https://github.com/axw/cmonster>`_
anatofuz
parents:
diff changeset
70 "cmonster is a Python wrapper for the Clang C++ parser."
anatofuz
parents:
diff changeset
71
anatofuz
parents:
diff changeset
72 `<https://github.com/rizsotto/Constantine>`_
anatofuz
parents:
diff changeset
73 "Constantine is a toy project to learn how to write clang plugin.
anatofuz
parents:
diff changeset
74 Implements pseudo const analysis. Generates warnings about variables,
anatofuz
parents:
diff changeset
75 which were declared without const qualifier."
anatofuz
parents:
diff changeset
76
anatofuz
parents:
diff changeset
77 `<https://github.com/jessevdk/cldoc>`_
anatofuz
parents:
diff changeset
78 "cldoc is a Clang based documentation generator for C and C++.
anatofuz
parents:
diff changeset
79 cldoc tries to solve the issue of writing C/C++ software documentation
anatofuz
parents:
diff changeset
80 with a modern, non-intrusive and robust approach."
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 `<https://github.com/AlexDenisov/ToyClangPlugin>`_
anatofuz
parents:
diff changeset
83 "The simplest Clang plugin implementing a semantic check for Objective-C.
anatofuz
parents:
diff changeset
84 This example shows how to use the ``DiagnosticsEngine`` (emit warnings,
anatofuz
parents:
diff changeset
85 errors, fixit hints). See also `<http://l.rw.rw/clang_plugin>`_ for
anatofuz
parents:
diff changeset
86 step-by-step instructions."
anatofuz
parents:
diff changeset
87
anatofuz
parents:
diff changeset
88 `<https://phabricator.kde.org/source/clazy>`_
anatofuz
parents:
diff changeset
89 "clazy is a compiler plugin which allows clang to understand Qt semantics.
anatofuz
parents:
diff changeset
90 You get more than 50 Qt related compiler warnings, ranging from unneeded
anatofuz
parents:
diff changeset
91 memory allocations to misusage of API, including fix-its for automatic
anatofuz
parents:
diff changeset
92 refactoring."
anatofuz
parents:
diff changeset
93
anatofuz
parents:
diff changeset
94 `<https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob_plain;f=compilerplugins/README;hb=HEAD>`_
anatofuz
parents:
diff changeset
95 "LibreOffice uses a Clang plugin infrastructure to check during the build
anatofuz
parents:
diff changeset
96 various things, some more, some less specific to the LibreOffice source code.
anatofuz
parents:
diff changeset
97 There are currently around 50 such checkers, from flagging C-style casts and
anatofuz
parents:
diff changeset
98 uses of reserved identifiers to ensuring that code adheres to lifecycle
anatofuz
parents:
diff changeset
99 protocols for certain LibreOffice-specific classes. They may serve as
anatofuz
parents:
diff changeset
100 examples for writing RecursiveASTVisitor-based plugins."