From: NAKAMURA Takumi Date: Fri, 18 Mar 2011 03:21:38 +0000 (+0000) Subject: www/hacking.html: Cosmetic change, to detabify, eliminate whitespace, and add proper... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6975d07a6cf5a689a40e1ddecb252c2bd8e90c5d;p=clang 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 --- diff --git a/www/hacking.html b/www/hacking.html index 978c99f141..d6dbe80cfe 100644 --- a/www/hacking.html +++ b/www/hacking.html @@ -1,4 +1,4 @@ - @@ -14,7 +14,7 @@

Hacking on Clang

- +

This document provides some hints for how to get started hacking on Clang for developers who are new to the Clang and/or LLVM codebases.

@@ -24,18 +24,18 @@
  • Debugging
  • Testing
  • +
  • Testing on Unix-like Systems
  • +
  • Testing using Visual Studio on Windows
  • +
  • Testing on the Command Line
  • +
  • Creating Patch Files
  • LLVM IR Generation
  • - +

    Coding Standards

    - +

    Clang follows the LLVM Coding Standards. When submitting patches, please take care to follow these standards @@ -56,14 +56,14 @@

    Developer Documentation

    - +

    Both Clang and LLVM use doxygen to provide API documentation. Their respective web pages (generated nightly) are here:

    - +

    For work on the LLVM IR generation, the LLVM assembly language reference manual is also useful.

    @@ -71,7 +71,7 @@

    Debugging

    - +

    Inspecting data structures in a debugger:

    - +

    Testing

    - +

    [Note: The test running mechanism is currently under revision, so the following might change shortly.]

    - +

    Testing on Unix-like Systems

    - +

    Clang includes a basic regression suite in the tree which can be run with make test from the top-level clang directory, or just make in the test sub-directory. @@ -113,15 +113,15 @@ the test runner that an error is expected at the current line. Any output files produced by the test will be placed under a created Output directory.

    - +

    During the run of make test, the terminal output will display a line similar to the following:

    - + - +

    followed by a line continually overwritten with the current test file being compiled, and an overall completion percentage.

    - +

    After the make test run completes, the absence of any Failing Tests (count): message indicates that no tests failed unexpectedly. If any tests did fail, the @@ -148,38 +148,38 @@ override LLVMGCC, as in: make LLVMGCC="clang -std=gnu89" TEST=nightly report (make sure clang is in your PATH or use the full path).

    - +

    Testing using Visual Studio on Windows

    The Clang test suite can be run from either Visual Studio or the command line.

    - +

    Note that the test runner is based on Python, which must be installed. Find Python at: - http://www.python.org/download. + http://www.python.org/download/. Download the latest stable version (2.6.2 at the time of this writing).

    - +

    The GnuWin32 tools are also necessary for running 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 grep does work in this case.) - Get them from - http://getgnuwin32.sourceforge.net.

    - + Get them from + http://getgnuwin32.sourceforge.net/.

    +

    The cmake build tool is set up to create Visual Studio project files for running the tests, "clang-test" being the root. Therefore, to run the test from Visual Studio, right-click the clang-test project and select "Build".

    - +

    Testing on the Command Line

    To run all the tests from the command line, execute a command like the following:

    - + python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar (path to llvm)/llvm/tools/clang/test @@ -190,14 +190,14 @@ --param=build_config=(build config).

    To run a single test:

    - + python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar (path to llvm)/llvm/tools/clang/test/(dir)/(test)

    For example:

    - + python C:/Tools/llvm/utils/lit/lit.py -sv --no-progress-bar C:/Tools/llvm/tools/clang/test/Sema/wchar.c @@ -215,7 +215,7 @@ Testing Time: 81.52s Expected Passes : 2503 Expected Failures : 28 Unsupported Tests : 3 - +

    The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.

    @@ -230,18 +230,18 @@ Testing Time: 81.52s you are doing, such as if you are new to Clang development, you can use the cfe-dev mailing list also.

    - +

    To create these patch files, change directory to the llvm/tools/clang root and run:

    - +

    For example, for getting the diffs of all of clang:

    - +

    For example, for getting the diffs of a single file:

    - +

    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 "codegen", and the Clang code for this lives in lib/CodeGen.

    - +

    The output is most easily inspected using the -emit-llvm option to clang (possibly in conjunction with -o -). You can also use -emit-llvm-bc to write an LLVM bitcode file