From: Richard Smith Date: Tue, 8 Oct 2013 19:45:46 +0000 (+0000) Subject: Remove documentation of removed -ast-dump-xml flag. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28d9077b90c262a093e6cf6b20b517efa046f78b;p=clang Remove documentation of removed -ast-dump-xml flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192221 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/IntroductionToTheClangAST.rst b/docs/IntroductionToTheClangAST.rst index 20510344fd..fe6bb1e5c7 100644 --- a/docs/IntroductionToTheClangAST.rst +++ b/docs/IntroductionToTheClangAST.rst @@ -33,9 +33,8 @@ Examining the AST ================= A good way to familarize yourself with the Clang AST is to actually look -at it on some simple example code. Clang has a builtin AST-dump modes, -which can be enabled with the flags ``-ast-dump`` and ``-ast-dump-xml``. Note -that ``-ast-dump-xml`` currently only works with debug builds of clang. +at it on some simple example code. Clang has a builtin AST-dump mode, +which can be enabled with the flag ``-ast-dump``. Let's look at a simple example AST: @@ -48,39 +47,25 @@ Let's look at a simple example AST: } # Clang by default is a frontend for many tools; -cc1 tells it to directly - # use the C++ compiler mode. -undef leaves out some internal declarations. - $ clang -cc1 -undef -ast-dump-xml test.cc + # use the C++ compiler mode. + $ clang -cc1 -ast-dump test.cc + TranslationUnitDecl 0x5aea0d0 <> ... cutting out internal declarations of clang ... - - - - - - - - - - - - - (CompoundStmt 0x48a5a38 - (DeclStmt 0x48a59c0 - 0x48a58c0 "int result = - (ParenExpr 0x48a59a0 'int' - (BinaryOperator 0x48a5978 'int' '/' - (ImplicitCastExpr 0x48a5960 'int' - (DeclRefExpr 0x48a5918 'int' lvalue ParmVar 0x4871d80 'x' 'int')) - (IntegerLiteral 0x48a5940 'int' 42)))") - (ReturnStmt 0x48a5a18 - (ImplicitCastExpr 0x48a5a00 'int' - (DeclRefExpr 0x48a59d8 'int' lvalue Var 0x48a58c0 'result' 'int')))) - - - - - -In general, ``-ast-dump-xml`` dumps declarations in an XML-style format and -statements in an S-expression-style format. The toplevel declaration in + `-FunctionDecl 0x5aeab50 f 'int (int)' + |-ParmVarDecl 0x5aeaa90 x 'int' + `-CompoundStmt 0x5aead88 + |-DeclStmt 0x5aead10 + | `-VarDecl 0x5aeac10 result 'int' + | `-ParenExpr 0x5aeacf0 'int' + | `-BinaryOperator 0x5aeacc8 'int' '/' + | |-ImplicitCastExpr 0x5aeacb0 'int' + | | `-DeclRefExpr 0x5aeac68 'int' lvalue ParmVar 0x5aeaa90 'x' 'int' + | `-IntegerLiteral 0x5aeac90 'int' 42 + `-ReturnStmt 0x5aead68 + `-ImplicitCastExpr 0x5aead50 'int' + `-DeclRefExpr 0x5aead28 'int' lvalue Var 0x5aeac10 'result' 'int' + +The toplevel declaration in a translation unit is always the `translation unit declaration `_. In this example, our first user written declaration is the `function