ExternalClangExamples.rst 4.3 KB

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