diff options
Diffstat (limited to 'docs/InternalsManual.rst')
-rw-r--r-- | docs/InternalsManual.rst | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/docs/InternalsManual.rst b/docs/InternalsManual.rst index 8e047db..502cae4 100644 --- a/docs/InternalsManual.rst +++ b/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 libray <Sema>`. However, the Parser +still accesses AST objects only through opaque types like ``ExprResult`` and +``StmtResult``. Only :ref:`Sema <Sema>` looks at the AST node contents of these +wrappers. + +.. _AST: + The AST Library =============== @@ -1396,10 +1411,7 @@ body by single call to a static class method: .. code-block:: c++ Stmt *FooBody = ... - CFG *FooCFG = CFG::buildCFG(FooBody); - -It is the responsibility of the caller of ``CFG::buildCFG`` to ``delete`` the -returned ``CFG*`` when the CFG is no longer needed. + std::unique_ptr<CFG> FooCFG = CFG::buildCFG(FooBody); Along with providing an interface to iterate over its ``CFGBlocks``, the ``CFG`` class also provides methods that are useful for debugging and @@ -1585,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 <Parser>` 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 <AST>` as input and produces `LLVM IR code +<//llvm.org/docs/LangRef.html>`_ from it. + How to change Clang =================== |