xref: /aosp_15_r20/external/clang/www/OpenProjects.html (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2*67e74705SXin Li          "http://www.w3.org/TR/html4/strict.dtd">
3*67e74705SXin Li<html>
4*67e74705SXin Li<head>
5*67e74705SXin Li  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6*67e74705SXin Li  <title>Clang - Get Involved</title>
7*67e74705SXin Li  <link type="text/css" rel="stylesheet" href="menu.css">
8*67e74705SXin Li  <link type="text/css" rel="stylesheet" href="content.css">
9*67e74705SXin Li</head>
10*67e74705SXin Li<body>
11*67e74705SXin Li
12*67e74705SXin Li<!--#include virtual="menu.html.incl"-->
13*67e74705SXin Li
14*67e74705SXin Li<div id="content">
15*67e74705SXin Li
16*67e74705SXin Li<h1>Open Clang Projects</h1>
17*67e74705SXin Li
18*67e74705SXin Li<p>Here are a few tasks that are available for newcomers to work on, depending
19*67e74705SXin Lion what your interests are.  This list is provided to generate ideas, it is not
20*67e74705SXin Liintended to be comprehensive.  Please ask on cfe-dev for more specifics or to
21*67e74705SXin Liverify that one of these isn't already completed. :)</p>
22*67e74705SXin Li
23*67e74705SXin Li<ul>
24*67e74705SXin Li<li><b>Undefined behavior checking</b>:
25*67e74705SXin LiImprove and extend the runtime checks for undefined behavior which CodeGen
26*67e74705SXin Liinserts for the various <tt>-fsanitize=</tt> modes. A lot of issues can already
27*67e74705SXin Libe caught, but there is more to do here.</li>
28*67e74705SXin Li
29*67e74705SXin Li<li><b>Improve target support</b>: The current target interfaces are heavily
30*67e74705SXin Listubbed out and need to be implemented fully.  See the FIXME's in TargetInfo.
31*67e74705SXin LiAdditionally, the actual target implementations (instances of TargetInfoImpl)
32*67e74705SXin Lialso need to be completed.</li>
33*67e74705SXin Li
34*67e74705SXin Li<li><b>Implement an tool to generate code documentation</b>: Clang's
35*67e74705SXin Lilibrary-based design allows it to be used by a variety of tools that reason
36*67e74705SXin Liabout source code. One great application of Clang would be to build an
37*67e74705SXin Liauto-documentation system like doxygen that generates code documentation from
38*67e74705SXin Lisource code. The advantage of using Clang for such a tool is that the tool would
39*67e74705SXin Liuse the same preprocessor/parser/ASTs as the compiler itself, giving it a very
40*67e74705SXin Lirich understanding of the code. Clang is already able to read and understand
41*67e74705SXin Lidoxygen markup, but cannot yet generate documentation from it.</li>
42*67e74705SXin Li
43*67e74705SXin Li<li><b>Use clang libraries to implement better versions of existing tools</b>:
44*67e74705SXin LiClang is built as a set of libraries, which means that it is possible to
45*67e74705SXin Liimplement capabilities similar to other source language tools, improving them
46*67e74705SXin Liin various ways.  Three examples are <a
47*67e74705SXin Lihref="http://distcc.samba.org/">distcc</a>, the <a
48*67e74705SXin Lihref="http://delta.tigris.org/">delta testcase reduction tool</a>, and the
49*67e74705SXin Li"indent" source reformatting tool.
50*67e74705SXin Lidistcc can be improved to scale better and be more efficient.  Delta could be
51*67e74705SXin Lifaster and more efficient at reducing C-family programs if built on the clang
52*67e74705SXin Lipreprocessor. The clang-based indent replacement,
53*67e74705SXin Li<a href="http://clang.llvm.org/docs/ClangFormat.html">clang-format</a>,
54*67e74705SXin Licould be taught to handle simple structural rules like those in <a
55*67e74705SXin Lihref="http://llvm.org/docs/CodingStandards.html#hl_earlyexit">the LLVM coding
56*67e74705SXin Listandards</a>.</li>
57*67e74705SXin Li
58*67e74705SXin Li<li><b>Use clang libraries to extend Ragel with a JIT</b>: <a
59*67e74705SXin Lihref="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state
60*67e74705SXin Limachine compiler that lets you embed C code into state machines and generate
61*67e74705SXin LiC code.  It would be relatively easy to turn this into a JIT compiler using
62*67e74705SXin LiLLVM.</li>
63*67e74705SXin Li
64*67e74705SXin Li<li><b>Self-testing using clang</b>: There are several neat ways to
65*67e74705SXin Liimprove the quality of clang by self-testing. Some examples:
66*67e74705SXin Li<ul>
67*67e74705SXin Li  <li>Improve the reliability of AST printing and serialization by
68*67e74705SXin Li  ensuring that the AST produced by clang on an input doesn't change
69*67e74705SXin Li  when it is reparsed or unserialized.
70*67e74705SXin Li
71*67e74705SXin Li  <li>Improve parser reliability and error generation by automatically
72*67e74705SXin Li  or randomly changing the input checking that clang doesn't crash and
73*67e74705SXin Li  that it doesn't generate excessive errors for small input
74*67e74705SXin Li  changes. Manipulating the input at both the text and token levels is
75*67e74705SXin Li  likely to produce interesting test cases.
76*67e74705SXin Li</ul>
77*67e74705SXin Li</li>
78*67e74705SXin Li
79*67e74705SXin Li<li><b>Continue work on C++1y support</b>:
80*67e74705SXin Li  C++98 and C++11 are feature-complete, but there are still several C++1y features to
81*67e74705SXin Li  implement.  Please see the <a href="cxx_status.html">C++ status report
82*67e74705SXin Li  page</a> to find out what is missing.</li>
83*67e74705SXin Li
84*67e74705SXin Li<li><b>StringRef'ize APIs</b>: A thankless but incredibly useful project is
85*67e74705SXin LiStringRef'izing (converting to use <tt>llvm::StringRef</tt> instead of <tt>const
86*67e74705SXin Lichar *</tt> or <tt>std::string</tt>) various clang interfaces. This generally
87*67e74705SXin Lisimplifies the code and makes it more efficient.</li>
88*67e74705SXin Li
89*67e74705SXin Li<li><b>Universal Driver</b>: Clang is inherently a cross compiler. We would like
90*67e74705SXin Lito define a new model for cross compilation which provides a great user
91*67e74705SXin Liexperience -- it should be easy to cross compile applications, install support
92*67e74705SXin Lifor new architectures, access different compilers and tools, and be consistent
93*67e74705SXin Liacross different platforms. See the <a href="UniversalDriver.html">Universal
94*67e74705SXin LiDriver</a> web page for more information.</li>
95*67e74705SXin Li
96*67e74705SXin Li<li><b>XML Representation of ASTs</b>: Clang maintains a rich Abstract Syntax Tree that describes the program. Clang could emit an XML document that describes the program, which others tools could consume rather than being tied directly to the Clang binary.The XML representation needs to meet several requirements:
97*67e74705SXin Li  <ul>
98*67e74705SXin Li    <li><i>General</i>, so that it's able to represent C/C++/Objective-C abstractly, and isn't tied to the specific internal ASTs that Clang uses.</li>
99*67e74705SXin Li    <li><i>Documented</i>, with appropriate Schema against which the output of Clang's XML formatter can be verified.</li>
100*67e74705SXin Li    <li><i>Stable</i> across Clang versions.</li>
101*67e74705SXin Li  </ul></li>
102*67e74705SXin Li
103*67e74705SXin Li<li><b>Configuration Manager</b>: Clang/LLVM works on a large number of
104*67e74705SXin Liarchitectures and operating systems and can cross-compile to a similarly large
105*67e74705SXin Linumber of configurations, but the pitfalls of chosing the command-line
106*67e74705SXin Lioptions, making sure the right sub-architecture is chosen and that the correct
107*67e74705SXin Lioptional elements of your particular system can be a pain.
108*67e74705SXin Li
109*67e74705SXin Li<p>A tool that would investigate hosts and targets, and store the configuration
110*67e74705SXin Liin files that can later be used by Clang itself to avoid command-line options,
111*67e74705SXin Liespecially the ones regarding which target options to use, would greatle alleviate
112*67e74705SXin Lithis problem. A simple tool, with little or no dependency on LLVM itself, that
113*67e74705SXin Liwill investigate a target architecture by probing hardware, software, libraries
114*67e74705SXin Liand compiling and executing code to identify all properties that would be relevant
115*67e74705SXin Lito command-line options (VFP, SSE, NEON, ARM vs. Thumb etc), triple settings etc.</p>
116*67e74705SXin Li
117*67e74705SXin Li<p>The first stage is to build a CFLAGS for Clang that would produce code on the
118*67e74705SXin Licurrent Host to the identified Target.</p>
119*67e74705SXin Li
120*67e74705SXin Li<p>The second stage would be to produce a configuration file (that can be used
121*67e74705SXin Liindependently of the Host) so that Clang can read it and not need a gazillion
122*67e74705SXin Liof command-line options. Such file should be simple JSON / INI or anything that
123*67e74705SXin Lia text editor could change.</p>
124*67e74705SXin Li</ul>
125*67e74705SXin Li
126*67e74705SXin Li<p>If you hit a bug with clang, it is very useful for us if you reduce the code
127*67e74705SXin Lithat demonstrates the problem down to something small.  There are many ways to
128*67e74705SXin Lido this; ask on cfe-dev for advice.</p>
129*67e74705SXin Li
130*67e74705SXin Li</div>
131*67e74705SXin Li</body>
132*67e74705SXin Li</html>
133