From 623ec629c8f187c8dccf4419215d06b432994425 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 13 Dec 2007 06:20:15 +0000 Subject: [PATCH] split get_involved into two pages: get_started and get_involved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44988 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/get_involved.html | 231 +++++++++--------------------------------- www/get_started.html | 192 +++++++++++++++++++++++++++++++++++ www/index.html | 27 ++--- www/menu.html.incl | 5 +- 4 files changed, 259 insertions(+), 196 deletions(-) create mode 100644 www/get_started.html diff --git a/www/get_involved.html b/www/get_involved.html index 76b862b125c6..9ad9cb2abb1c 100644 --- a/www/get_involved.html +++ b/www/get_involved.html @@ -13,206 +13,73 @@
-

Getting Involved

+

Getting Involved with the Clang Project

-

There are many tasks that are open to new developers who want to get involved -with the Clang project. Below, you will find details on how to get started with -Clang, plus a few tasks that we need help with.

+

Once you have checked out and built clang and +played around with it, you might be wondering what you can do to make it better +and contribute to its development. Alternatively, maybe you just want to follow +the development of the project to see it progress. +

-

Please note that the information provided here is not completely thorough. -This is intentional. If you plan to work on Clang, we would like you to get -involved with the other developers. This will allow us to work together better -and will give you a better feel for how things are done.

- -

You can talk with other developers at the following mailing list: cfe-dev mailing -list. The clang mailing list is a very friendly place. You can see the -archives for records of past discussion. Note that a significant amount of -design discussion takes place on the cfe-commits mailing -list.

- -

Getting Started

- -

A word of warning

+

Follow what's going on

-

While this work aims to provide a fully functional C/C++/ObjC front-end, it -is still very early work and is under heavy development. In particular, -there is no real C++ support yet (this is obviously a big project), and C/ObjC -support is still missing some features. Some of the more notable missing pieces -of C support are:

+

Clang is a subproject of the LLVM Project, but +has its own mailing lists because the communities have people with different +interests. The two clang lists are:

-
    -
  1. The semantic analyzer does not produce all of the warnings and errors it - should.
  2. -
  3. The LLVM code generator is still very early on. It does not support many - important things, like any support for structs and unions. That said, it - does handle scalar operations and vectors. clang is not ready to be used - as a general purpose C code generator yet.
  4. -
  5. We don't consider the API to be stable yet, and reserve the right to - change fundamental things. :)
  6. -
+ -

Clang is a subproject of the LLVM Project, but -has its own mailing lists because the communities have people with different -interests. If you are interested in clang only, these two lists should be all +

If you are interested in clang only, these two lists should be all you need. If you are interested in the LLVM optimizer and code generator, please consider signing up for llvmdev and llvm-commits as well.

- +

The best way to talk with other developers on the project is through the cfe-dev mailing +list. The clang mailing list is a very friendly place and we welcome +newcomers. In addition to the cfe-dev list, a significant amount of design +discussion takes place on the cfe-commits mailing +list. All of these lists have archives, so you can browse through previous +discussions or follow the list development on the web if you prefer.

+ + +

Open Projects

+ +

Here are a few tasks that are available for newcomers to work on. This list +is provided to generate ideas, it is not intended to be comprehensive. Please +ask on cfe-dev for more specifics or to verify that one of these isn't already +completed. :)

+ +

Please note that the information provided here is not completely thorough. +This is intentional. If you plan to work on Clang, we would like you to get +involved with the other developers. This will allow us to work together better +and will give you a better feel for how things are done.

-

Building clang / working with the code

- -

If you would like to check out and build the project, the current scheme -is:

- -
    -
  1. Checkout - and build LLVM from SVN head:
  2. - -
      -
    • svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    • -
    • cd llvm
    • -
    • ./configure; make
    • -
    -
  3. Checkout clang:
  4. -
      -
    • From within the llvm directory (where you - built llvm):
    • -
    • cd llvm/tools -
    • svn co - http://llvm.org/svn/llvm-project/cfe/trunk clang
    • - -
    -
  5. Non-mac users: Paths to system header files are currently hard coded - into clang; as a result, if clang can't find your system headers, - please follow these instructions:
  6. - -
      -
    • 'touch empty.c; gcc -v empty.c -fsyntax-only' to get the - path.
    • -
    • Look for the comment "FIXME: temporary hack: - hard-coded paths" in clang/Driver/clang.cpp and - change the lines below to include that path.
    • -
    - -
  7. Build clang:
  8. -
      -
    • cd clang (assuming that you are in llvm/tools)
    • -
    • make
    • -
    - -
  9. Try it out (assuming you add llvm/Debug/bin to your path):
  10. -
      -
    • clang --help
    • -
    • clang file.c -fsyntax-only (check for correctness)
    • -
    • clang file.c -ast-dump (internal debug dump of ast)
    • -
    • clang file.c -ast-view (set up graphviz - and rebuild llvm first)
    • -
    • clang file.c -emit-llvm (print out unoptimized llvm code)
    • -
    • clang file.c -emit-llvm | llvm-as | opt -std-compile-opts | - llvm-dis (print out optimized llvm code)
    • -
    • clang file.c -emit-llvm | llvm-as | opt -std-compile-opts | llc - > file.s (output native machine code)
    • -
    -
