diff --git a/clang/www/get_started.html b/clang/www/get_started.html index 437cb38808f8..d8b279134e1c 100644 --- a/clang/www/get_started.html +++ b/clang/www/get_started.html @@ -43,6 +43,8 @@ mailing list.

Building Clang and Working with the Code

+

On Unix-like Systems

+

If you would like to check out and build Clang, the current procedure is as follows:

@@ -120,6 +122,65 @@ and all (possibly unrelated) projects inside it with make update. This will run svn update on all subdirectories related to subversion.

+

Using Visual Studio

+ +

The following details setting up for and building Clang on Windows using +Visual Studio:

+ +
    +
  1. Get the required tools:
  2. + + +
  3. Checkout LLVM:
  4. + +
  5. Checkout Clang:
  6. + +
  7. Run cmake to generate the Visual Studio solution and project files:
  8. + +
  9. Build Clang:
  10. + +
  11. Try it out (assuming you added llvm/debug/bin to your path). (See the + running examples from above.)
  12. +
  13. See + Hacking on clang - Testing using Visual Studio on Windows for information + on running regression tests on Windows.
  14. +
+ +

Note that once you have checked out both llvm and clang, to synchronize +to the latest code base, use the svn update command in both the +llvm and llvm\tools\clang directories, as they are separate repositories.

+

High-Level Compiler Driver (Drop-in Substitute for GCC)

While the clang-cc executable is a low-level frontend executable diff --git a/clang/www/hacking.html b/clang/www/hacking.html index db83861502ba..6b458b7759e3 100644 --- a/clang/www/hacking.html +++ b/clang/www/hacking.html @@ -22,6 +22,11 @@

  • Developer Documentation
  • Debugging
  • Testing
  • + +
  • Creating Patch Files
  • LLVM IR Generation
  • @@ -61,13 +66,53 @@

    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. make - report can be used after running the tests to summarize the - results, and make VERBOSE=1 can be used to show more detail + just make in the test sub-directory. + make VERBOSE=1 can be used to show more detail about what is being run.

    +

    The tests primarily consist of a test runner script running the compiler + under test on individual test files grouped in the directories under the + test directory. The individual test files include comments at the + beginning indicating the Clang compile options to use, to be read + by the test runner. Embedded comments also can do things like telling + 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 + Failing Tests (count): message will be followed by a list + of the test source file paths that failed. For example:

    + +
    +  Failing Tests (3):
    +      /home/john/llvm/tools/clang/test/SemaCXX/member-name-lookup.cpp
    +      /home/john/llvm/tools/clang/test/SemaCXX/namespace-alias.cpp
    +      /home/john/llvm/tools/clang/test/SemaCXX/using-directive.cpp
    +  
    + +

    If you used the make VERBOSE=1 option, the terminal + output will reflect the error messages from the compiler and + test runner.

    +

    The regression suite can also be run with Valgrind by running make test VG=1 in the top-level clang directory.

    @@ -77,6 +122,48 @@ override LLVMGCC, as in: make LLVMGCC="ccc -std=gnu89" TEST=nightly report (make sure ccc is in your PATH or use the full path).

    + + +

    Testing using Visual Studio on Windows

    + + +

    The cmake build tool is set up to create Visual Studio project files + for running the tests, "clang-test" being the root. + Unfortunately, the test runner scripts presently don't work on Windows. + This will be fixed during the test runner revision in progress.

    + +

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

    + + +

    Creating Patch Files

    + + +

    To return changes to the Clang team, unless you have checkin + privileges, the prefered way is to send patch files to the + cfe-commits mailing list, with an explanation of what the patch is for. + Or, if you have questions, or want to have a wider discussion of what + 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, + so changing directory to the llvm/tools/clang directory is recommended.

    LLVM IR Generation