1*f4a2713aSLionel Sambuc<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 2*f4a2713aSLionel Sambuc "http://www.w3.org/TR/html4/strict.dtd"> 3*f4a2713aSLionel Sambuc<html> 4*f4a2713aSLionel Sambuc<head> 5*f4a2713aSLionel Sambuc <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 6*f4a2713aSLionel Sambuc <title>Clang - Get Involved</title> 7*f4a2713aSLionel Sambuc <link type="text/css" rel="stylesheet" href="menu.css"> 8*f4a2713aSLionel Sambuc <link type="text/css" rel="stylesheet" href="content.css"> 9*f4a2713aSLionel Sambuc</head> 10*f4a2713aSLionel Sambuc<body> 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambuc<!--#include virtual="menu.html.incl"--> 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc<div id="content"> 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc<h1>Open Clang Projects</h1> 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc<p>Here are a few tasks that are available for newcomers to work on, depending 19*f4a2713aSLionel Sambucon what your interests are. This list is provided to generate ideas, it is not 20*f4a2713aSLionel Sambucintended to be comprehensive. Please ask on cfe-dev for more specifics or to 21*f4a2713aSLionel Sambucverify that one of these isn't already completed. :)</p> 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc<ul> 24*f4a2713aSLionel Sambuc<li><b>Undefined behavior checking</b>: 25*f4a2713aSLionel SambucImprove and extend the runtime checks for undefined behavior which CodeGen 26*f4a2713aSLionel Sambucinserts for the various <tt>-fsanitize=</tt> modes. A lot of issues can already 27*f4a2713aSLionel Sambucbe caught, but there is more to do here.</li> 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc<li><b>Improve target support</b>: The current target interfaces are heavily 30*f4a2713aSLionel Sambucstubbed out and need to be implemented fully. See the FIXME's in TargetInfo. 31*f4a2713aSLionel SambucAdditionally, the actual target implementations (instances of TargetInfoImpl) 32*f4a2713aSLionel Sambucalso need to be completed.</li> 33*f4a2713aSLionel Sambuc 34*f4a2713aSLionel Sambuc<li><b>Implement an tool to generate code documentation</b>: Clang's 35*f4a2713aSLionel Sambuclibrary-based design allows it to be used by a variety of tools that reason 36*f4a2713aSLionel Sambucabout source code. One great application of Clang would be to build an 37*f4a2713aSLionel Sambucauto-documentation system like doxygen that generates code documentation from 38*f4a2713aSLionel Sambucsource code. The advantage of using Clang for such a tool is that the tool would 39*f4a2713aSLionel Sambucuse the same preprocessor/parser/ASTs as the compiler itself, giving it a very 40*f4a2713aSLionel Sambucrich understanding of the code. Clang is already able to read and understand 41*f4a2713aSLionel Sambucdoxygen markup, but cannot yet generate documentation from it.</li> 42*f4a2713aSLionel Sambuc 43*f4a2713aSLionel Sambuc<li><b>Use clang libraries to implement better versions of existing tools</b>: 44*f4a2713aSLionel SambucClang is built as a set of libraries, which means that it is possible to 45*f4a2713aSLionel Sambucimplement capabilities similar to other source language tools, improving them 46*f4a2713aSLionel Sambucin various ways. Three examples are <a 47*f4a2713aSLionel Sambuchref="http://distcc.samba.org/">distcc</a>, the <a 48*f4a2713aSLionel Sambuchref="http://delta.tigris.org/">delta testcase reduction tool</a>, and the 49*f4a2713aSLionel Sambuc"indent" source reformatting tool. 50*f4a2713aSLionel Sambucdistcc can be improved to scale better and be more efficient. Delta could be 51*f4a2713aSLionel Sambucfaster and more efficient at reducing C-family programs if built on the clang 52*f4a2713aSLionel Sambucpreprocessor. The clang-based indent replacement, 53*f4a2713aSLionel Sambuc<a href="http://clang.llvm.org/docs/ClangFormat.html">clang-format</a>, 54*f4a2713aSLionel Sambuccould be taught to handle simple structural rules like those in <a 55*f4a2713aSLionel Sambuchref="http://llvm.org/docs/CodingStandards.html#hl_earlyexit">the LLVM coding 56*f4a2713aSLionel Sambucstandards</a>.</li> 57*f4a2713aSLionel Sambuc 58*f4a2713aSLionel Sambuc<li><b>Use clang libraries to extend Ragel with a JIT</b>: <a 59*f4a2713aSLionel Sambuchref="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state 60*f4a2713aSLionel Sambucmachine compiler that lets you embed C code into state machines and generate 61*f4a2713aSLionel SambucC code. It would be relatively easy to turn this into a JIT compiler using 62*f4a2713aSLionel SambucLLVM.</li> 63*f4a2713aSLionel Sambuc 64*f4a2713aSLionel Sambuc<li><b>Self-testing using clang</b>: There are several neat ways to 65*f4a2713aSLionel Sambucimprove the quality of clang by self-testing. Some examples: 66*f4a2713aSLionel Sambuc<ul> 67*f4a2713aSLionel Sambuc <li>Improve the reliability of AST printing and serialization by 68*f4a2713aSLionel Sambuc ensuring that the AST produced by clang on an input doesn't change 69*f4a2713aSLionel Sambuc when it is reparsed or unserialized. 70*f4a2713aSLionel Sambuc 71*f4a2713aSLionel Sambuc <li>Improve parser reliability and error generation by automatically 72*f4a2713aSLionel Sambuc or randomly changing the input checking that clang doesn't crash and 73*f4a2713aSLionel Sambuc that it doesn't generate excessive errors for small input 74*f4a2713aSLionel Sambuc changes. Manipulating the input at both the text and token levels is 75*f4a2713aSLionel Sambuc likely to produce interesting test cases. 76*f4a2713aSLionel Sambuc</ul> 77*f4a2713aSLionel Sambuc</li> 78*f4a2713aSLionel Sambuc 79*f4a2713aSLionel Sambuc<li><b>Continue work on C++1y support</b>: 80*f4a2713aSLionel Sambuc C++98 and C++11 are feature-complete, but there are still several C++1y features to 81*f4a2713aSLionel Sambuc implement. Please see the <a href="cxx_status.html">C++ status report 82*f4a2713aSLionel Sambuc page</a> to find out what is missing.</li> 83*f4a2713aSLionel Sambuc 84*f4a2713aSLionel Sambuc<li><b>StringRef'ize APIs</b>: A thankless but incredibly useful project is 85*f4a2713aSLionel SambucStringRef'izing (converting to use <tt>llvm::StringRef</tt> instead of <tt>const 86*f4a2713aSLionel Sambucchar *</tt> or <tt>std::string</tt>) various clang interfaces. This generally 87*f4a2713aSLionel Sambucsimplifies the code and makes it more efficient.</li> 88*f4a2713aSLionel Sambuc 89*f4a2713aSLionel Sambuc<li><b>Universal Driver</b>: Clang is inherently a cross compiler. We would like 90*f4a2713aSLionel Sambucto define a new model for cross compilation which provides a great user 91*f4a2713aSLionel Sambucexperience -- it should be easy to cross compile applications, install support 92*f4a2713aSLionel Sambucfor new architectures, access different compilers and tools, and be consistent 93*f4a2713aSLionel Sambucacross different platforms. See the <a href="UniversalDriver.html">Universal 94*f4a2713aSLionel SambucDriver</a> web page for more information.</li> 95*f4a2713aSLionel Sambuc 96*f4a2713aSLionel Sambuc<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*f4a2713aSLionel Sambuc <ul> 98*f4a2713aSLionel Sambuc <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*f4a2713aSLionel Sambuc <li><i>Documented</i>, with appropriate Schema against which the output of Clang's XML formatter can be verified.</li> 100*f4a2713aSLionel Sambuc <li><i>Stable</i> across Clang versions.</li> 101*f4a2713aSLionel Sambuc </ul></li> 102*f4a2713aSLionel Sambuc 103*f4a2713aSLionel Sambuc<li><b>Configuration Manager</b>: Clang/LLVM works on a large number of 104*f4a2713aSLionel Sambucarchitectures and operating systems and can cross-compile to a similarly large 105*f4a2713aSLionel Sambucnumber of configurations, but the pitfalls of chosing the command-line 106*f4a2713aSLionel Sambucoptions, making sure the right sub-architecture is chosen and that the correct 107*f4a2713aSLionel Sambucoptional elements of your particular system can be a pain. 108*f4a2713aSLionel Sambuc 109*f4a2713aSLionel Sambuc<p>A tool that would investigate hosts and targets, and store the configuration 110*f4a2713aSLionel Sambucin files that can later be used by Clang itself to avoid command-line options, 111*f4a2713aSLionel Sambucespecially the ones regarding which target options to use, would greatle alleviate 112*f4a2713aSLionel Sambucthis problem. A simple tool, with little or no dependency on LLVM itself, that 113*f4a2713aSLionel Sambucwill investigate a target architecture by probing hardware, software, libraries 114*f4a2713aSLionel Sambucand compiling and executing code to identify all properties that would be relevant 115*f4a2713aSLionel Sambucto command-line options (VFP, SSE, NEON, ARM vs. Thumb etc), triple settings etc.</p> 116*f4a2713aSLionel Sambuc 117*f4a2713aSLionel Sambuc<p>The first stage is to build a CFLAGS for Clang that would produce code on the 118*f4a2713aSLionel Sambuccurrent Host to the identified Target.</p> 119*f4a2713aSLionel Sambuc 120*f4a2713aSLionel Sambuc<p>The second stage would be to produce a configuration file (that can be used 121*f4a2713aSLionel Sambucindependently of the Host) so that Clang can read it and not need a gazillion 122*f4a2713aSLionel Sambucof command-line options. Such file should be simple JSON / INI or anything that 123*f4a2713aSLionel Sambuca text editor could change.</p> 124*f4a2713aSLionel Sambuc</ul> 125*f4a2713aSLionel Sambuc 126*f4a2713aSLionel Sambuc<p>If you hit a bug with clang, it is very useful for us if you reduce the code 127*f4a2713aSLionel Sambucthat demonstrates the problem down to something small. There are many ways to 128*f4a2713aSLionel Sambucdo this; ask on cfe-dev for advice.</p> 129*f4a2713aSLionel Sambuc 130*f4a2713aSLionel Sambuc</div> 131*f4a2713aSLionel Sambuc</body> 132*f4a2713aSLionel Sambuc</html> 133