- -

Note that the C front-end uses LLVM, but does not depend on - llvm-gcc. If you encounter problems with building clang, make - sure you have the latest SVN version of LLVM. LLVM contains - support libraries for clang that will be updated as well as - development on clang progresses.

- -

Examples of using clang

- -

The clang driver takes a lot of GCC compatible options, which you can see -with 'clang --help'. Here are a few examples:

- - -
-$ cat ~/t.c
-
-typedef float V __attribute__((vector_size(16)));
-V foo(V a, V b) { return a+b*a; }
-
-Preprocessing:
-$ clang ~/t.c -E
-# 1 "/Users/sabre/t.c" 1
-
-typedef float V __attribute__((vector_size(16)));
-
-V foo(V a, V b) { return a+b*a; }
-
-
-Type checking:
-$ clang -fsyntax-only ~/t.c
-
-
-GCC options:
-$ clang -fsyntax-only ~/t.c -pedantic
-/Users/sabre/t.c:2:17: warning: extension used
-typedef float V __attribute__((vector_size(16)));
-                ^
-1 diagnostic generated.
-
-
-
-Pretty printing from the AST:
-$ clang ~/t.c -ast-print
-typedef float V __attribute__(( vector_size(16) ));
-
-V foo(V a, V b) {
-   return a + b * a;
-}
-
-
-LLVM code generation:
-$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llvm-dis
-define <4 x float> @foo(<4 x float> %a, <4 x float> %b) {
-entry:
-         %mul = mul <4 x float> %b, %a
-         %add = add <4 x float> %mul, %a
-         ret <4 x float> %add
-}
-$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llc - 
-march=ppc32 -mcpu=g5
-..
-_foo:
-         vmaddfp v2, v3, v2, v2
-         blr
-$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llc - 
-march=x86 -mcpu=yonah
-..
-_foo:
-         mulps %xmm0, %xmm1
-         addps %xmm0, %xmm1
-         movaps %xmm1, %xmm0
-         ret
-
-

Available tasks

-Here are a few tasks that are currently available for newcomers to work on: +
diff --git a/www/get_started.html b/www/get_started.html new file mode 100644 index 000000000000..236df4dd097c --- /dev/null +++ b/www/get_started.html @@ -0,0 +1,192 @@ + + + + + Clang - Getting Started + + + + + + + +
+ +

Getting Started: Building and Running Clang

+ + +

This page gives you the shortest path to checking out clang and demos a few +options. This should get you up and running with the minimum of muss and fuss. +If you like what you see, please consider getting +involved with the clang community.

+ + +

A word of warning

+ +

While this work aims to provide a fully functional C/C++/ObjC front-end, it +is still very early work and is under heavy development. In particular, +there is no real C++ support yet (this is obviously a big project), and C/ObjC +support is still missing some features. Some of the more notable missing pieces +of C support are:

+ +
    +
  1. The semantic analyzer does not produce all of the warnings and errors it + should.
  2. +
  3. The LLVM code generator is still missing important features. clang is not + ready to be used as a general purpose C code generator yet, but if you + hit problems and report them to cfe-dev, we'll fix them :).
  4. +
  5. We don't consider the API to be stable yet, and reserve the right to + change fundamental things.
  6. +
+ +

Our plan is to continue chipping away at these issues until C works really +well, but we'd love help from other interested contributors. We expect C to be +in good shape by mid to late 2008.

+ +

Building clang / working with the code

+ +

If you would like to check out and build the project, the current scheme +is:

