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> |
| 5 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
| 6 | <title>Clang - Get Involved</title> |
| 7 | <link type="text/css" rel="stylesheet" href="menu.css" /> |
| 8 | <link type="text/css" rel="stylesheet" href="content.css" /> |
| 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> |
| 24 | <li><b>Compile your favorite C/ObjC project with Clang</b>: |
| 25 | Clang's type-checking and code generation is very close to complete (but not bug free!) for C and Objective-C. We appreciate all reports of code that is |
| 26 | rejected or miscompiled by the front-end. If you notice invalid code that is not rejected, or poor diagnostics when code is rejected, that is also very important to us. For make-based projects, |
| 27 | the <a href="get_started.html#ccc"><code>ccc</code></a> driver works as a drop-in replacement for GCC.</li> |
| 28 | |
| 29 | <li><b>Overflow detection</b>: an interesting project would be to add a -ftrapv |
| 30 | compilation mode that causes -emit-llvm to generate overflow tests for all |
| 31 | signed integer arithmetic operators, and call abort if they overflow. Overflow |
| 32 | is undefined in C and hard for people to reason about. LLVM IR also has |
| 33 | intrinsics for generating arithmetic with overflow checks directly.</li> |
| 34 | |
| 35 | <li><b>Undefined behavior checking</b>: similar to adding -ftrapv, codegen could |
| 36 | insert runtime checks for all sorts of different undefined behaviors, from |
| 37 | reading uninitialized variables, buffer overflows, and many other things. This |
| 38 | checking would be expensive, but the optimizers could eliminate many of the |
| 39 | checks in some cases, and it would be very interesting to test code in this mode |
| 40 | for certain crowds of people. Because the inserted code is coming from clang, |
| 41 | the "abort" message could be very detailed about exactly what went wrong.</li> |
| 42 | |
| 43 | <li><b>Continue work on C++ support</b>: Implementing all of C++ is a very big |
| 44 | job, but there are lots of little pieces that can be picked off and implemented. |
| 45 | See the <a href="cxx_status.html">C++ status report page</a> to find out what is |
| 46 | missing and what is already at least partially supported.</li> |
| 47 | |
| 48 | <li><b>Improve target support</b>: The current target interfaces are heavily |
| 49 | stubbed out and need to be implemented fully. See the FIXME's in TargetInfo. |
| 50 | Additionally, the actual target implementations (instances of TargetInfoImpl) |
| 51 | also need to be completed.</li> |
| 52 | |
| 53 | <li><b>Implement an tool to generate code documentation</b>: Clang's |
| 54 | library-based design allows it to be used by a variety of tools that reason |
| 55 | about source code. One great application of Clang would be to build an |
| 56 | auto-documentation system like doxygen that generates code documentation from |
| 57 | source code. The advantage of using Clang for such a tool is that the tool would |
| 58 | use the same preprocessor/parser/ASTs as the compiler itself, giving it a very |
| 59 | rich understanding of the code.</li> |
| 60 | |
| 61 | <li><b>Use clang libraries to implement better versions of existing tools</b>: |
| 62 | Clang is built as a set of libraries, which means that it is possible to |
| 63 | implement capabilities similar to other source language tools, improving them |
| 64 | in various ways. Two examples are <a href="http://distcc.samba.org/">distcc</a> |
| 65 | and the <a href="http://delta.tigris.org/">delta testcase reduction tool</a>. |
| 66 | The former can be improved to scale better and be more efficient. The later |
| 67 | could also be faster and more efficient at reducing C-family programs if built |
| 68 | on the clang preprocessor.</li> |
| 69 | |
| 70 | <li><b>Use clang libraries to extend Ragel with a JIT</b>: <a |
| 71 | href="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state |
| 72 | machine compiler that lets you embed C code into state machines and generate |
| 73 | C code. It would be relatively easy to turn this into a JIT compiler using |
| 74 | LLVM.</li> |
| 75 | |
| 76 | <li><b>Self-testing using clang</b>: There are several neat ways to |
| 77 | improve the quality of clang by self-testing. Some examples: |
| 78 | <ul> |
| 79 | <li>Improve the reliability of AST printing and serialization by |
| 80 | ensuring that the AST produced by clang on an input doesn't change |
| 81 | when it is reparsed or unserialized. |
| 82 | |
| 83 | <li>Improve parser reliability and error generation by automatically |
| 84 | or randomly changing the input checking that clang doesn't crash and |
| 85 | that it doesn't generate excessive errors for small input |
| 86 | changes. Manipulating the input at both the text and token levels is |
| 87 | likely to produce interesting test cases. |
| 88 | </ul> |
| 89 | </li> |
| 90 | |
| 91 | </ul> |
| 92 | |
| 93 | <p>If you hit a bug with clang, it is very useful for us if you reduce the code |
| 94 | that demonstrates the problem down to something small. There are many ways to |
| 95 | do this; ask on cfe-dev for advice.</p> |
| 96 | |
| 97 | </div> |
| 98 | </body> |
| 99 | </html> |