www/hacking.html: Cosmetic change, to detabify, eliminate whitespace, and add proper slashes to URL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2011-03-18 03:21:38 +00:00
Родитель b8bcce37b7
Коммит 6975d07a6c
1 изменённых файлов: 36 добавлений и 36 удалений

Просмотреть файл

@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html> <html>
@ -14,7 +14,7 @@
<!--*********************************************************************--> <!--*********************************************************************-->
<h1>Hacking on Clang</h1> <h1>Hacking on Clang</h1>
<!--*********************************************************************--> <!--*********************************************************************-->
<p>This document provides some hints for how to get started hacking <p>This document provides some hints for how to get started hacking
on Clang for developers who are new to the Clang and/or LLVM on Clang for developers who are new to the Clang and/or LLVM
codebases.</p> codebases.</p>
@ -24,18 +24,18 @@
<li><a href="#debugging">Debugging</a></li> <li><a href="#debugging">Debugging</a></li>
<li><a href="#testing">Testing</a></li> <li><a href="#testing">Testing</a></li>
<ul> <ul>
<li><a href="#testingNonWindows">Testing on Unix-like Systems</a></li> <li><a href="#testingNonWindows">Testing on Unix-like Systems</a></li>
<li><a href="#testingWindows">Testing using Visual Studio on Windows</a></li> <li><a href="#testingWindows">Testing using Visual Studio on Windows</a></li>
<li><a href="#testingCommands">Testing on the Command Line</a></li> <li><a href="#testingCommands">Testing on the Command Line</a></li>
</ul> </ul>
<li><a href="#patches">Creating Patch Files</a></li> <li><a href="#patches">Creating Patch Files</a></li>
<li><a href="#irgen">LLVM IR Generation</a></li> <li><a href="#irgen">LLVM IR Generation</a></li>
</ul> </ul>
<!--=====================================================================--> <!--=====================================================================-->
<h2 id="docs">Coding Standards</h2> <h2 id="docs">Coding Standards</h2>
<!--=====================================================================--> <!--=====================================================================-->
<p>Clang follows the <p>Clang follows the
LLVM <a href="http://llvm.org/docs/CodingStandards.html">Coding LLVM <a href="http://llvm.org/docs/CodingStandards.html">Coding
Standards</a>. When submitting patches, please take care to follow these standards Standards</a>. When submitting patches, please take care to follow these standards
@ -56,14 +56,14 @@
<!--=====================================================================--> <!--=====================================================================-->
<h2 id="docs">Developer Documentation</h2> <h2 id="docs">Developer Documentation</h2>
<!--=====================================================================--> <!--=====================================================================-->
<p>Both Clang and LLVM use doxygen to provide API documentation. Their <p>Both Clang and LLVM use doxygen to provide API documentation. Their
respective web pages (generated nightly) are here:</p> respective web pages (generated nightly) are here:</p>
<ul> <ul>
<li><a href="http://clang.llvm.org/doxygen">Clang</a></li> <li><a href="http://clang.llvm.org/doxygen">Clang</a></li>
<li><a href="http://llvm.org/doxygen">LLVM</a></li> <li><a href="http://llvm.org/doxygen">LLVM</a></li>
</ul> </ul>
<p>For work on the LLVM IR generation, the LLVM assembly language <p>For work on the LLVM IR generation, the LLVM assembly language
<a href="http://llvm.org/docs/LangRef.html">reference manual</a> is <a href="http://llvm.org/docs/LangRef.html">reference manual</a> is
also useful.</p> also useful.</p>
@ -71,7 +71,7 @@
<!--=====================================================================--> <!--=====================================================================-->
<h2 id="debugging">Debugging</h2> <h2 id="debugging">Debugging</h2>
<!--=====================================================================--> <!--=====================================================================-->
<p>Inspecting data structures in a debugger:</p> <p>Inspecting data structures in a debugger:</p>
<ul> <ul>
<li>Many LLVM and Clang data structures provide <li>Many LLVM and Clang data structures provide
@ -84,18 +84,18 @@
qualifiers, and the <tt>getTypePtr()</tt> method to get the qualifiers, and the <tt>getTypePtr()</tt> method to get the
wrapped <tt>Type*</tt> which you can then dump.</li> wrapped <tt>Type*</tt> which you can then dump.</li>
</ul> </ul>
<!--=====================================================================--> <!--=====================================================================-->
<h2 id="testing">Testing</h2> <h2 id="testing">Testing</h2>
<!--=====================================================================--> <!--=====================================================================-->
<p><i>[Note: The test running mechanism is currently under revision, so the <p><i>[Note: The test running mechanism is currently under revision, so the
following might change shortly.]</i></p> following might change shortly.]</i></p>
<!--=====================================================================--> <!--=====================================================================-->
<h3 id="testingNonWindows">Testing on Unix-like Systems</h3> <h3 id="testingNonWindows">Testing on Unix-like Systems</h3>
<!--=====================================================================--> <!--=====================================================================-->
<p>Clang includes a basic regression suite in the tree which can be <p>Clang includes a basic regression suite in the tree which can be
run with <tt>make test</tt> from the top-level clang directory, or run with <tt>make test</tt> from the top-level clang directory, or
just <tt>make</tt> in the <em>test</em> sub-directory. just <tt>make</tt> in the <em>test</em> sub-directory.
@ -113,15 +113,15 @@
the test runner that an error is expected at the current line. the test runner that an error is expected at the current line.
Any output files produced by the test will be placed under Any output files produced by the test will be placed under
a created Output directory.</p> a created Output directory.</p>
<p>During the run of <tt>make test</tt>, the terminal output will <p>During the run of <tt>make test</tt>, the terminal output will
display a line similar to the following:</p> display a line similar to the following:</p>
<ul><tt>--- Running clang tests for i686-pc-linux-gnu ---</tt></ul> <ul><tt>--- Running clang tests for i686-pc-linux-gnu ---</tt></ul>
<p>followed by a line continually overwritten with the current test <p>followed by a line continually overwritten with the current test
file being compiled, and an overall completion percentage.</p> file being compiled, and an overall completion percentage.</p>
<p>After the <tt>make test</tt> run completes, the absence of any <p>After the <tt>make test</tt> run completes, the absence of any
<tt>Failing Tests (count):</tt> message indicates that no tests <tt>Failing Tests (count):</tt> message indicates that no tests
failed unexpectedly. If any tests did fail, the failed unexpectedly. If any tests did fail, the
@ -148,38 +148,38 @@
override LLVMGCC, as in: <tt>make LLVMGCC="clang -std=gnu89" override LLVMGCC, as in: <tt>make LLVMGCC="clang -std=gnu89"
TEST=nightly report</tt> (make sure <tt>clang</tt> is in your PATH or use the TEST=nightly report</tt> (make sure <tt>clang</tt> is in your PATH or use the
full path).</p> full path).</p>
<!--=====================================================================--> <!--=====================================================================-->
<h3 id="testingWindows">Testing using Visual Studio on Windows</h3> <h3 id="testingWindows">Testing using Visual Studio on Windows</h3>
<!--=====================================================================--> <!--=====================================================================-->
<p>The Clang test suite can be run from either Visual Studio or <p>The Clang test suite can be run from either Visual Studio or
the command line.</p> the command line.</p>
<p>Note that the test runner is based on <p>Note that the test runner is based on
Python, which must be installed. Find Python at: Python, which must be installed. Find Python at:
<a href="http://www.python.org/download">http://www.python.org/download</a>. <a href="http://www.python.org/download/">http://www.python.org/download/</a>.
Download the latest stable version (2.6.2 at the time of this writing).</p> Download the latest stable version (2.6.2 at the time of this writing).</p>
<p>The GnuWin32 tools are also necessary for running the tests. <p>The GnuWin32 tools are also necessary for running the tests.
(Note that the grep from MSYS or Cygwin doesn't work with the tests (Note that the grep from MSYS or Cygwin doesn't work with the tests
because of embedded double-quotes in the search strings. The GNU because of embedded double-quotes in the search strings. The GNU
grep does work in this case.) grep does work in this case.)
Get them from <a href="http://getgnuwin32.sourceforge.net"> Get them from <a href="http://getgnuwin32.sourceforge.net/">
http://getgnuwin32.sourceforge.net</a>.</p> http://getgnuwin32.sourceforge.net/</a>.</p>
<p>The cmake build tool is set up to create Visual Studio project files <p>The cmake build tool is set up to create Visual Studio project files
for running the tests, "clang-test" being the root. Therefore, to for running the tests, "clang-test" being the root. Therefore, to
run the test from Visual Studio, right-click the clang-test project run the test from Visual Studio, right-click the clang-test project
and select "Build".</p> and select "Build".</p>
<!--=====================================================================--> <!--=====================================================================-->
<h3 id="testingCommands">Testing on the Command Line</h3> <h3 id="testingCommands">Testing on the Command Line</h3>
<!--=====================================================================--> <!--=====================================================================-->
<p>To run all the tests from the command line, execute a command like <p>To run all the tests from the command line, execute a command like
the following:</p> the following:</p>
<tt> <tt>
python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
(path to llvm)/llvm/tools/clang/test (path to llvm)/llvm/tools/clang/test
@ -190,14 +190,14 @@
<tt>--param=build_config=(build config)</tt>.</p> <tt>--param=build_config=(build config)</tt>.</p>
<p>To run a single test:</p> <p>To run a single test:</p>
<tt> <tt>
python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
(path to llvm)/llvm/tools/clang/test/(dir)/(test) (path to llvm)/llvm/tools/clang/test/(dir)/(test)
</tt> </tt>
<p>For example:</p> <p>For example:</p>
<tt> <tt>
python C:/Tools/llvm/utils/lit/lit.py -sv --no-progress-bar python C:/Tools/llvm/utils/lit/lit.py -sv --no-progress-bar
C:/Tools/llvm/tools/clang/test/Sema/wchar.c C:/Tools/llvm/tools/clang/test/Sema/wchar.c
@ -215,7 +215,7 @@ Testing Time: 81.52s
Expected Passes : 2503 Expected Passes : 2503
Expected Failures : 28 Expected Failures : 28
Unsupported Tests : 3 Unsupported Tests : 3
</pre></tt> </pre></tt>
<p>The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.</p> <p>The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.</p>
@ -230,18 +230,18 @@ Testing Time: 81.52s
you are doing, such as if you are new to Clang development, you can use you are doing, such as if you are new to Clang development, you can use
the cfe-dev mailing list also. the cfe-dev mailing list also.
</p> </p>
<p>To create these patch files, change directory <p>To create these patch files, change directory
to the llvm/tools/clang root and run:</p> to the llvm/tools/clang root and run:</p>
<ul><tt>svn diff (relative path) >(patch file name)</tt></ul> <ul><tt>svn diff (relative path) >(patch file name)</tt></ul>
<p>For example, for getting the diffs of all of clang:</p> <p>For example, for getting the diffs of all of clang:</p>
<ul><tt>svn diff . >~/mypatchfile.patch</tt></ul> <ul><tt>svn diff . >~/mypatchfile.patch</tt></ul>
<p>For example, for getting the diffs of a single file:</p> <p>For example, for getting the diffs of a single file:</p>
<ul><tt>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</tt></ul> <ul><tt>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</tt></ul>
<p>Note that the paths embedded in the patch depend on where you run it, <p>Note that the paths embedded in the patch depend on where you run it,
@ -256,7 +256,7 @@ Testing Time: 81.52s
Representation (IR). Historically, this was referred to as Representation (IR). Historically, this was referred to as
"codegen", and the Clang code for this lives "codegen", and the Clang code for this lives
in <tt>lib/CodeGen</tt>.</p> in <tt>lib/CodeGen</tt>.</p>
<p>The output is most easily inspected using the <tt>-emit-llvm</tt> <p>The output is most easily inspected using the <tt>-emit-llvm</tt>
option to clang (possibly in conjunction with <tt>-o -</tt>). You option to clang (possibly in conjunction with <tt>-o -</tt>). You
can also use <tt>-emit-llvm-bc</tt> to write an LLVM bitcode file can also use <tt>-emit-llvm-bc</tt> to write an LLVM bitcode file