--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" \r
+ "http://www.w3.org/TR/html4/strict.dtd">\r
+<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->\r
+<html>\r
+<head>\r
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
+ <title>Hacking on clang</title>\r
+ <link type="text/css" rel="stylesheet" href="menu.css" />\r
+ <link type="text/css" rel="stylesheet" href="content.css" />\r
+</head>\r
+<body>\r
+<!--#include virtual="menu.html.incl"-->\r
+<div id="content">\r
+ <!--*********************************************************************-->\r
+ <h1>Hacking on Clang</h1>\r
+ <!--*********************************************************************-->\r
+ \r
+ <p>This document provides some hints for how to get started hacking\r
+ on Clang for developers who are new to the Clang and/or LLVM\r
+ codebases.\r
+ <ul>\r
+ <li><a href="#docs">Developer Documentation</a></li>\r
+ <li><a href="#debugging">Debugging</a></li>\r
+ <li><a href="#irgen">LLVM IR Generation</a></li>\r
+ </ul>\r
+ </p>\r
+ \r
+ <!--=====================================================================-->\r
+ <h2 id="debugging">Developer Documentation</h2>\r
+ <!--=====================================================================-->\r
+ \r
+ <p>Both Clang and LLVM use doxygen to provide API documentation. Their\r
+ respective web pages (generated nightly) are here:\r
+ <ul>\r
+ <li><a href="http://clang.llvm.org/doxygen">Clang</a></li>\r
+ <li><a href="http://llvm.org/doxygen">LLVM</a></li>\r
+ </ul>\r
+ </p>\r
+ \r
+ <p>For work on the LLVM IR generation, the LLVM assembly language\r
+ <a href="http://llvm.org/docs/LangRef.html">reference manual</a> is\r
+ also useful.</p>\r
+\r
+ <!--=====================================================================-->\r
+ <h2 id="debugging">Debugging</h2>\r
+ <!--=====================================================================-->\r
+ \r
+ <p>Inspecting data structures in a debugger:\r
+ <ul>\r
+ <li>Many LLVM and Clang data structures provide\r
+ a <tt>dump()</tt> method which will print a description of the\r
+ data structure to <tt>stderr</tt>.</li>\r
+ <li>The <a href="docs/InternalsManual.html#QualType"><tt>QualType</tt></a>\r
+ structure is used pervasively. This is a simple value class for\r
+ wrapping types with qualifiers; you can use\r
+ the <tt>isConstQualified()</tt>, for example, to get one of the\r
+ qualifiers, and the <tt>getTypePtr()</tt> method to get the\r
+ wrapped <tt>Type*</tt> which you can then dump.</li>\r
+ </ul>\r
+ </p>\r
+ \r
+ <!--=====================================================================-->\r
+ <h2 id="irgen">LLVM IR Generation</h2>\r
+ <!--=====================================================================-->\r
+\r
+ <p>The LLVM IR generation part of clang handles conversion of the\r
+ AST nodes output by the Sema module to the LLVM Intermediate\r
+ Representation (IR). Historically, this was referred to as\r
+ "codegen", and the Clang code for this lives\r
+ in <tt>lib/CodeGen</tt>.</p>\r
+ \r
+ <p>The output is most easily inspected using the <tt>-emit-llvm</tt>\r
+ option to clang (possibly in conjunction with <tt>-o -</tt>). You\r
+ can also use <tt>-emit-llvm-bc</tt> to write an LLVM bitcode file\r
+ which can be processed by the suite of LLVM tools\r
+ like <tt>llvm-dis</tt>, <tt>llvm-nm</tt>, etc. See the LLVM\r
+ <a href="http://llvm.org/docs/CommandGuide/">Command Guide</tt>\r
+ for more information.</p>\r
+\r
+</div>\r
+</body>\r
+</html>\r