Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 5 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 6 | <title>Clang - Get Involved</title> |
Benjamin Kramer | 665a8dc | 2012-01-15 15:26:07 +0000 | [diff] [blame] | 7 | <link type="text/css" rel="stylesheet" href="menu.css"> |
| 8 | <link type="text/css" rel="stylesheet" href="content.css"> |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 9 | </head> |
| 10 | <body> |
| 11 | |
| 12 | <!--#include virtual="menu.html.incl"--> |
| 13 | |
| 14 | <div id="content"> |
| 15 | |
| 16 | <h1>Open Clang Projects</h1> |
| 17 | |
| 18 | <p>Here are a few tasks that are available for newcomers to work on, depending |
| 19 | on what your interests are. This list is provided to generate ideas, it is not |
| 20 | intended to be comprehensive. Please ask on cfe-dev for more specifics or to |
| 21 | verify that one of these isn't already completed. :)</p> |
| 22 | |
| 23 | <ul> |
Douglas Gregor | 6ba70bf | 2009-06-11 14:53:37 +0000 | [diff] [blame] | 24 | <li><b>Undefined behavior checking</b>: CodeGen could |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 25 | insert runtime checks for all sorts of different undefined behaviors, from |
| 26 | reading uninitialized variables, buffer overflows, and many other things. This |
| 27 | checking would be expensive, but the optimizers could eliminate many of the |
| 28 | checks in some cases, and it would be very interesting to test code in this mode |
| 29 | for certain crowds of people. Because the inserted code is coming from clang, |
| 30 | the "abort" message could be very detailed about exactly what went wrong.</li> |
| 31 | |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 32 | <li><b>Improve target support</b>: The current target interfaces are heavily |
| 33 | stubbed out and need to be implemented fully. See the FIXME's in TargetInfo. |
| 34 | Additionally, the actual target implementations (instances of TargetInfoImpl) |
| 35 | also need to be completed.</li> |
| 36 | |
| 37 | <li><b>Implement an tool to generate code documentation</b>: Clang's |
| 38 | library-based design allows it to be used by a variety of tools that reason |
| 39 | about source code. One great application of Clang would be to build an |
| 40 | auto-documentation system like doxygen that generates code documentation from |
| 41 | source code. The advantage of using Clang for such a tool is that the tool would |
| 42 | use the same preprocessor/parser/ASTs as the compiler itself, giving it a very |
| 43 | rich understanding of the code.</li> |
| 44 | |
| 45 | <li><b>Use clang libraries to implement better versions of existing tools</b>: |
| 46 | Clang is built as a set of libraries, which means that it is possible to |
| 47 | implement capabilities similar to other source language tools, improving them |
Chris Lattner | 1ba14c6 | 2010-12-06 19:46:27 +0000 | [diff] [blame] | 48 | in various ways. Three examples are <a |
| 49 | href="http://distcc.samba.org/">distcc</a>, the <a |
| 50 | href="http://delta.tigris.org/">delta testcase reduction tool</a>, and the |
| 51 | "indent" source reformatting tool. |
| 52 | distcc can be improved to scale better and be more efficient. Delta could be |
| 53 | faster and more efficient at reducing C-family programs if built on the clang |
| 54 | preprocessor, indent could do proper formatting for complex C++ features, and it |
| 55 | would be straight-forward to extend a clang-based implementation to handle |
| 56 | simple structural rules like those in <a |
| 57 | href="http://llvm.org/docs/CodingStandards.html#hl_earlyexit">the LLVM coding |
| 58 | standards</a>.</li> |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 59 | |
| 60 | <li><b>Use clang libraries to extend Ragel with a JIT</b>: <a |
| 61 | href="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state |
| 62 | machine compiler that lets you embed C code into state machines and generate |
| 63 | C code. It would be relatively easy to turn this into a JIT compiler using |
| 64 | LLVM.</li> |
| 65 | |
| 66 | <li><b>Self-testing using clang</b>: There are several neat ways to |
| 67 | improve the quality of clang by self-testing. Some examples: |
| 68 | <ul> |
| 69 | <li>Improve the reliability of AST printing and serialization by |
| 70 | ensuring that the AST produced by clang on an input doesn't change |
| 71 | when it is reparsed or unserialized. |
| 72 | |
| 73 | <li>Improve parser reliability and error generation by automatically |
| 74 | or randomly changing the input checking that clang doesn't crash and |
| 75 | that it doesn't generate excessive errors for small input |
| 76 | changes. Manipulating the input at both the text and token levels is |
| 77 | likely to produce interesting test cases. |
| 78 | </ul> |
| 79 | </li> |
| 80 | |
David Blaikie | 1e2b3d7 | 2011-10-14 07:58:10 +0000 | [diff] [blame] | 81 | <li><b>Continue work on C++'11 support</b>: |
| 82 | C++'98 is feature complete, but there is still a lot of C++'11 features to |
Chris Lattner | 1ba14c6 | 2010-12-06 19:46:27 +0000 | [diff] [blame] | 83 | implement. Please see the <a href="cxx_status.html">C++ status report |
| 84 | page</a> to find out what is missing.</li> |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 85 | |
Daniel Dunbar | 09becee | 2009-10-17 20:43:50 +0000 | [diff] [blame] | 86 | <li><b>StringRef'ize APIs</b>: A thankless but incredibly useful project is |
| 87 | StringRef'izing (converting to use <tt>llvm::StringRef</tt> instead of <tt>const |
| 88 | char *</tt> or <tt>std::string</tt>) various clang interfaces. This generally |
| 89 | simplifies the code and makes it more efficient.</li> |
| 90 | |
Daniel Dunbar | b114d2e | 2009-10-17 21:50:11 +0000 | [diff] [blame] | 91 | <li><b>Universal Driver</b>: Clang is inherently a cross compiler. We would like |
| 92 | to define a new model for cross compilation which provides a great user |
| 93 | experience -- it should be easy to cross compile applications, install support |
| 94 | for new architectures, access different compilers and tools, and be consistent |
| 95 | across different platforms. See the <a href="UniversalDriver.html">Universal |
| 96 | Driver</a> web page for more information.</li> |
Douglas Gregor | e07339b | 2011-03-09 16:27:48 +0000 | [diff] [blame] | 97 | |
| 98 | <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: |
| 99 | <ul> |
| 100 | <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> |
| 101 | <li><i>Documented</i>, with appropriate Schema against which the output of Clang's XML formatter can be verified.</li> |
| 102 | <li><i>Stable</i> across Clang versions.</li> |
| 103 | </ul></li> |
Renato Golin | c661e12 | 2013-02-27 21:28:29 +0000 | [diff] [blame] | 104 | |
| 105 | <li><b>Configuration Manager</b>: Clang/LLVM works on a large number of |
| 106 | architectures and operating systems and can cross-compile to a similarly large |
| 107 | number of configurations, but the pitfalls of chosing the command-line |
| 108 | options, making sure the right sub-architecture is chosen and that the correct |
| 109 | optional elements of your particular system can be a pain. |
| 110 | |
| 111 | <p>A tool that would investigate hosts and targets, and store the configuration |
| 112 | in files that can later be used by Clang itself to avoid command-line options, |
| 113 | especially the ones regarding which target options to use, would greatle alleviate |
| 114 | this problem. A simple tool, with little or no dependency on LLVM itself, that |
| 115 | will investigate a target architecture by probing hardware, software, libraries |
| 116 | and compiling and executing code to identify all properties that would be relevant |
| 117 | to command-line options (VFP, SSE, NEON, ARM vs. Thumb etc), triple settings etc.</p> |
| 118 | |
| 119 | <p>The first stage is to build a CFLAGS for Clang that would produce code on the |
| 120 | current Host to the identified Target.</p> |
| 121 | |
| 122 | <p>The second stage would be to produce a configuration file (that can be used |
| 123 | independently of the Host) so that Clang can read it and not need a gazillion |
| 124 | of command-line options. Such file should be simple JSON / INI or anything that |
Renato Golin | 717ff54 | 2013-02-27 23:21:44 +0000 | [diff] [blame] | 125 | a text editor could change.</p> |
Gabor Greif | 67f94b8 | 2010-10-16 09:40:21 +0000 | [diff] [blame] | 126 | </ul> |
Daniel Dunbar | b114d2e | 2009-10-17 21:50:11 +0000 | [diff] [blame] | 127 | |
Renato Golin | c661e12 | 2013-02-27 21:28:29 +0000 | [diff] [blame] | 128 | <p>If you hit a bug with clang, it is very useful for us if you reduce the code |
| 129 | that demonstrates the problem down to something small. There are many ways to |
| 130 | do this; ask on cfe-dev for advice.</p> |
| 131 | |
Douglas Gregor | ef52738 | 2009-03-13 15:06:27 +0000 | [diff] [blame] | 132 | </div> |
| 133 | </body> |
| 134 | </html> |