diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-12-28 02:07:26 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-12-28 02:07:26 +0000 |
commit | 933607f10ea0ec008baf3d3aaedbbfa7661f4659 (patch) | |
tree | 02f506395e26afe5d2d330771570edd13bd17a07 | |
parent | 3fc6a28c3428af7e80ce741de271b0d5af59f77a (diff) | |
download | bcm5719-llvm-933607f10ea0ec008baf3d3aaedbbfa7661f4659.tar.gz bcm5719-llvm-933607f10ea0ec008baf3d3aaedbbfa7661f4659.zip |
Add stub sections about Parse, Sema, CodeGen to the internals manual.
I'd be interested if the paragraph on Parse not knowing much about AST is
something folks agree with. I think this used to be true after rjmccall removed
the Action interface in r112244 and I believe it's still true, but I'm not sure.
(For example, ParseOpenMP.cpp does include AST/StmtOpenMP.h. Other than that,
Parse not using AST nodes much seems to be still true, though.)
llvm-svn: 224894
-rw-r--r-- | clang/docs/InternalsManual.rst | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst index 50a1943ee28..511e2c61e97 100644 --- a/clang/docs/InternalsManual.rst +++ b/clang/docs/InternalsManual.rst @@ -784,9 +784,24 @@ buffer uses this idiom and is subsequently ``#include``'d, the preprocessor can simply check to see whether the guarding condition is defined or not. If so, the preprocessor can completely ignore the include of the header. +.. _Parser: + The Parser Library ================== +This library contains a recursive-descent parser that polls tokens from the +preprocessor and notifies a client of the parsing progress. + +Historically, the parser used to talk to an abstract ``Action`` interface that +had virtual methods for parse events, for example ``ActOnBinOp()``. When Clang +grew C++ support, the parser stopped supporting general ``Action`` clients -- +it now always talks to the :ref:`Sema` library. However, the Parser still +accesses AST objects only through opaque types like ``ExprResult`` and +``StmtResult``. Only ::ref::`Sema` looks at the AST node contents of these +wrappers. + +.. _AST: + The AST Library =============== @@ -1582,6 +1597,23 @@ interacts with constant evaluation: * ``__builtin_strlen`` and ``strlen``: These are constant folded as integer constant expressions if the argument is a string literal. +.. _Sema: + +The Sema Library +================ + +This library is called by the :ref:`Parser` library during parsing to do +semantic analysis of the input. For valid programs, Sema builds an AST for +parsed constructs. + +.. _CodeGen: + +The CodeGen Library +=================== + +CodeGen takes an :ref:`AST` as input and produces `LLVM IR code +<//llvm.org/docs/LangRef.html>`_ from it. + How to change Clang =================== |