Chris Lattner | 22eb972 | 2006-06-18 05:43:12 | [diff] [blame^] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // C Language Family Front-end |
| 3 | //===----------------------------------------------------------------------===// |
| 4 | |
| 5 | I. Introduction: |
| 6 | |
| 7 | clang: noun |
| 8 | 1. A loud, resonant, metallic sound. |
| 9 | 2. The strident call of a crane or goose. |
| 10 | 3. C-language front-end toolkit. |
| 11 | |
| 12 | Why? |
| 13 | Supports Objective-C. |
| 14 | |
| 15 | |
| 16 | II. Current advantages over GCC: |
| 17 | |
| 18 | * Full column number support in diagnostics. |
| 19 | * Caret diagnostics. |
| 20 | * Full diagnostic customization by client (can format diagnostics however they |
| 21 | like, e.g. in an IDE or refactoring tool). |
| 22 | * Built as a framework, can be reused by multiple tools. |
| 23 | * All languages supported linked into same library (no cc1,cc1obj, ...). |
| 24 | * mmap's code in read-only, does not dirty the pages like GCC (mem footprint). |
| 25 | * BSD License, can be linked into non-GPL projects. |
| 26 | |
| 27 | Future Features: |
| 28 | * Full diagnostic control, per diagnostic (use enums). |
| 29 | * Fine grained control within the source (#pragma enable/disable warning) |
| 30 | * Faster than GCC, preprocessing, parsing, IR generation. |
| 31 | * Better token tracking within macros? (Token came from this line, which is |
| 32 | a macro argument instantiated here, recursively instantiated here). |
| 33 | * Fast #import!! |
| 34 | |
| 35 | |
| 36 | III. Critical Missing Functionality |
| 37 | |
| 38 | Lexer: |
| 39 | * Source character mapping. GCC supports ASCII and UTF-8. |
| 40 | See GCC options: -ftarget-charset and -ftarget-wide-charset. |
| 41 | * Universal character support. Experimental in GCC, enabled with |
| 42 | -fextended-identifiers. |
| 43 | * Poisoned identifiers. |
| 44 | * -fpreprocessed mode. |
| 45 | |
| 46 | Preprocessor: |
| 47 | * #line / #file directives |
| 48 | * Detection of "atomic" headers (#ifndef/#define), #pragma once support. |
| 49 | * Function-style #define & macro expansion |
| 50 | * -E & -C & -P output. |
| 51 | |
| 52 | Traditional Preprocessor: |
| 53 | * All. |
| 54 | |
| 55 | Parser Callbacks: |
| 56 | * All. |
| 57 | |
| 58 | Parser Actions: |
| 59 | * All. |
| 60 | |