From: Chris Lattner Date: Mon, 20 Apr 2009 04:23:09 +0000 (+0000) Subject: initial skeleton of a user's manual. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf17d9d9c0c0c931478807cc020c8ab1c2cc296a;p=clang initial skeleton of a user's manual. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69568 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/UsersManual.html b/docs/UsersManual.html new file mode 100644 index 0000000000..8f8951f87e --- /dev/null +++ b/docs/UsersManual.html @@ -0,0 +1,259 @@ + + +Clang Compiler User's Manual + + + + + + + + +
+ +

Clang Compiler User's Manual

+ + + + + +

Introduction

+ + +

The Clang Compiler is an open-source compiler for the C family of programming +languages, aiming to be the best in class implementation of these languages. +Clang builds on the LLVM optimizer and code generator, allowing it to provide +high-quality optimization and code generation support for many targets. For +more general information, please see the Clang +Web Site or the LLVM Web Site.

+ +

This document describes important notes about using Clang as a compiler for +an end-user, documenting the supported features, command line options, etc. If +you are interested in using Clang to build a tool that processes code, please +see the Clang Internals Manual. If you are +interested in the Clang +Static Analyzer, please see its web page.

+ +

Clang is designed to support the C family of programming languages, which +includes C, Objective-C, C++, and Objective-C++ as well as many +dialects of those. For language-specific information, please see the +corresponding language specific section:

+ + + +

In addition to these base languages and their dialects, Clang supports a +broad variety of language extensions, which are documented in the corresponding +language section. These extensions are provided to be compatible with the GCC, +Microsoft, and other popular compilers as well as to improve functionality +through Clang-specific features. The Clang driver and language features are +intentionally designed to be as compatible with the GNU GCC compiler as +reasonably possible, easing migration from GCC to Clang. In most cases, code +"just works".

+ +

In addition to language specific features, Clang has a variety of features +that depend on what CPU architecture or operating system is being compiled for. +Please see the Target-Specific Features and +Limitations section for more details.

+ +

The rest of the introduction introduces some basic compiler terminology that is used throughout this manual +and contains a basic introduction to using Clang +as a command line compiler.

+ + +

Terminology

+ + +

Front end, parser, backend, preprocessor, undefined behavior, diagnostic, + optimizer

+ + +

Basic Usage

+ + +

Intro to how to use a C compiler for newbies.

+

+compile + link + +compile then link + +debug info + +enabling optimizations + +picking a language to use, defaults to C99 by default. Autosenses based on +extension. + +using a makefile +

+ + + +

Command Line Options

+ + +

+This section is generally an index into other sections. It does not go into +depth on most. However, the first part introduces the language selection and +other high level options like -c, -g, etc. +

+ + +

Language and Target-Independent Features

+ + + + +

Controlling Errors and Warnings

+ + + + +

Precompiled Headers

+ + + + + +

C Language Features

+ + + + +

Intentional Incompatibilities with GCC

+ + +

No VLAs in structs.

+ + + + + +

Objective-C Language Features

+ + + + +

Intentional Incompatibilities with GCC

+ + +

No cast of super, no lvalue casts.

+ + + + +

C++ Language Features

+ + +

At this point, Clang C++ is not generally useful. However, Clang C++ support +is under active development and is progressing rapidly. Please see the C++ Status page for details or +ask on the mailing list about how you can help.

+ +

Note that the clang driver will refuse to even try to use clang to compile +C++ code unless you pass the -ccc-clang-cxx option to the driver. If +you really want to play with Clang's C++ support, please pass that flag.

+ + +

Objective C++ Language Features

+ + +

At this point, Clang C++ support is not generally useful (and therefore, +neither is Objective-C++). Please see the C++ section for +more information.

+ + +

Target-Specific Features and Limitations

+ + + + +

CPU Architectures Features and Limitations

+ + + +

X86

+ + + + +

Operating System Features and Limitations

+ + + +

Darwin (Mac OS/X)

+ + +

No __thread support, 64-bit ObjC support requires SL tools.

+ +
+ +