@@ -35,11 +35,12 @@ which includes :ref:`C <c>`, :ref:`Objective-C <objc>`, :ref:`C++ <cxx>`, and
35
35
language-specific information, please see the corresponding language
36
36
specific section:
37
37
38
- - :ref: `C Language <c >`: K&R C, ANSI C89, ISO C90, ISO C94 (C89+AMD1), ISO
39
- C99 (+TC1, TC2, TC3).
38
+ - :ref: `C Language <c >`: K&R C, ANSI C89, ISO C90, C94 (C89+AMD1), C99 (+TC1,
39
+ TC2, TC3), C11, C17, C23, and C2y .
40
40
- :ref: `Objective-C Language <objc >`: ObjC 1, ObjC 2, ObjC 2.1, plus
41
41
variants depending on base language.
42
- - :ref: `C++ Language <cxx >`
42
+ - :ref: `C++ Language <cxx >`: C++98, C++03, C++11, C++14, C++17, C++20, C++23,
43
+ and C++26.
43
44
- :ref: `Objective C++ Language <objcxx >`
44
45
- :ref: `OpenCL Kernel Language <opencl >`: OpenCL C 1.0, 1.1, 1.2, 2.0, 3.0,
45
46
and C++ for OpenCL 1.0 and 2021.
@@ -60,29 +61,55 @@ features that depend on what CPU architecture or operating system is
60
61
being compiled for. Please see the :ref: `Target-Specific Features and
61
62
Limitations <target_features>` section for more details.
62
63
63
- The rest of the introduction introduces some basic :ref: `compiler
64
- terminology <terminology>` that is used throughout this manual and
65
- contains a basic :ref: `introduction to using Clang <basicusage >` as a
66
- command line compiler.
67
-
68
64
.. _terminology :
69
65
70
66
Terminology
71
67
-----------
68
+ * Lexer -- the part of the compiler responsible for converting source code into
69
+ abstract representations called tokens.
70
+ * Preprocessor -- the part of the compiler responsible for in-place textual
71
+ replacement of source constructs. When the lexer is required to produce a
72
+ token, it will run the preprocessor while determining which token to produce.
73
+ In other words, when the lexer encounters something like `#include ` or a macro
74
+ name, the preprocessor will be used to perform the inclusion or expand the
75
+ macro name into its replacement list, and return the resulting non-preprocessor
76
+ token.
77
+ * Parser -- the part of the compiler responsible for determining syntactic
78
+ correctness of the source code. The parser will request tokens from the lexer
79
+ and after performing semantic analysis of the production, generates an
80
+ abstract representation of the source called an AST.
81
+ * Sema -- the part of the compiler responsible for determining semantic
82
+ correctness of the source code. It is closely related to the parser and is
83
+ where many diagnostics are produced.
84
+ * Diagnostic -- a message to the user about properties of the source code. For
85
+ example, errors or warnings and their associated notes.
86
+ * Undefined behavior -- behavior for which the standard imposes no requirements
87
+ on how the code behaves. Generally speaking, undefined behavior is a bug in
88
+ the user's code. However, it can also be a place for the compiler to define
89
+ the behavior, called an extension.
90
+ * Optimizer -- the part of the compiler responsible for transforming code to
91
+ have better performance characteristics without changing the semantics of how
92
+ the code behaves. Note, the optimizer assumes the code has no undefined
93
+ behavior, so if the code does contain undefined behavior, it will often behave
94
+ differently depending on which optimization level is enabled.
95
+ * Frontend -- the Lexer, Preprocessor, Parser, Sema, and LLVM IR code generation
96
+ parts of the compiler.
97
+ * Middle-end -- a term used for the of the subset of the backend that does
98
+ (typically not target specific) optimizations prior to assembly code
99
+ generation.
100
+ * Backend -- the parts of the compiler which run after LLVM IR code generation,
101
+ such as the optimizer and generation of assembly code.
102
+
103
+ See the :doc: `InternalsManual ` for more details about the internal construction
104
+ of the compiler.
105
+
106
+ Support
107
+ -------
108
+ Clang releases happen roughly `every six months <https://llvm.org/docs/HowToReleaseLLVM.html#annual-release-schedule >`_.
109
+ Only the current public release is officially supported. Bug-fix releases for
110
+ the current release will be produced on an as-needed basis, but bug fixes are
111
+ not backported to releases older than the current one.
72
112
73
- Front end, parser, backend, preprocessor, undefined behavior,
74
- diagnostic, optimizer
75
-
76
- .. _basicusage :
77
-
78
- Basic Usage
79
- -----------
80
-
81
- Intro to how to use a C compiler for newbies.
82
-
83
- compile + link compile then link debug info enabling optimizations
84
- picking a language to use, defaults to C17 by default. Autosenses based
85
- on extension. using a makefile
86
113
87
114
Command Line Options
88
115
====================
@@ -3797,8 +3824,8 @@ This environment variable does not affect the options added by the config files.
3797
3824
C Language Features
3798
3825
===================
3799
3826
3800
- The support for standard C in clang is feature-complete except for the
3801
- C99 floating-point pragmas .
3827
+ The support for standard C in Clang is mostly feature-complete, see the ` C
3828
+ status page <https://clang.llvm.org/c_status.html> `_ for more details .
3802
3829
3803
3830
Extensions supported by clang
3804
3831
-----------------------------
@@ -3883,23 +3910,10 @@ GCC extensions not implemented yet
3883
3910
----------------------------------
3884
3911
3885
3912
clang tries to be compatible with gcc as much as possible, but some gcc
3886
- extensions are not implemented yet :
3913
+ extensions are not implemented:
3887
3914
3888
3915
- clang does not support decimal floating point types (``_Decimal32 `` and
3889
3916
friends) yet.
3890
- - clang does not support nested functions; this is a complex feature
3891
- which is infrequently used, so it is unlikely to be implemented
3892
- anytime soon. In C++11 it can be emulated by assigning lambda
3893
- functions to local variables, e.g:
3894
-
3895
- .. code-block :: cpp
3896
-
3897
- auto const local_function = [&](int parameter) {
3898
- // Do something
3899
- };
3900
- ...
3901
- local_function(1);
3902
-
3903
3917
- clang only supports global register variables when the register specified
3904
3918
is non-allocatable (e.g. the stack pointer). Support for general global
3905
3919
register variables is unlikely to be implemented soon because it requires
@@ -3914,18 +3928,13 @@ extensions are not implemented yet:
3914
3928
that because clang pretends to be like GCC 4.2, and this extension
3915
3929
was introduced in 4.3, the glibc headers will not try to use this
3916
3930
extension with clang at the moment.
3917
- - clang does not support the gcc extension for forward-declaring
3918
- function parameters; this has not shown up in any real-world code
3919
- yet, though, so it might never be implemented.
3920
3931
3921
3932
This is not a complete list; if you find an unsupported extension
3922
- missing from this list, please send an e-mail to cfe-dev. This list
3923
- currently excludes C++; see :ref: `C++ Language Features <cxx >`. Also, this
3924
- list does not include bugs in mostly-implemented features; please see
3925
- the `bug
3926
- tracker <https://bugs.llvm.org/buglist.cgi?quicksearch=product%3Aclang+component%3A-New%2BBugs%2CAST%2CBasic%2CDriver%2CHeaders%2CLLVM%2BCodeGen%2Cparser%2Cpreprocessor%2CSemantic%2BAnalyzer> `_
3927
- for known existing bugs (FIXME: Is there a section for bug-reporting
3928
- guidelines somewhere?).
3933
+ missing from this list, please file a `feature request <https://github.com/llvm/llvm-project/issues/ >`_.
3934
+ This list currently excludes C++; see :ref: `C++ Language Features <cxx >`. Also,
3935
+ this list does not include bugs in mostly-implemented features; please see the
3936
+ `issues list <https://github.com/llvm/llvm-project/issues/ >`_ for known existing
3937
+ bugs.
3929
3938
3930
3939
Intentionally unsupported GCC extensions
3931
3940
----------------------------------------
@@ -3944,6 +3953,20 @@ Intentionally unsupported GCC extensions
3944
3953
variable) will likely never be accepted by Clang.
3945
3954
- clang does not support ``__builtin_apply `` and friends; this extension
3946
3955
is extremely obscure and difficult to implement reliably.
3956
+ - clang does not support the gcc extension for forward-declaring
3957
+ function parameters.
3958
+ - clang does not support nested functions; this is a complex feature which is
3959
+ infrequently used, so it is unlikely to be implemented. In C++11 it can be
3960
+ emulated by assigning lambda functions to local variables, e.g:
3961
+
3962
+ .. code-block :: cpp
3963
+
3964
+ auto const local_function = [&](int parameter) {
3965
+ // Do something
3966
+ };
3967
+ ...
3968
+ local_function(1);
3969
+
3947
3970
3948
3971
.. _c_ms :
3949
3972
@@ -3983,7 +4006,7 @@ C++ Language Features
3983
4006
3984
4007
clang fully implements all of standard C++98 except for exported
3985
4008
templates (which were removed in C++11), all of standard C++11,
3986
- C++14, and C++17, and most of C++20.
4009
+ C++14, and C++17, and most of C++20 and C++23 .
3987
4010
3988
4011
See the `C++ support in Clang <https://clang.llvm.org/cxx_status.html >`_ page
3989
4012
for detailed information on C++ feature support across Clang versions.
0 commit comments