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