]> granicus.if.org Git - clang/commitdiff
Start a "hacking" page with some simple notes on getting started
authorDaniel Dunbar <daniel@zuster.org>
Thu, 13 Nov 2008 22:49:41 +0000 (22:49 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 13 Nov 2008 22:49:41 +0000 (22:49 +0000)
developing clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59270 91177308-0d34-0410-b5e6-96231b3b80d8

www/hacking.html [new file with mode: 0644]
www/menu.html.incl

diff --git a/www/hacking.html b/www/hacking.html
new file mode 100644 (file)
index 0000000..d70538d
--- /dev/null
@@ -0,0 +1,82 @@
+<!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
index 679e34a7884431c1c88e1ac91818962bacb91c5b..03b0967c9820169c89d9544332a84e1d23b63126 100644 (file)
@@ -12,6 +12,7 @@
     <a href="/get_involved.html">Get&nbsp;Involved</a>\r
     <a href="/cxx_status.html">C++ Status</a>\r
     <a href="/docs/InternalsManual.html">Clang&nbsp;Internals</a>\r
+    <a href="/hacking.html">Hacking on Clang</a>\r
     <a href="/performance.html">Performance</a>\r
   </div>\r
   \r