+ +
    +
  1. Checkout + and build LLVM from SVN head:
  2. + +
      +
    • svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    • +
    • cd llvm
    • +
    • ./configure; make
    • +
    +
  3. Checkout clang:
  4. +
      +
    • From within the llvm directory (where you + built llvm):
    • +
    • cd llvm/tools +
    • svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
    • + +
    +
  5. Non-mac users: Paths to system header files are currently hard coded + into clang; as a result, if clang can't find your system headers, + please follow these instructions:
  6. + +
      +
    • 'touch empty.c; gcc -v empty.c -fsyntax-only' to get the + path.
    • +
    • Look for the comment "FIXME: temporary hack: + hard-coded paths" in clang/Driver/clang.cpp and + change the lines below to include that path.
    • +
    + +
  7. Build clang:
  8. +
      +
    • cd clang (assuming that you are in llvm/tools)
    • +
    • make (this will give you a debug build)
    • +
    + +
  9. Try it out (assuming you add llvm/Debug/bin to your path):
  10. +
      +
    • clang --help
    • +
    • clang file.c -fsyntax-only (check for correctness)
    • +
    • clang file.c -ast-dump (internal debug dump of ast)
    • +
    • clang file.c -ast-view (set up graphviz + and rebuild llvm first)
    • +
    • clang file.c -emit-llvm (print out unoptimized llvm code)
    • +
    • clang file.c -emit-llvm | llvm-as | opt -std-compile-opts | + llvm-dis (print out optimized llvm code)
    • +
    • clang file.c -emit-llvm | llvm-as | opt -std-compile-opts | llc + > file.s (output native machine code)
    • +
    +
+ +

Note that the C front-end uses LLVM, but does not depend on + llvm-gcc. If you encounter problems with building clang, make + sure you have the latest SVN version of LLVM. LLVM contains + support libraries for clang that will be updated as well as + development on clang progresses.

+ +

Examples of using clang

+ +

The clang driver takes a lot of GCC compatible options, which you can see +with 'clang --help'. Here are a few examples:

+ + +
+$ cat ~/t.c
+typedef float V __attribute__((vector_size(16)));
+V foo(V a, V b) { return a+b*a; }
+
+ + +

Preprocessing:

+ +
+$ clang ~/t.c -E
+# 1 "/Users/sabre/t.c" 1
+
+typedef float V __attribute__((vector_size(16)));
+
+V foo(V a, V b) { return a+b*a; }
+
+ + +

Type checking:

+ +
+$ clang -fsyntax-only ~/t.c
+
+ + +

GCC options:

+ +
+$ clang -fsyntax-only ~/t.c -pedantic
+/Users/sabre/t.c:2:17: warning: extension used
+typedef float V __attribute__((vector_size(16)));
+                ^
+1 diagnostic generated.
+
+ + +

Pretty printing from the AST:

+ +
+$ clang ~/t.c -ast-print
+typedef float V __attribute__(( vector_size(16) ));
+V foo(V a, V b) {
+   return a + b * a;
+}
+
+ + +

Code generation with LLVM:

+ +
+$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llvm-dis
+define <4 x float> @foo(<4 x float> %a, <4 x float> %b) {
+entry:
+         %mul = mul <4 x float> %b, %a
+         %add = add <4 x float> %mul, %a
+         ret <4 x float> %add
+}
+$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llc -march=ppc32 -mcpu=g5
+..
+_foo:
+         vmaddfp v2, v3, v2, v2
+         blr
+$ clang ~/t.c -emit-llvm | llvm-as | opt -std-compile-opts | llc -march=x86 -mcpu=yonah
+..
+_foo:
+         mulps %xmm0, %xmm1
+         addps %xmm0, %xmm1
+         movaps %xmm1, %xmm0
+         ret
+
+ +
+ + diff --git a/www/index.html b/www/index.html index ae71376c7d37..647b768293d5 100644 --- a/www/index.html +++ b/www/index.html @@ -17,7 +17,8 @@

clang: a C language family frontend for LLVM

The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM - compiler.

+ compiler. You can get and build the source + today.

Features and Goals

@@ -38,7 +39,8 @@

Features and Goals

@@ -98,18 +100,19 @@

Current Status

respectable C++ support for another 2 years or so.

-

Get Involved

+

Get it and get involved!

-

The developers of Clang include contributers from Apple and numerous - other volunteers. If you are interested in joining the community or - learning more, please consider joining the cfe-dev - mailing list, or start by browsing its archives.

- -

If you are interested in trying out Clang, please see the build - instructions on the Get Involved - page.

+

Start by geting the code, building it, and + playing with it. This will show you the sorts of things we can do + today and will let you have the "clang experience" first hand: hopefully + it will "resonate" with you. :)

+ +

Once you've done that, please consider getting + involved in the clang community. The clang developers include numerous + volunteers as well as contributers from Apple. If you're interested in + following the development of clang, signing up for a mailing list is a good + way to learn about how the project works.

diff --git a/www/menu.html.incl b/www/menu.html.incl index 8843c2618e8c..04bb6ae5fbed 100644 --- a/www/menu.html.incl +++ b/www/menu.html.incl @@ -8,8 +8,9 @@ About Features Comparisons - Get Involved - Manual + Get Started + Get Involved + clang Internals