[www-releases] r225843 - Add documentation for 3.5.1

Tom Stellard thomas.stellard at amd.com
Tue Jan 13 14:55:45 PST 2015


Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormat.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormat.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormat.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormat.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,227 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>ClangFormat — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Clang-Format Style Options" href="ClangFormatStyleOptions.html" />
+    <link rel="prev" title="ClangCheck" href="ClangCheck.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>ClangFormat</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="ClangCheck.html">ClangCheck</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clangformat">
+<h1>ClangFormat<a class="headerlink" href="#clangformat" title="Permalink to this headline">¶</a></h1>
+<p><cite>ClangFormat</cite> describes a set of tools that are built on top of
+<a class="reference internal" href="LibFormat.html"><em>LibFormat</em></a>. It can support your workflow in a variety of ways including a
+standalone tool and editor integrations.</p>
+<div class="section" id="standalone-tool">
+<h2>Standalone Tool<a class="headerlink" href="#standalone-tool" title="Permalink to this headline">¶</a></h2>
+<p><strong class="program">clang-format</strong> is located in <cite>clang/tools/clang-format</cite> and can be used
+to format C/C++/Obj-C code.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang-format -help
+<span class="go">OVERVIEW: A tool to format C/C++/Obj-C code.</span>
+
+<span class="go">If no arguments are specified, it formats the code from standard input</span>
+<span class="go">and writes the result to the standard output.</span>
+<span class="go">If <file>s are given, it reformats the files. If -i is specified</span>
+<span class="go">together with <file>s, the files are edited in-place. Otherwise, the</span>
+<span class="go">result is written to the standard output.</span>
+
+<span class="go">USAGE: clang-format [options] [<file> ...]</span>
+
+<span class="go">OPTIONS:</span>
+
+<span class="go">Clang-format options:</span>
+
+<span class="go">  -cursor=<uint>           - The position of the cursor when invoking</span>
+<span class="go">                             clang-format from an editor integration</span>
+<span class="go">  -dump-config             - Dump configuration options to stdout and exit.</span>
+<span class="go">                             Can be used with -style option.</span>
+<span class="go">  -i                       - Inplace edit <file>s, if specified.</span>
+<span class="go">  -length=<uint>           - Format a range of this length (in bytes).</span>
+<span class="go">                             Multiple ranges can be formatted by specifying</span>
+<span class="go">                             several -offset and -length pairs.</span>
+<span class="go">                             When only a single -offset is specified without</span>
+<span class="go">                             -length, clang-format will format up to the end</span>
+<span class="go">                             of the file.</span>
+<span class="go">                             Can only be used with one input file.</span>
+<span class="go">  -lines=<string>          - <start line>:<end line> - format a range of</span>
+<span class="go">                             lines (both 1-based).</span>
+<span class="go">                             Multiple ranges can be formatted by specifying</span>
+<span class="go">                             several -lines arguments.</span>
+<span class="go">                             Can't be used with -offset and -length.</span>
+<span class="go">                             Can only be used with one input file.</span>
+<span class="go">  -offset=<uint>           - Format a range starting at this byte offset.</span>
+<span class="go">                             Multiple ranges can be formatted by specifying</span>
+<span class="go">                             several -offset and -length pairs.</span>
+<span class="go">                             Can only be used with one input file.</span>
+<span class="go">  -output-replacements-xml - Output replacements as XML.</span>
+<span class="go">  -style=<string>          - Coding style, currently supports:</span>
+<span class="go">                               LLVM, Google, Chromium, Mozilla, WebKit.</span>
+<span class="go">                             Use -style=file to load style configuration from</span>
+<span class="go">                             .clang-format file located in one of the parent</span>
+<span class="go">                             directories of the source file (or current</span>
+<span class="go">                             directory for stdin).</span>
+<span class="go">                             Use -style="{key: value, ...}" to set specific</span>
+<span class="go">                             parameters, e.g.:</span>
+<span class="go">                               -style="{BasedOnStyle: llvm, IndentWidth: 8}"</span>
+
+<span class="go">General options:</span>
+
+<span class="go">  -help                    - Display available options (-help-hidden for more)</span>
+<span class="go">  -help-list               - Display list of available options (-help-list-hidden for more)</span>
+<span class="go">  -version                 - Display the version of this program</span>
+</pre></div>
+</div>
+<p>When the desired code formatting style is different from the available options,
+the style can be customized using the <tt class="docutils literal"><span class="pre">-style="{key:</span> <span class="pre">value,</span> <span class="pre">...}"</span></tt> option or
+by putting your style configuration in the <tt class="docutils literal"><span class="pre">.clang-format</span></tt> or <tt class="docutils literal"><span class="pre">_clang-format</span></tt>
+file in your project’s directory and using <tt class="docutils literal"><span class="pre">clang-format</span> <span class="pre">-style=file</span></tt>.</p>
+<p>An easy way to create the <tt class="docutils literal"><span class="pre">.clang-format</span></tt> file is:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">clang-format -style=llvm -dump-config > .clang-format</span>
+</pre></div>
+</div>
+<p>Available style options are described in <a class="reference internal" href="ClangFormatStyleOptions.html"><em>Clang-Format Style Options</em></a>.</p>
+</div>
+<div class="section" id="vim-integration">
+<h2>Vim Integration<a class="headerlink" href="#vim-integration" title="Permalink to this headline">¶</a></h2>
+<p>There is an integration for <strong class="program">vim</strong> which lets you run the
+<strong class="program">clang-format</strong> standalone tool on your current buffer, optionally
+selecting regions to reformat. The integration has the form of a <cite>python</cite>-file
+which can be found under <cite>clang/tools/clang-format/clang-format.py</cite>.</p>
+<p>This can be integrated by adding the following to your <cite>.vimrc</cite>:</p>
+<div class="highlight-vim"><div class="highlight"><pre>map <span class="p"><</span>C<span class="p">-</span>K<span class="p">></span> :<span class="k">pyf</span> <span class="p"><</span><span class="nb">path</span><span class="p">-</span><span class="k">to</span><span class="p">-</span>this<span class="p">-</span><span class="k">file</span><span class="p">></span>/clang<span class="p">-</span>format.<span class="k">py</span><span class="p"><</span>CR<span class="p">></span>
+imap <span class="p"><</span>C<span class="p">-</span>K<span class="p">></span> <span class="p"><</span>ESC<span class="p">></span>:<span class="k">pyf</span> <span class="p"><</span><span class="nb">path</span><span class="p">-</span><span class="k">to</span><span class="p">-</span>this<span class="p">-</span><span class="k">file</span><span class="p">></span>/clang<span class="p">-</span>format.<span class="k">py</span><span class="p"><</span>CR<span class="p">></span><span class="k">i</span>
+</pre></div>
+</div>
+<p>The first line enables <strong class="program">clang-format</strong> for NORMAL and VISUAL mode, the
+second line adds support for INSERT mode. Change “C-K” to another binding if
+you need <strong class="program">clang-format</strong> on a different key (C-K stands for Ctrl+k).</p>
+<p>With this integration you can press the bound key and clang-format will
+format the current line in NORMAL and INSERT mode or the selected region in
+VISUAL mode. The line or region is extended to the next bigger syntactic
+entity.</p>
+<p>It operates on the current, potentially unsaved buffer and does not create
+or save any files. To revert a formatting, just undo.</p>
+</div>
+<div class="section" id="emacs-integration">
+<h2>Emacs Integration<a class="headerlink" href="#emacs-integration" title="Permalink to this headline">¶</a></h2>
+<p>Similar to the integration for <strong class="program">vim</strong>, there is an integration for
+<strong class="program">emacs</strong>. It can be found at <cite>clang/tools/clang-format/clang-format.el</cite>
+and used by adding this to your <cite>.emacs</cite>:</p>
+<div class="highlight-common-lisp"><div class="highlight"><pre><span class="p">(</span><span class="nb">load</span> <span class="s">"<path-to-clang>/tools/clang-format/clang-format.el"</span><span class="p">)</span>
+<span class="p">(</span><span class="nv">global-set-key</span> <span class="nv">[C-M-tab]</span> <span class="ss">'clang-format-region</span><span class="p">)</span>
+</pre></div>
+</div>
+<p>This binds the function <cite>clang-format-region</cite> to C-M-tab, which then formats the
+current line or selected region.</p>
+</div>
+<div class="section" id="bbedit-integration">
+<h2>BBEdit Integration<a class="headerlink" href="#bbedit-integration" title="Permalink to this headline">¶</a></h2>
+<p><strong class="program">clang-format</strong> cannot be used as a text filter with BBEdit, but works
+well via a script. The AppleScript to do this integration can be found at
+<cite>clang/tools/clang-format/clang-format-bbedit.applescript</cite>; place a copy in
+<cite>~/Library/Application Support/BBEdit/Scripts</cite>, and edit the path within it to
+point to your local copy of <strong class="program">clang-format</strong>.</p>
+<p>With this integration you can select the script from the Script menu and
+<strong class="program">clang-format</strong> will format the selection. Note that you can rename the
+menu item by renaming the script, and can assign the menu item a keyboard
+shortcut in the BBEdit preferences, under Menus & Shortcuts.</p>
+</div>
+<div class="section" id="visual-studio-integration">
+<h2>Visual Studio Integration<a class="headerlink" href="#visual-studio-integration" title="Permalink to this headline">¶</a></h2>
+<p>Download the latest Visual Studio extension from the <a class="reference external" href="http://llvm.org/builds/">alpha build site</a>. The default key-binding is Ctrl-R,Ctrl-F.</p>
+</div>
+<div class="section" id="script-for-patch-reformatting">
+<h2>Script for patch reformatting<a class="headerlink" href="#script-for-patch-reformatting" title="Permalink to this headline">¶</a></h2>
+<p>The python script <cite>clang/tools/clang-format-diff.py</cite> parses the output of
+a unified diff and reformats all contained lines with <strong class="program">clang-format</strong>.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">usage: clang-format-diff.py [-h] [-i] [-p NUM] [-regex PATTERN] [-style STYLE]</span>
+
+<span class="go">Reformat changed lines in diff. Without -i option just output the diff that</span>
+<span class="go">would be introduced.</span>
+
+<span class="go">optional arguments:</span>
+<span class="go">  -h, --help      show this help message and exit</span>
+<span class="go">  -i              apply edits to files instead of displaying a diff</span>
+<span class="go">  -p NUM          strip the smallest prefix containing P slashes</span>
+<span class="go">  -regex PATTERN  custom pattern selecting file paths to reformat</span>
+<span class="go">  -style STYLE    formatting style to apply (LLVM, Google, Chromium, Mozilla,</span>
+<span class="go">                  WebKit)</span>
+</pre></div>
+</div>
+<p>So to reformat all the lines in the latest <strong class="program">git</strong> commit, just do:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">git diff -U0 HEAD^ | clang-format-diff.py -i -p1</span>
+</pre></div>
+</div>
+<p>In an SVN client, you can do:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i</span>
+</pre></div>
+</div>
+<p>The <em class="xref std std-option">-U0</em> will create a diff without context lines (the script would format
+those as well).</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="ClangCheck.html">ClangCheck</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormatStyleOptions.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormatStyleOptions.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormatStyleOptions.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangFormatStyleOptions.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,486 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Clang-Format Style Options — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="“Clang” CFE Internals Manual" href="InternalsManual.html" />
+    <link rel="prev" title="ClangFormat" href="ClangFormat.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Clang-Format Style Options</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="ClangFormat.html">ClangFormat</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="InternalsManual.html">“Clang” CFE Internals Manual</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-format-style-options">
+<h1>Clang-Format Style Options<a class="headerlink" href="#clang-format-style-options" title="Permalink to this headline">¶</a></h1>
+<p><a class="reference internal" href=""><em>Clang-Format Style Options</em></a> describes configurable formatting style options
+supported by <a class="reference internal" href="LibFormat.html"><em>LibFormat</em></a> and <a class="reference internal" href="ClangFormat.html"><em>ClangFormat</em></a>.</p>
+<p>When using <strong class="program">clang-format</strong> command line utility or
+<tt class="docutils literal"><span class="pre">clang::format::reformat(...)</span></tt> functions from code, one can either use one of
+the predefined styles (LLVM, Google, Chromium, Mozilla, WebKit) or create a
+custom style by configuring specific style options.</p>
+<div class="section" id="configuring-style-with-clang-format">
+<h2>Configuring Style with clang-format<a class="headerlink" href="#configuring-style-with-clang-format" title="Permalink to this headline">¶</a></h2>
+<p><strong class="program">clang-format</strong> supports two ways to provide custom style options:
+directly specify style configuration in the <tt class="docutils literal"><span class="pre">-style=</span></tt> command line option or
+use <tt class="docutils literal"><span class="pre">-style=file</span></tt> and put style configuration in the <tt class="docutils literal"><span class="pre">.clang-format</span></tt> or
+<tt class="docutils literal"><span class="pre">_clang-format</span></tt> file in the project directory.</p>
+<p>When using <tt class="docutils literal"><span class="pre">-style=file</span></tt>, <strong class="program">clang-format</strong> for each input file will
+try to find the <tt class="docutils literal"><span class="pre">.clang-format</span></tt> file located in the closest parent directory
+of the input file. When the standard input is used, the search is started from
+the current directory.</p>
+<p>The <tt class="docutils literal"><span class="pre">.clang-format</span></tt> file uses YAML format:</p>
+<div class="highlight-yaml"><div class="highlight"><pre><span class="l-Scalar-Plain">key1</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">value1</span>
+<span class="l-Scalar-Plain">key2</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">value2</span>
+<span class="c1"># A comment.</span>
+<span class="nn">...</span>
+</pre></div>
+</div>
+<p>An easy way to get a valid <tt class="docutils literal"><span class="pre">.clang-format</span></tt> file containing all configuration
+options of a certain predefined style is:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">clang-format -style=llvm -dump-config > .clang-format</span>
+</pre></div>
+</div>
+<p>When specifying configuration in the <tt class="docutils literal"><span class="pre">-style=</span></tt> option, the same configuration
+is applied for all input files. The format of the configuration is:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">-style='{key1: value1, key2: value2, ...}'</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="configuring-style-in-code">
+<h2>Configuring Style in Code<a class="headerlink" href="#configuring-style-in-code" title="Permalink to this headline">¶</a></h2>
+<p>When using <tt class="docutils literal"><span class="pre">clang::format::reformat(...)</span></tt> functions, the format is specified
+by supplying the <a class="reference external" href="http://clang.llvm.org/doxygen/structclang_1_1format_1_1FormatStyle.html">clang::format::FormatStyle</a>
+structure.</p>
+</div>
+<div class="section" id="configurable-format-style-options">
+<h2>Configurable Format Style Options<a class="headerlink" href="#configurable-format-style-options" title="Permalink to this headline">¶</a></h2>
+<p>This section lists the supported style options. Value type is specified for
+each option. For enumeration types possible values are specified both as a C++
+enumeration member (with a prefix, e.g. <tt class="docutils literal"><span class="pre">LS_Auto</span></tt>), and as a value usable in
+the configuration (without a prefix: <tt class="docutils literal"><span class="pre">Auto</span></tt>).</p>
+<dl class="docutils">
+<dt><strong>BasedOnStyle</strong> (<tt class="docutils literal"><span class="pre">string</span></tt>)</dt>
+<dd><p class="first">The style used for all options not specifically set in the configuration.</p>
+<p>This option is supported only in the <strong class="program">clang-format</strong> configuration
+(both within <tt class="docutils literal"><span class="pre">-style='{...}'</span></tt> and the <tt class="docutils literal"><span class="pre">.clang-format</span></tt> file).</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">LLVM</span></tt>
+A style complying with the <a class="reference external" href="http://llvm.org/docs/CodingStandards.html">LLVM coding standards</a></li>
+<li><tt class="docutils literal"><span class="pre">Google</span></tt>
+A style complying with <a class="reference external" href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google’s C++ style guide</a></li>
+<li><tt class="docutils literal"><span class="pre">Chromium</span></tt>
+A style complying with <a class="reference external" href="http://www.chromium.org/developers/coding-style">Chromium’s style guide</a></li>
+<li><tt class="docutils literal"><span class="pre">Mozilla</span></tt>
+A style complying with <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style">Mozilla’s style guide</a></li>
+<li><tt class="docutils literal"><span class="pre">WebKit</span></tt>
+A style complying with <a class="reference external" href="http://www.webkit.org/coding/coding-style.html">WebKit’s style guide</a></li>
+</ul>
+</dd>
+</dl>
+<dl class="docutils">
+<dt><strong>AccessModifierOffset</strong> (<tt class="docutils literal"><span class="pre">int</span></tt>)</dt>
+<dd>The extra indent or outdent of access modifiers, e.g. <tt class="docutils literal"><span class="pre">public:</span></tt>.</dd>
+<dt><strong>AlignEscapedNewlinesLeft</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, aligns escaped newlines as far left as possible.
+Otherwise puts them into the right-most column.</dd>
+<dt><strong>AlignTrailingComments</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, aligns trailing comments.</dd>
+<dt><strong>AllowAllParametersOfDeclarationOnNextLine</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Allow putting all parameters of a function declaration onto
+the next line even if <tt class="docutils literal"><span class="pre">BinPackParameters</span></tt> is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd>
+<dt><strong>AllowShortBlocksOnASingleLine</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd><p class="first">Allows contracting simple braced statements to a single line.</p>
+<p class="last">E.g., this allows <tt class="docutils literal"><span class="pre">if</span> <span class="pre">(a)</span> <span class="pre">{</span> <span class="pre">return;</span> <span class="pre">}</span></tt> to be put on a single line.</p>
+</dd>
+<dt><strong>AllowShortFunctionsOnASingleLine</strong> (<tt class="docutils literal"><span class="pre">ShortFunctionStyle</span></tt>)</dt>
+<dd><p class="first">Dependent on the value, <tt class="docutils literal"><span class="pre">int</span> <span class="pre">f()</span> <span class="pre">{</span> <span class="pre">return</span> <span class="pre">0;</span> <span class="pre">}</span></tt> can be put
+on a single line.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">SFS_None</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">None</span></tt>)
+Never merge functions into a single line.</li>
+<li><tt class="docutils literal"><span class="pre">SFS_Inline</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Inline</span></tt>)
+Only merge functions defined inside a class.</li>
+<li><tt class="docutils literal"><span class="pre">SFS_All</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">All</span></tt>)
+Merge all functions fitting on a single line.</li>
+</ul>
+</dd>
+<dt><strong>AllowShortIfStatementsOnASingleLine</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, <tt class="docutils literal"><span class="pre">if</span> <span class="pre">(a)</span> <span class="pre">return;</span></tt> can be put on a single
+line.</dd>
+<dt><strong>AllowShortLoopsOnASingleLine</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, <tt class="docutils literal"><span class="pre">while</span> <span class="pre">(true)</span> <span class="pre">continue;</span></tt> can be put on a
+single line.</dd>
+<dt><strong>AlwaysBreakBeforeMultilineStrings</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, always break before multiline string literals.</dd>
+<dt><strong>AlwaysBreakTemplateDeclarations</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, always break after the <tt class="docutils literal"><span class="pre">template<...></span></tt> of a
+template declaration.</dd>
+<dt><strong>BinPackParameters</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">false</span></tt>, a function call’s or function definition’s parameters
+will either all be on the same line or will have one line each.</dd>
+<dt><strong>BreakBeforeBinaryOperators</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, binary operators will be placed after line breaks.</dd>
+<dt><strong>BreakBeforeBraces</strong> (<tt class="docutils literal"><span class="pre">BraceBreakingStyle</span></tt>)</dt>
+<dd><p class="first">The brace breaking style to use.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">BS_Attach</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Attach</span></tt>)
+Always attach braces to surrounding context.</li>
+<li><tt class="docutils literal"><span class="pre">BS_Linux</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Linux</span></tt>)
+Like <tt class="docutils literal"><span class="pre">Attach</span></tt>, but break before braces on function, namespace and
+class definitions.</li>
+<li><tt class="docutils literal"><span class="pre">BS_Stroustrup</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Stroustrup</span></tt>)
+Like <tt class="docutils literal"><span class="pre">Attach</span></tt>, but break before function definitions.</li>
+<li><tt class="docutils literal"><span class="pre">BS_Allman</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Allman</span></tt>)
+Always break before braces.</li>
+<li><tt class="docutils literal"><span class="pre">BS_GNU</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">GNU</span></tt>)
+Always break before braces and add an extra level of indentation to
+braces of control statements, not to those of class, function
+or other definitions.</li>
+</ul>
+</dd>
+<dt><strong>BreakBeforeTernaryOperators</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, ternary operators will be placed after line breaks.</dd>
+<dt><strong>BreakConstructorInitializersBeforeComma</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Always break constructor initializers before commas and align
+the commas with the colon.</dd>
+<dt><strong>ColumnLimit</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd><p class="first">The column limit.</p>
+<p class="last">A column limit of <tt class="docutils literal"><span class="pre">0</span></tt> means that there is no column limit. In this case,
+clang-format will respect the input’s line breaking decisions within
+statements unless they contradict other rules.</p>
+</dd>
+<dt><strong>CommentPragmas</strong> (<tt class="docutils literal"><span class="pre">std::string</span></tt>)</dt>
+<dd>A regular expression that describes comments with special meaning,
+which should not be split into lines or otherwise changed.</dd>
+<dt><strong>ConstructorInitializerAllOnOneLineOrOnePerLine</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If the constructor initializers don’t fit on a line, put each
+initializer on its own line.</dd>
+<dt><strong>ConstructorInitializerIndentWidth</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The number of characters to use for indentation of constructor
+initializer lists.</dd>
+<dt><strong>ContinuationIndentWidth</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>Indent width for line continuations.</dd>
+<dt><strong>Cpp11BracedListStyle</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd><p class="first">If <tt class="docutils literal"><span class="pre">true</span></tt>, format braced lists as best suited for C++11 braced
+lists.</p>
+<p>Important differences:
+- No spaces inside the braced list.
+- No line break before the closing brace.
+- Indentation with the continuation indent, not with the block indent.</p>
+<p class="last">Fundamentally, C++11 braced lists are formatted exactly like function
+calls would be formatted in their place. If the braced list follows a name
+(e.g. a type or variable name), clang-format formats as if the <tt class="docutils literal"><span class="pre">{}</span></tt> were
+the parentheses of a function call with that name. If there is no name,
+a zero-length name is assumed.</p>
+</dd>
+<dt><strong>DerivePointerAlignment</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, analyze the formatted file for the most common
+alignment of & and *. <tt class="docutils literal"><span class="pre">PointerAlignment</span></tt> is then used only as fallback.</dd>
+<dt><strong>DisableFormat</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Disables formatting at all.</dd>
+<dt><strong>ExperimentalAutoDetectBinPacking</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd><p class="first">If <tt class="docutils literal"><span class="pre">true</span></tt>, clang-format detects whether function calls and
+definitions are formatted with one parameter per line.</p>
+<p>Each call can be bin-packed, one-per-line or inconclusive. If it is
+inconclusive, e.g. completely on one line, but a decision needs to be
+made, clang-format analyzes whether there are other bin-packed cases in
+the input file and act accordingly.</p>
+<p class="last">NOTE: This is an experimental flag, that might go away or be renamed. Do
+not use this in config files, etc. Use at your own risk.</p>
+</dd>
+<dt><strong>ForEachMacros</strong> (<tt class="docutils literal"><span class="pre">std::vector<std::string></span></tt>)</dt>
+<dd><p class="first">A vector of macros that should be interpreted as foreach loops
+instead of as function calls.</p>
+<p>These are expected to be macros of the form:
+code
+FOREACH(<variable-declaration>, ...)
+<loop-body>
+endcode</p>
+<p class="last">For example: BOOST_FOREACH.</p>
+</dd>
+<dt><strong>IndentCaseLabels</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd><p class="first">Indent case labels one level from the switch statement.</p>
+<p class="last">When <tt class="docutils literal"><span class="pre">false</span></tt>, use the same indentation level as for the switch statement.
+Switch statement body is always indented one level more than case labels.</p>
+</dd>
+<dt><strong>IndentWidth</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The number of columns to use for indentation.</dd>
+<dt><strong>IndentWrappedFunctionNames</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Indent if a function definition or declaration is wrapped after the
+type.</dd>
+<dt><strong>KeepEmptyLinesAtTheStartOfBlocks</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If true, empty lines at the start of blocks are kept.</dd>
+<dt><strong>Language</strong> (<tt class="docutils literal"><span class="pre">LanguageKind</span></tt>)</dt>
+<dd><p class="first">Language, this format style is targeted at.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">LK_None</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">None</span></tt>)
+Do not use.</li>
+<li><tt class="docutils literal"><span class="pre">LK_Cpp</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Cpp</span></tt>)
+Should be used for C, C++, ObjectiveC, ObjectiveC++.</li>
+<li><tt class="docutils literal"><span class="pre">LK_JavaScript</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">JavaScript</span></tt>)
+Should be used for JavaScript.</li>
+<li><tt class="docutils literal"><span class="pre">LK_Proto</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Proto</span></tt>)
+Should be used for Protocol Buffers
+(<a class="reference external" href="https://developers.google.com/protocol-buffers/">https://developers.google.com/protocol-buffers/</a>).</li>
+</ul>
+</dd>
+<dt><strong>MaxEmptyLinesToKeep</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The maximum number of consecutive empty lines to keep.</dd>
+<dt><strong>NamespaceIndentation</strong> (<tt class="docutils literal"><span class="pre">NamespaceIndentationKind</span></tt>)</dt>
+<dd><p class="first">The indentation used for namespaces.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">NI_None</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">None</span></tt>)
+Don’t indent in namespaces.</li>
+<li><tt class="docutils literal"><span class="pre">NI_Inner</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Inner</span></tt>)
+Indent only in inner namespaces (nested in other namespaces).</li>
+<li><tt class="docutils literal"><span class="pre">NI_All</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">All</span></tt>)
+Indent in all namespaces.</li>
+</ul>
+</dd>
+<dt><strong>ObjCSpaceAfterProperty</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Add a space after <tt class="docutils literal"><span class="pre">@property</span></tt> in Objective-C, i.e. use
+<tt class="docutils literal"><span class="pre">\@property</span> <span class="pre">(readonly)</span></tt> instead of <tt class="docutils literal"><span class="pre">\@property(readonly)</span></tt>.</dd>
+<dt><strong>ObjCSpaceBeforeProtocolList</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>Add a space in front of an Objective-C protocol list, i.e. use
+<tt class="docutils literal"><span class="pre">Foo</span> <span class="pre"><Protocol></span></tt> instead of <tt class="docutils literal"><span class="pre">Foo<Protocol></span></tt>.</dd>
+<dt><strong>PenaltyBreakBeforeFirstCallParameter</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The penalty for breaking a function call after “call(”.</dd>
+<dt><strong>PenaltyBreakComment</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The penalty for each line break introduced inside a comment.</dd>
+<dt><strong>PenaltyBreakFirstLessLess</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The penalty for breaking before the first <tt class="docutils literal"><span class="pre"><<</span></tt>.</dd>
+<dt><strong>PenaltyBreakString</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The penalty for each line break introduced inside a string literal.</dd>
+<dt><strong>PenaltyExcessCharacter</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The penalty for each character outside of the column limit.</dd>
+<dt><strong>PenaltyReturnTypeOnItsOwnLine</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>Penalty for putting the return type of a function onto its own
+line.</dd>
+<dt><strong>PointerAlignment</strong> (<tt class="docutils literal"><span class="pre">PointerAlignmentStyle</span></tt>)</dt>
+<dd><p class="first">Pointer and reference alignment style.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">PAS_Left</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Left</span></tt>)
+Align pointer to the left.</li>
+<li><tt class="docutils literal"><span class="pre">PAS_Right</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Right</span></tt>)
+Align pointer to the right.</li>
+<li><tt class="docutils literal"><span class="pre">PAS_Middle</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Middle</span></tt>)
+Align pointer in the middle.</li>
+</ul>
+</dd>
+<dt><strong>SpaceBeforeAssignmentOperators</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">false</span></tt>, spaces will be removed before assignment operators.</dd>
+<dt><strong>SpaceBeforeParens</strong> (<tt class="docutils literal"><span class="pre">SpaceBeforeParensOptions</span></tt>)</dt>
+<dd><p class="first">Defines in which cases to put a space before opening parentheses.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">SBPO_Never</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Never</span></tt>)
+Never put a space before opening parentheses.</li>
+<li><tt class="docutils literal"><span class="pre">SBPO_ControlStatements</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">ControlStatements</span></tt>)
+Put a space before opening parentheses only after control statement
+keywords (<tt class="docutils literal"><span class="pre">for/if/while...</span></tt>).</li>
+<li><tt class="docutils literal"><span class="pre">SBPO_Always</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Always</span></tt>)
+Always put a space before opening parentheses, except when it’s
+prohibited by the syntax rules (in function-like macro definitions) or
+when determined by other style rules (after unary operators, opening
+parentheses, etc.)</li>
+</ul>
+</dd>
+<dt><strong>SpaceInEmptyParentheses</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, spaces may be inserted into ‘()’.</dd>
+<dt><strong>SpacesBeforeTrailingComments</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd><p class="first">The number of spaces before trailing line comments
+(<tt class="docutils literal"><span class="pre">//</span></tt> - comments).</p>
+<p class="last">This does not affect trailing block comments (<tt class="docutils literal"><span class="pre">/**/</span></tt> - comments) as those
+commonly have different usage patterns and a number of special cases.</p>
+</dd>
+<dt><strong>SpacesInAngles</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, spaces will be inserted after ‘<’ and before ‘>’ in
+template argument lists</dd>
+<dt><strong>SpacesInCStyleCastParentheses</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, spaces may be inserted into C style casts.</dd>
+<dt><strong>SpacesInContainerLiterals</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, spaces are inserted inside container literals (e.g.
+ObjC and Javascript array and dict literals).</dd>
+<dt><strong>SpacesInParentheses</strong> (<tt class="docutils literal"><span class="pre">bool</span></tt>)</dt>
+<dd>If <tt class="docutils literal"><span class="pre">true</span></tt>, spaces will be inserted after ‘(‘ and before ‘)’.</dd>
+<dt><strong>Standard</strong> (<tt class="docutils literal"><span class="pre">LanguageStandard</span></tt>)</dt>
+<dd><p class="first">Format compatible with this standard, e.g. use
+<tt class="docutils literal"><span class="pre">A<A<int></span> <span class="pre">></span></tt> instead of <tt class="docutils literal"><span class="pre">A<A<int>></span></tt> for LS_Cpp03.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">LS_Cpp03</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Cpp03</span></tt>)
+Use C++03-compatible syntax.</li>
+<li><tt class="docutils literal"><span class="pre">LS_Cpp11</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Cpp11</span></tt>)
+Use features of C++11 (e.g. <tt class="docutils literal"><span class="pre">A<A<int>></span></tt> instead of
+<tt class="docutils literal"><span class="pre">A<A<int></span> <span class="pre">></span></tt>).</li>
+<li><tt class="docutils literal"><span class="pre">LS_Auto</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Auto</span></tt>)
+Automatic detection based on the input.</li>
+</ul>
+</dd>
+<dt><strong>TabWidth</strong> (<tt class="docutils literal"><span class="pre">unsigned</span></tt>)</dt>
+<dd>The number of columns used for tab stops.</dd>
+<dt><strong>UseTab</strong> (<tt class="docutils literal"><span class="pre">UseTabStyle</span></tt>)</dt>
+<dd><p class="first">The way to use tab characters in the resulting file.</p>
+<p>Possible values:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">UT_Never</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Never</span></tt>)
+Never use tab.</li>
+<li><tt class="docutils literal"><span class="pre">UT_ForIndentation</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">ForIndentation</span></tt>)
+Use tabs only for indentation.</li>
+<li><tt class="docutils literal"><span class="pre">UT_Always</span></tt> (in configuration: <tt class="docutils literal"><span class="pre">Always</span></tt>)
+Use tabs whenever we need to fill whitespace that spans at least from
+one tab stop to the next one.</li>
+</ul>
+</dd>
+</dl>
+</div>
+<div class="section" id="examples">
+<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
+<p>A style similar to the <a class="reference external" href="https://www.kernel.org/doc/Documentation/CodingStyle">Linux Kernel style</a>:</p>
+<div class="highlight-yaml"><div class="highlight"><pre><span class="l-Scalar-Plain">BasedOnStyle</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">LLVM</span>
+<span class="l-Scalar-Plain">IndentWidth</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">8</span>
+<span class="l-Scalar-Plain">UseTab</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">Always</span>
+<span class="l-Scalar-Plain">BreakBeforeBraces</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">Linux</span>
+<span class="l-Scalar-Plain">AllowShortIfStatementsOnASingleLine</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">false</span>
+<span class="l-Scalar-Plain">IndentCaseLabels</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">false</span>
+</pre></div>
+</div>
+<p>The result is (imagine that tabs are used for indentation here):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">test</span><span class="p">()</span>
+<span class="p">{</span>
+        <span class="k">switch</span> <span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">case</span> <span class="mi">0</span>:
+        <span class="k">case</span> <span class="mi">1</span>:
+                <span class="n">do_something</span><span class="p">();</span>
+                <span class="k">break</span><span class="p">;</span>
+        <span class="k">case</span> <span class="mi">2</span>:
+                <span class="n">do_something_else</span><span class="p">();</span>
+                <span class="k">break</span><span class="p">;</span>
+        <span class="nl">default:</span>
+                <span class="k">break</span><span class="p">;</span>
+        <span class="p">}</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">condition</span><span class="p">)</span>
+                <span class="n">do_something_completely_different</span><span class="p">();</span>
+
+        <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="n">y</span><span class="p">)</span> <span class="p">{</span>
+                <span class="n">q</span><span class="p">();</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="n">y</span><span class="p">)</span> <span class="p">{</span>
+                <span class="n">w</span><span class="p">();</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+                <span class="n">r</span><span class="p">();</span>
+        <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>A style similar to the default Visual Studio formatting style:</p>
+<div class="highlight-yaml"><div class="highlight"><pre><span class="l-Scalar-Plain">UseTab</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">Never</span>
+<span class="l-Scalar-Plain">IndentWidth</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">4</span>
+<span class="l-Scalar-Plain">BreakBeforeBraces</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">Allman</span>
+<span class="l-Scalar-Plain">AllowShortIfStatementsOnASingleLine</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">false</span>
+<span class="l-Scalar-Plain">IndentCaseLabels</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">false</span>
+<span class="l-Scalar-Plain">ColumnLimit</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">0</span>
+</pre></div>
+</div>
+<p>The result is:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">test</span><span class="p">()</span>
+<span class="p">{</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">suffix</span><span class="p">)</span>
+    <span class="p">{</span>
+    <span class="k">case</span> <span class="mi">0</span>:
+    <span class="k">case</span> <span class="mi">1</span>:
+        <span class="n">do_something</span><span class="p">();</span>
+        <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="mi">2</span>:
+        <span class="n">do_something_else</span><span class="p">();</span>
+        <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>
+        <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">condition</span><span class="p">)</span>
+        <span class="n">do_somthing_completely_different</span><span class="p">();</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="n">y</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">q</span><span class="p">();</span>
+    <span class="p">}</span>
+    <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="n">y</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">w</span><span class="p">();</span>
+    <span class="p">}</span>
+    <span class="k">else</span>
+    <span class="p">{</span>
+        <span class="n">r</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="ClangFormat.html">ClangFormat</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="InternalsManual.html">“Clang” CFE Internals Manual</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangPlugins.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangPlugins.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangPlugins.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangPlugins.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,151 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Clang Plugins — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="How to write RecursiveASTVisitor based ASTFrontendActions." href="RAVFrontendAction.html" />
+    <link rel="prev" title="LibFormat" href="LibFormat.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Clang Plugins</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="LibFormat.html">LibFormat</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="RAVFrontendAction.html">How to write RecursiveASTVisitor based ASTFrontendActions.</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-plugins">
+<h1>Clang Plugins<a class="headerlink" href="#clang-plugins" title="Permalink to this headline">¶</a></h1>
+<p>Clang Plugins make it possible to run extra user defined actions during a
+compilation. This document will provide a basic walkthrough of how to write and
+run a Clang Plugin.</p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Clang Plugins run FrontendActions over code. See the <a class="reference internal" href="RAVFrontendAction.html"><em>FrontendAction
+tutorial</em></a> on how to write a <tt class="docutils literal"><span class="pre">FrontendAction</span></tt> using the
+<tt class="docutils literal"><span class="pre">RecursiveASTVisitor</span></tt>. In this tutorial, we’ll demonstrate how to write a
+simple clang plugin.</p>
+</div>
+<div class="section" id="writing-a-pluginastaction">
+<h2>Writing a <tt class="docutils literal"><span class="pre">PluginASTAction</span></tt><a class="headerlink" href="#writing-a-pluginastaction" title="Permalink to this headline">¶</a></h2>
+<p>The main difference from writing normal <tt class="docutils literal"><span class="pre">FrontendActions</span></tt> is that you can
+handle plugin command line options. The <tt class="docutils literal"><span class="pre">PluginASTAction</span></tt> base class declares
+a <tt class="docutils literal"><span class="pre">ParseArgs</span></tt> method which you have to implement in your plugin.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="nf">ParseArgs</span><span class="p">(</span><span class="k">const</span> <span class="n">CompilerInstance</span> <span class="o">&</span><span class="n">CI</span><span class="p">,</span>
+               <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">>&</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="s">"-some-arg"</span><span class="p">)</span> <span class="p">{</span>
+      <span class="c1">// Handle the command line argument.</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="registering-a-plugin">
+<h2>Registering a plugin<a class="headerlink" href="#registering-a-plugin" title="Permalink to this headline">¶</a></h2>
+<p>A plugin is loaded from a dynamic library at runtime by the compiler. To
+register a plugin in a library, use <tt class="docutils literal"><span class="pre">FrontendPluginRegistry::Add<></span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">FrontendPluginRegistry</span><span class="o">::</span><span class="n">Add</span><span class="o"><</span><span class="n">MyPlugin</span><span class="o">></span> <span class="n">X</span><span class="p">(</span><span class="s">"my-plugin-name"</span><span class="p">,</span> <span class="s">"my plugin description"</span><span class="p">);</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="putting-it-all-together">
+<h2>Putting it all together<a class="headerlink" href="#putting-it-all-together" title="Permalink to this headline">¶</a></h2>
+<p>Let’s look at an example plugin that prints top-level function names.  This
+example is checked into the clang repository; please take a look at
+the <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?view=markup">latest version of PrintFunctionNames.cpp</a>.</p>
+</div>
+<div class="section" id="running-the-plugin">
+<h2>Running the plugin<a class="headerlink" href="#running-the-plugin" title="Permalink to this headline">¶</a></h2>
+<p>To run a plugin, the dynamic library containing the plugin registry must be
+loaded via the <em class="xref std std-option">-load</em> command line option. This will load all plugins
+that are registered, and you can select the plugins to run by specifying the
+<em class="xref std std-option">-plugin</em> option. Additional parameters for the plugins can be passed with
+<em class="xref std std-option">-plugin-arg-</em>.</p>
+<p>Note that those options must reach clang’s cc1 process. There are two
+ways to do so:</p>
+<ul class="simple">
+<li>Directly call the parsing process by using the <em class="xref std std-option">-cc1</em> option; this
+has the downside of not configuring the default header search paths, so
+you’ll need to specify the full system path configuration on the command
+line.</li>
+<li>Use clang as usual, but prefix all arguments to the cc1 process with
+<em class="xref std std-option">-Xclang</em>.</li>
+</ul>
+<p>For example, to run the <tt class="docutils literal"><span class="pre">print-function-names</span></tt> plugin over a source file in
+clang, first build the plugin, and then call clang with the plugin from the
+source tree:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> <span class="nb">export </span><span class="nv">BD</span><span class="o">=</span>/path/to/build/directory
+<span class="gp">$</span> <span class="o">(</span><span class="nb">cd</span> <span class="nv">$BD</span> <span class="o">&&</span> make PrintFunctionNames <span class="o">)</span>
+<span class="gp">$</span> clang++ -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS <span class="se">\</span>
+<span class="go">          -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE \</span>
+<span class="go">          -I$BD/tools/clang/include -Itools/clang/include -I$BD/include -Iinclude \</span>
+<span class="go">          tools/clang/tools/clang-check/ClangCheck.cpp -fsyntax-only \</span>
+<span class="go">          -Xclang -load -Xclang $BD/lib/PrintFunctionNames.so -Xclang \</span>
+<span class="go">          -plugin -Xclang print-fns</span>
+</pre></div>
+</div>
+<p>Also see the print-function-name plugin example’s
+<a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/README.txt?view=markup">README</a></p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="LibFormat.html">LibFormat</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="RAVFrontendAction.html">How to write RecursiveASTVisitor based ASTFrontendActions.</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangTools.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangTools.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangTools.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ClangTools.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,246 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Overview — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="ClangCheck" href="ClangCheck.html" />
+    <link rel="prev" title="JSON Compilation Database Format Specification" href="JSONCompilationDatabase.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Overview</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="JSONCompilationDatabase.html">JSON Compilation Database Format Specification</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangCheck.html">ClangCheck</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="overview">
+<h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h1>
+<p>Clang Tools are standalone command line (and potentially GUI) tools
+designed for use by C++ developers who are already using and enjoying
+Clang as their compiler. These tools provide developer-oriented
+functionality such as fast syntax checking, automatic formatting,
+refactoring, etc.</p>
+<p>Only a couple of the most basic and fundamental tools are kept in the
+primary Clang Subversion project. The rest of the tools are kept in a
+side-project so that developers who don’t want or need to build them
+don’t. If you want to get access to the extra Clang Tools repository,
+simply check it out into the tools tree of your Clang checkout and
+follow the usual process for building and working with a combined
+LLVM/Clang checkout:</p>
+<ul class="simple">
+<li>With Subversion:<ul>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/tools/clang/tools</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">svn</span> <span class="pre">co</span> <span class="pre">http://llvm.org/svn/llvm-project/clang-tools-extra/trunk</span> <span class="pre">extra</span></tt></li>
+</ul>
+</li>
+<li>Or with Git:<ul>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/tools/clang/tools</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">http://llvm.org/git/clang-tools-extra.git</span> <span class="pre">extra</span></tt></li>
+</ul>
+</li>
+</ul>
+<p>This document describes a high-level overview of the organization of
+Clang Tools within the project as well as giving an introduction to some
+of the more important tools. However, it should be noted that this
+document is currently focused on Clang and Clang Tool developers, not on
+end users of these tools.</p>
+<div class="section" id="clang-tools-organization">
+<h2>Clang Tools Organization<a class="headerlink" href="#clang-tools-organization" title="Permalink to this headline">¶</a></h2>
+<p>Clang Tools are CLI or GUI programs that are intended to be directly
+used by C++ developers. That is they are <em>not</em> primarily for use by
+Clang developers, although they are hopefully useful to C++ developers
+who happen to work on Clang, and we try to actively dogfood their
+functionality. They are developed in three components: the underlying
+infrastructure for building a standalone tool based on Clang, core
+shared logic used by many different tools in the form of refactoring and
+rewriting libraries, and the tools themselves.</p>
+<p>The underlying infrastructure for Clang Tools is the
+<a class="reference internal" href="LibTooling.html"><em>LibTooling</em></a> platform. See its documentation for much
+more detailed information about how this infrastructure works. The
+common refactoring and rewriting toolkit-style library is also part of
+LibTooling organizationally.</p>
+<p>A few Clang Tools are developed along side the core Clang libraries as
+examples and test cases of fundamental functionality. However, most of
+the tools are developed in a side repository to provide easy separation
+from the core libraries. We intentionally do not support public
+libraries in the side repository, as we want to carefully review and
+find good APIs for libraries as they are lifted out of a few tools and
+into the core Clang library set.</p>
+<p>Regardless of which repository Clang Tools’ code resides in, the
+development process and practices for all Clang Tools are exactly those
+of Clang itself. They are entirely within the Clang <em>project</em>,
+regardless of the version control scheme.</p>
+</div>
+<div class="section" id="core-clang-tools">
+<h2>Core Clang Tools<a class="headerlink" href="#core-clang-tools" title="Permalink to this headline">¶</a></h2>
+<p>The core set of Clang tools that are within the main repository are
+tools that very specifically complement, and allow use and testing of
+<em>Clang</em> specific functionality.</p>
+<div class="section" id="clang-check">
+<h3><tt class="docutils literal"><span class="pre">clang-check</span></tt><a class="headerlink" href="#clang-check" title="Permalink to this headline">¶</a></h3>
+<p><a class="reference internal" href="ClangCheck.html"><em>ClangCheck</em></a> combines the LibTooling framework for running a
+Clang tool with the basic Clang diagnostics by syntax checking specific files
+in a fast, command line interface. It can also accept flags to re-display the
+diagnostics in different formats with different flags, suitable for use driving
+an IDE or editor. Furthermore, it can be used in fixit-mode to directly apply
+fixit-hints offered by clang. See <a class="reference internal" href="HowToSetupToolingForLLVM.html"><em>How To Setup Clang Tooling For LLVM</em></a> for
+instructions on how to setup and used <cite>clang-check</cite>.</p>
+<div class="section" id="clang-format">
+<h4><tt class="docutils literal"><span class="pre">clang-format</span></tt><a class="headerlink" href="#clang-format" title="Permalink to this headline">¶</a></h4>
+<p>Clang-format is both a <a class="reference internal" href="LibFormat.html"><em>library</em></a> and a <a class="reference internal" href="ClangFormat.html"><em>stand-alone tool</em></a> with the goal of automatically reformatting C++ sources files
+according to configurable style guides.  To do so, clang-format uses Clang’s
+<tt class="docutils literal"><span class="pre">Lexer</span></tt> to transform an input file into a token stream and then changes all
+the whitespace around those tokens.  The goal is for clang-format to serve both
+as a user tool (ideally with powerful IDE integrations) and as part of other
+refactoring tools, e.g. to do a reformatting of all the lines changed during a
+renaming.</p>
+</div>
+<div class="section" id="clang-modernize">
+<h4><tt class="docutils literal"><span class="pre">clang-modernize</span></tt><a class="headerlink" href="#clang-modernize" title="Permalink to this headline">¶</a></h4>
+<p><tt class="docutils literal"><span class="pre">clang-modernize</span></tt> migrates C++ code to use C++11 features where appropriate.
+Currently it can:</p>
+<ul class="simple">
+<li>convert loops to range-based for loops;</li>
+<li>convert null pointer constants (like <tt class="docutils literal"><span class="pre">NULL</span></tt> or <tt class="docutils literal"><span class="pre">0</span></tt>) to C++11 <tt class="docutils literal"><span class="pre">nullptr</span></tt>;</li>
+<li>replace the type specifier in variable declarations with the <tt class="docutils literal"><span class="pre">auto</span></tt> type specifier;</li>
+<li>add the <tt class="docutils literal"><span class="pre">override</span></tt> specifier to applicable member functions.</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="section" id="extra-clang-tools">
+<h2>Extra Clang Tools<a class="headerlink" href="#extra-clang-tools" title="Permalink to this headline">¶</a></h2>
+<p>As various categories of Clang Tools are added to the extra repository,
+they’ll be tracked here. The focus of this documentation is on the scope
+and features of the tools for other tool developers; each tool should
+provide its own user-focused documentation.</p>
+</div>
+<div class="section" id="ideas-for-new-tools">
+<h2>Ideas for new Tools<a class="headerlink" href="#ideas-for-new-tools" title="Permalink to this headline">¶</a></h2>
+<ul>
+<li><p class="first">C++ cast conversion tool.  Will convert C-style casts (<tt class="docutils literal"><span class="pre">(type)</span> <span class="pre">value</span></tt>) to
+appropriate C++ cast (<tt class="docutils literal"><span class="pre">static_cast</span></tt>, <tt class="docutils literal"><span class="pre">const_cast</span></tt> or
+<tt class="docutils literal"><span class="pre">reinterpret_cast</span></tt>).</p>
+</li>
+<li><p class="first">Non-member <tt class="docutils literal"><span class="pre">begin()</span></tt> and <tt class="docutils literal"><span class="pre">end()</span></tt> conversion tool.  Will convert
+<tt class="docutils literal"><span class="pre">foo.begin()</span></tt> into <tt class="docutils literal"><span class="pre">begin(foo)</span></tt> and similarly for <tt class="docutils literal"><span class="pre">end()</span></tt>, where
+<tt class="docutils literal"><span class="pre">foo</span></tt> is a standard container.  We could also detect similar patterns for
+arrays.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">make_shared</span></tt> / <tt class="docutils literal"><span class="pre">make_unique</span></tt> conversion.  Part of this transformation
+can be incorporated into the <tt class="docutils literal"><span class="pre">auto</span></tt> transformation.  Will convert</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span> <span class="n">sp</span><span class="p">(</span><span class="k">new</span> <span class="n">Foo</span><span class="p">);</span>
+<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span> <span class="n">up</span><span class="p">(</span><span class="k">new</span> <span class="n">Foo</span><span class="p">);</span>
+
+<span class="n">func</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span><span class="p">(</span><span class="k">new</span> <span class="n">Foo</span><span class="p">),</span> <span class="n">bar</span><span class="p">());</span>
+</pre></div>
+</div>
+<p>into:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">auto</span> <span class="n">sp</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">make_shared</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span><span class="p">();</span>
+<span class="k">auto</span> <span class="n">up</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span><span class="p">();</span> <span class="c1">// In C++14 mode.</span>
+
+<span class="c1">// This also affects correctness.  For the cases where bar() throws,</span>
+<span class="c1">// make_shared() is safe and the original code may leak.</span>
+<span class="n">func</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_shared</span><span class="o"><</span><span class="n">Foo</span><span class="o">></span><span class="p">(),</span> <span class="n">bar</span><span class="p">());</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">tr1</span></tt> removal tool.  Will migrate source code from using TR1 library
+features to C++11 library.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include <tr1/unordered_map></span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">tr1</span><span class="o">::</span><span class="n">unordered_map</span> <span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">ma</span><span class="p">;</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">ma</span><span class="p">.</span><span class="n">size</span> <span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>should be rewritten to:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include <unordered_map></span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">unordered_map</span> <span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">ma</span><span class="p">;</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">ma</span><span class="p">.</span><span class="n">size</span> <span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">A tool to remove <tt class="docutils literal"><span class="pre">auto</span></tt>.  Will convert <tt class="docutils literal"><span class="pre">auto</span></tt> to an explicit type or add
+comments with deduced types.  The motivation is that there are developers
+that don’t want to use <tt class="docutils literal"><span class="pre">auto</span></tt> because they are afraid that they might lose
+control over their code.</p>
+</li>
+<li><p class="first">C++14: less verbose operator function objects (<a class="reference external" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3421.htm">N3421</a>).
+For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">sort</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">v</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span class="n">greater</span><span class="o"><</span><span class="n">ValueType</span><span class="o">></span><span class="p">());</span>
+</pre></div>
+</div>
+<p>should be rewritten to:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">sort</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">v</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span class="n">greater</span><span class="o"><></span><span class="p">());</span>
+</pre></div>
+</div>
+</li>
+</ul>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="JSONCompilationDatabase.html">JSON Compilation Database Format Specification</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangCheck.html">ClangCheck</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/CrossCompilation.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/CrossCompilation.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/CrossCompilation.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/CrossCompilation.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,263 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Cross-compilation using Clang — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Thread Safety Analysis" href="ThreadSafetyAnalysis.html" />
+    <link rel="prev" title="Attributes in Clang" href="AttributeReference.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Cross-compilation using Clang</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="AttributeReference.html">Attributes in Clang</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ThreadSafetyAnalysis.html">Thread Safety Analysis</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="cross-compilation-using-clang">
+<h1>Cross-compilation using Clang<a class="headerlink" href="#cross-compilation-using-clang" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document will guide you in choosing the right Clang options
+for cross-compiling your code to a different architecture. It assumes you
+already know how to compile the code in question for the host architecture,
+and that you know how to choose additional include and library paths.</p>
+<p>However, this document is <em>not</em> a “how to” and won’t help you setting your
+build system or Makefiles, nor choosing the right CMake options, etc.
+Also, it does not cover all the possible options, nor does it contain
+specific examples for specific architectures. For a concrete example, the
+<a class="reference external" href="http://llvm.org/docs/HowToCrossCompileLLVM.html">instructions for cross-compiling LLVM itself</a> may be of interest.</p>
+<p>After reading this document, you should be familiar with the main issues
+related to cross-compilation, and what main compiler options Clang provides
+for performing cross-compilation.</p>
+</div>
+<div class="section" id="cross-compilation-issues">
+<h2>Cross compilation issues<a class="headerlink" href="#cross-compilation-issues" title="Permalink to this headline">¶</a></h2>
+<p>In GCC world, every host/target combination has its own set of binaries,
+headers, libraries, etc. So, it’s usually simple to download a package
+with all files in, unzip to a directory and point the build system to
+that compiler, that will know about its location and find all it needs to
+when compiling your code.</p>
+<p>On the other hand, Clang/LLVM is natively a cross-compiler, meaning that
+one set of programs can compile to all targets by setting the <tt class="docutils literal"><span class="pre">-target</span></tt>
+option. That makes it a lot easier for programers wishing to compile to
+different platforms and architectures, and for compiler developers that
+only have to maintain one build system, and for OS distributions, that
+need only one set of main packages.</p>
+<p>But, as is true to any cross-compiler, and given the complexity of
+different architectures, OS’s and options, it’s not always easy finding
+the headers, libraries or binutils to generate target specific code.
+So you’ll need special options to help Clang understand what target
+you’re compiling to, where your tools are, etc.</p>
+<p>Another problem is that compilers come with standard libraries only (like
+<tt class="docutils literal"><span class="pre">compiler-rt</span></tt>, <tt class="docutils literal"><span class="pre">libcxx</span></tt>, <tt class="docutils literal"><span class="pre">libgcc</span></tt>, <tt class="docutils literal"><span class="pre">libm</span></tt>, etc), so you’ll have to
+find and make available to the build system, every other library required
+to build your software, that is specific to your target. It’s not enough to
+have your host’s libraries installed.</p>
+<p>Finally, not all toolchains are the same, and consequently, not every Clang
+option will work magically. Some options, like <tt class="docutils literal"><span class="pre">--sysroot</span></tt> (which
+effectively changes the logical root for headers and libraries), assume
+all your binaries and libraries are in the same directory, which may not
+true when your cross-compiler was installed by the distribution’s package
+management. So, for each specific case, you may use more than one
+option, and in most cases, you’ll end up setting include paths (<tt class="docutils literal"><span class="pre">-I</span></tt>) and
+library paths (<tt class="docutils literal"><span class="pre">-L</span></tt>) manually.</p>
+<dl class="docutils">
+<dt>To sum up, different toolchains can:</dt>
+<dd><ul class="first last simple">
+<li>be host/target specific or more flexible</li>
+<li>be in a single directory, or spread out across your system</li>
+<li>have different sets of libraries and headers by default</li>
+<li>need special options, which your build system won’t be able to figure
+out by itself</li>
+</ul>
+</dd>
+</dl>
+</div>
+<div class="section" id="general-cross-compilation-options-in-clang">
+<h2>General Cross-Compilation Options in Clang<a class="headerlink" href="#general-cross-compilation-options-in-clang" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="target-triple">
+<h3>Target Triple<a class="headerlink" href="#target-triple" title="Permalink to this headline">¶</a></h3>
+<p>The basic option is to define the target architecture. For that, use
+<tt class="docutils literal"><span class="pre">-target</span> <span class="pre"><triple></span></tt>. If you don’t specify the target, CPU names won’t
+match (since Clang assumes the host triple), and the compilation will
+go ahead, creating code for the host platform, which will break later
+on when assembling or linking.</p>
+<dl class="docutils">
+<dt>The triple has the general format <tt class="docutils literal"><span class="pre"><arch><sub>-<vendor>-<sys>-<abi></span></tt>, where:</dt>
+<dd><ul class="first last simple">
+<li><tt class="docutils literal"><span class="pre">arch</span></tt> = <tt class="docutils literal"><span class="pre">x86</span></tt>, <tt class="docutils literal"><span class="pre">arm</span></tt>, <tt class="docutils literal"><span class="pre">thumb</span></tt>, <tt class="docutils literal"><span class="pre">mips</span></tt>, etc.</li>
+<li><tt class="docutils literal"><span class="pre">sub</span></tt> = for ex. on ARM: <tt class="docutils literal"><span class="pre">v5</span></tt>, <tt class="docutils literal"><span class="pre">v6m</span></tt>, <tt class="docutils literal"><span class="pre">v7a</span></tt>, <tt class="docutils literal"><span class="pre">v7m</span></tt>, etc.</li>
+<li><tt class="docutils literal"><span class="pre">vendor</span></tt> = <tt class="docutils literal"><span class="pre">pc</span></tt>, <tt class="docutils literal"><span class="pre">apple</span></tt>, <tt class="docutils literal"><span class="pre">nvidia</span></tt>, <tt class="docutils literal"><span class="pre">ibm</span></tt>, etc.</li>
+<li><tt class="docutils literal"><span class="pre">sys</span></tt> = <tt class="docutils literal"><span class="pre">none</span></tt>, <tt class="docutils literal"><span class="pre">linux</span></tt>, <tt class="docutils literal"><span class="pre">win32</span></tt>, <tt class="docutils literal"><span class="pre">darwin</span></tt>, <tt class="docutils literal"><span class="pre">cuda</span></tt>, etc.</li>
+<li><tt class="docutils literal"><span class="pre">abi</span></tt> = <tt class="docutils literal"><span class="pre">eabi</span></tt>, <tt class="docutils literal"><span class="pre">gnu</span></tt>, <tt class="docutils literal"><span class="pre">android</span></tt>, <tt class="docutils literal"><span class="pre">macho</span></tt>, <tt class="docutils literal"><span class="pre">elf</span></tt>, etc.</li>
+</ul>
+</dd>
+</dl>
+<p>The sub-architecture options are available for their own architectures,
+of course, so “x86v7a” doesn’t make sense. The vendor needs to be
+specified only if there’s a relevant change, for instance between PC
+and Apple. Most of the time it can be omitted (and Unknown)
+will be assumed, which sets the defaults for the specified architecture.
+The system name is generally the OS (linux, darwin), but could be special
+like the bare-metal “none”.</p>
+<p>When a parameter is not important, they can be omitted, or you can
+choose <tt class="docutils literal"><span class="pre">unknown</span></tt> and the defaults will be used. If you choose a parameter
+that Clang doesn’t know, like <tt class="docutils literal"><span class="pre">blerg</span></tt>, it’ll ignore and assume
+<tt class="docutils literal"><span class="pre">unknown</span></tt>, which is not always desired, so be careful.</p>
+<p>Finally, the ABI option is something that will pick default CPU/FPU,
+define the specific behaviour of your code (PCS, extensions),
+and also choose the correct library calls, etc.</p>
+</div>
+<div class="section" id="cpu-fpu-abi">
+<h3>CPU, FPU, ABI<a class="headerlink" href="#cpu-fpu-abi" title="Permalink to this headline">¶</a></h3>
+<p>Once your target is specified, it’s time to pick the hardware you’ll
+be compiling to. For every architecture, a default set of CPU/FPU/ABI
+will be chosen, so you’ll almost always have to change it via flags.</p>
+<dl class="docutils">
+<dt>Typical flags include:</dt>
+<dd><ul class="first last simple">
+<li><tt class="docutils literal"><span class="pre">-mcpu=<cpu-name></span></tt>, like x86-64, swift, cortex-a15</li>
+<li><tt class="docutils literal"><span class="pre">-fpu=<fpu-name></span></tt>, like SSE3, NEON, controlling the FP unit available</li>
+<li><tt class="docutils literal"><span class="pre">-mfloat-abi=<fabi></span></tt>, like soft, hard, controlling which registers
+to use for floating-point</li>
+</ul>
+</dd>
+</dl>
+<p>The default is normally the common denominator, so that Clang doesn’t
+generate code that breaks. But that also means you won’t get the best
+code for your specific hardware, which may mean orders of magnitude
+slower than you expect.</p>
+<p>For example, if your target is <tt class="docutils literal"><span class="pre">arm-none-eabi</span></tt>, the default CPU will
+be <tt class="docutils literal"><span class="pre">arm7tdmi</span></tt> using soft float, which is extremely slow on modern cores,
+whereas if your triple is <tt class="docutils literal"><span class="pre">armv7a-none-eabi</span></tt>, it’ll be Cortex-A8 with
+NEON, but still using soft-float, which is much better, but still not
+great.</p>
+</div>
+<div class="section" id="toolchain-options">
+<h3>Toolchain Options<a class="headerlink" href="#toolchain-options" title="Permalink to this headline">¶</a></h3>
+<p>There are three main options to control access to your cross-compiler:
+<tt class="docutils literal"><span class="pre">--sysroot</span></tt>, <tt class="docutils literal"><span class="pre">-I</span></tt>, and <tt class="docutils literal"><span class="pre">-L</span></tt>. The two last ones are well known,
+but they’re particularly important for additional libraries
+and headers that are specific to your target.</p>
+<p>There are two main ways to have a cross-compiler:</p>
+<ol class="arabic">
+<li><p class="first">When you have extracted your cross-compiler from a zip file into
+a directory, you have to use <tt class="docutils literal"><span class="pre">--sysroot=<path></span></tt>. The path is the
+root directory where you have unpacked your file, and Clang will
+look for the directories <tt class="docutils literal"><span class="pre">bin</span></tt>, <tt class="docutils literal"><span class="pre">lib</span></tt>, <tt class="docutils literal"><span class="pre">include</span></tt> in there.</p>
+<p>In this case, your setup should be pretty much done (if no
+additional headers or libraries are needed), as Clang will find
+all binaries it needs (assembler, linker, etc) in there.</p>
+</li>
+<li><p class="first">When you have installed via a package manager (modern Linux
+distributions have cross-compiler packages available), make
+sure the target triple you set is <em>also</em> the prefix of your
+cross-compiler toolchain.</p>
+<p>In this case, Clang will find the other binaries (assembler,
+linker), but not always where the target headers and libraries
+are. People add system-specific clues to Clang often, but as
+things change, it’s more likely that it won’t find than the
+other way around.</p>
+<p>So, here, you’ll be a lot safer if you specify the include/library
+directories manually (via <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-L</span></tt>).</p>
+</li>
+</ol>
+</div>
+</div>
+<div class="section" id="target-specific-libraries">
+<h2>Target-Specific Libraries<a class="headerlink" href="#target-specific-libraries" title="Permalink to this headline">¶</a></h2>
+<p>All libraries that you compile as part of your build will be
+cross-compiled to your target, and your build system will probably
+find them in the right place. But all dependencies that are
+normally checked against (like <tt class="docutils literal"><span class="pre">libxml</span></tt> or <tt class="docutils literal"><span class="pre">libz</span></tt> etc) will match
+against the host platform, not the target.</p>
+<p>So, if the build system is not aware that you want to cross-compile
+your code, it will get every dependency wrong, and your compilation
+will fail during build time, not configure time.</p>
+<p>Also, finding the libraries for your target are not as easy
+as for your host machine. There aren’t many cross-libraries available
+as packages to most OS’s, so you’ll have to either cross-compile them
+from source, or download the package for your target platform,
+extract the libraries and headers, put them in specific directories
+and add <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-L</span></tt> pointing to them.</p>
+<p>Also, some libraries have different dependencies on different targets,
+so configuration tools to find dependencies in the host can get the
+list wrong for the target platform. This means that the configuration
+of your build can get things wrong when setting their own library
+paths, and you’ll have to augment it via additional flags (configure,
+Make, CMake, etc).</p>
+<div class="section" id="multilibs">
+<h3>Multilibs<a class="headerlink" href="#multilibs" title="Permalink to this headline">¶</a></h3>
+<p>When you want to cross-compile to more than one configuration, for
+example hard-float-ARM and soft-float-ARM, you’ll have to have multiple
+copies of your libraries and (possibly) headers.</p>
+<p>Some Linux distributions have support for Multilib, which handle that
+for you in an easier way, but if you’re not careful and, for instance,
+forget to specify <tt class="docutils literal"><span class="pre">-ccc-gcc-name</span> <span class="pre">armv7l-linux-gnueabihf-gcc</span></tt> (which
+uses hard-float), Clang will pick the <tt class="docutils literal"><span class="pre">armv7l-linux-gnueabi-ld</span></tt>
+(which uses soft-float) and linker errors will happen.</p>
+<p>The same is true if you’re compiling for different ABIs, like <tt class="docutils literal"><span class="pre">gnueabi</span></tt>
+and <tt class="docutils literal"><span class="pre">androideabi</span></tt>, and might even link and run, but produce run-time
+errors, which are much harder to track down and fix.</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="AttributeReference.html">Attributes in Clang</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ThreadSafetyAnalysis.html">Thread Safety Analysis</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizer.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizer.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizer.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,225 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>DataFlowSanitizer — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="DataFlowSanitizer Design Document" href="DataFlowSanitizerDesign.html" />
+    <link rel="prev" title="MemorySanitizer" href="MemorySanitizer.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>DataFlowSanitizer</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="MemorySanitizer.html">MemorySanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="dataflowsanitizer">
+<h1>DataFlowSanitizer<a class="headerlink" href="#dataflowsanitizer" title="Permalink to this headline">¶</a></h1>
+<div class="toctree-wrapper compound">
+</div>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#usage" id="id2">Usage</a><ul>
+<li><a class="reference internal" href="#abi-list" id="id3">ABI List</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#example" id="id4">Example</a></li>
+<li><a class="reference internal" href="#current-status" id="id5">Current status</a></li>
+<li><a class="reference internal" href="#design" id="id6">Design</a></li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>DataFlowSanitizer is a generalised dynamic data flow analysis.</p>
+<p>Unlike other Sanitizer tools, this tool is not designed to detect a
+specific class of bugs on its own.  Instead, it provides a generic
+dynamic data flow analysis framework to be used by clients to help
+detect application-specific issues within their own code.</p>
+</div>
+<div class="section" id="usage">
+<h2><a class="toc-backref" href="#id2">Usage</a><a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
+<p>With no program changes, applying DataFlowSanitizer to a program
+will not alter its behavior.  To use DataFlowSanitizer, the program
+uses API functions to apply tags to data to cause it to be tracked, and to
+check the tag of a specific data item.  DataFlowSanitizer manages
+the propagation of tags through the program according to its data flow.</p>
+<p>The APIs are defined in the header file <tt class="docutils literal"><span class="pre">sanitizer/dfsan_interface.h</span></tt>.
+For further information about each function, please refer to the header
+file.</p>
+<div class="section" id="abi-list">
+<h3><a class="toc-backref" href="#id3">ABI List</a><a class="headerlink" href="#abi-list" title="Permalink to this headline">¶</a></h3>
+<p>DataFlowSanitizer uses a list of functions known as an ABI list to decide
+whether a call to a specific function should use the operating system’s native
+ABI or whether it should use a variant of this ABI that also propagates labels
+through function parameters and return values.  The ABI list file also controls
+how labels are propagated in the former case.  DataFlowSanitizer comes with a
+default ABI list which is intended to eventually cover the glibc library on
+Linux but it may become necessary for users to extend the ABI list in cases
+where a particular library or function cannot be instrumented (e.g. because
+it is implemented in assembly or another language which DataFlowSanitizer does
+not support) or a function is called from a library or function which cannot
+be instrumented.</p>
+<p>DataFlowSanitizer’s ABI list file is a <a class="reference internal" href="SanitizerSpecialCaseList.html"><em>Sanitizer special case list</em></a>.
+The pass treats every function in the <tt class="docutils literal"><span class="pre">uninstrumented</span></tt> category in the
+ABI list file as conforming to the native ABI.  Unless the ABI list contains
+additional categories for those functions, a call to one of those functions
+will produce a warning message, as the labelling behavior of the function
+is unknown.  The other supported categories are <tt class="docutils literal"><span class="pre">discard</span></tt>, <tt class="docutils literal"><span class="pre">functional</span></tt>
+and <tt class="docutils literal"><span class="pre">custom</span></tt>.</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">discard</span></tt> – To the extent that this function writes to (user-accessible)
+memory, it also updates labels in shadow memory (this condition is trivially
+satisfied for functions which do not write to user-accessible memory).  Its
+return value is unlabelled.</li>
+<li><tt class="docutils literal"><span class="pre">functional</span></tt> – Like <tt class="docutils literal"><span class="pre">discard</span></tt>, except that the label of its return value
+is the union of the label of its arguments.</li>
+<li><tt class="docutils literal"><span class="pre">custom</span></tt> – Instead of calling the function, a custom wrapper <tt class="docutils literal"><span class="pre">__dfsw_F</span></tt>
+is called, where <tt class="docutils literal"><span class="pre">F</span></tt> is the name of the function.  This function may wrap
+the original function or provide its own implementation.  This category is
+generally used for uninstrumentable functions which write to user-accessible
+memory or which have more complex label propagation behavior.  The signature
+of <tt class="docutils literal"><span class="pre">__dfsw_F</span></tt> is based on that of <tt class="docutils literal"><span class="pre">F</span></tt> with each argument having a
+label of type <tt class="docutils literal"><span class="pre">dfsan_label</span></tt> appended to the argument list.  If <tt class="docutils literal"><span class="pre">F</span></tt>
+is of non-void return type a final argument of type <tt class="docutils literal"><span class="pre">dfsan_label</span> <span class="pre">*</span></tt>
+is appended to which the custom function can store the label for the
+return value.  For example:</li>
+</ul>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">);</span>
+<span class="kt">void</span> <span class="nf">__dfsw_f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="n">dfsan_label</span> <span class="n">x_label</span><span class="p">);</span>
+
+<span class="kt">void</span> <span class="o">*</span><span class="nf">memcpy</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">dest</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span> <span class="o">*</span><span class="n">src</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">n</span><span class="p">);</span>
+<span class="kt">void</span> <span class="o">*</span><span class="nf">__dfsw_memcpy</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">dest</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span> <span class="o">*</span><span class="n">src</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">n</span><span class="p">,</span>
+                    <span class="n">dfsan_label</span> <span class="n">dest_label</span><span class="p">,</span> <span class="n">dfsan_label</span> <span class="n">src_label</span><span class="p">,</span>
+                    <span class="n">dfsan_label</span> <span class="n">n_label</span><span class="p">,</span> <span class="n">dfsan_label</span> <span class="o">*</span><span class="n">ret_label</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>If a function defined in the translation unit being compiled belongs to the
+<tt class="docutils literal"><span class="pre">uninstrumented</span></tt> category, it will be compiled so as to conform to the
+native ABI.  Its arguments will be assumed to be unlabelled, but it will
+propagate labels in shadow memory.</p>
+<p>For example:</p>
+<div class="highlight-none"><div class="highlight"><pre># main is called by the C runtime using the native ABI.
+fun:main=uninstrumented
+fun:main=discard
+
+# malloc only writes to its internal data structures, not user-accessible memory.
+fun:malloc=uninstrumented
+fun:malloc=discard
+
+# tolower is a pure function.
+fun:tolower=uninstrumented
+fun:tolower=functional
+
+# memcpy needs to copy the shadow from the source to the destination region.
+# This is done in a custom function.
+fun:memcpy=uninstrumented
+fun:memcpy=custom
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="example">
+<h2><a class="toc-backref" href="#id4">Example</a><a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2>
+<p>The following program demonstrates label propagation by checking that
+the correct labels are propagated.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include <sanitizer/dfsan_interface.h></span>
+<span class="cp">#include <assert.h></span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+  <span class="n">dfsan_label</span> <span class="n">i_label</span> <span class="o">=</span> <span class="n">dfsan_create_label</span><span class="p">(</span><span class="s">"i"</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+  <span class="n">dfsan_set_label</span><span class="p">(</span><span class="n">i_label</span><span class="p">,</span> <span class="o">&</span><span class="n">i</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
+
+  <span class="kt">int</span> <span class="n">j</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
+  <span class="n">dfsan_label</span> <span class="n">j_label</span> <span class="o">=</span> <span class="n">dfsan_create_label</span><span class="p">(</span><span class="s">"j"</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+  <span class="n">dfsan_set_label</span><span class="p">(</span><span class="n">j_label</span><span class="p">,</span> <span class="o">&</span><span class="n">j</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">j</span><span class="p">));</span>
+
+  <span class="kt">int</span> <span class="n">k</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
+  <span class="n">dfsan_label</span> <span class="n">k_label</span> <span class="o">=</span> <span class="n">dfsan_create_label</span><span class="p">(</span><span class="s">"k"</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+  <span class="n">dfsan_set_label</span><span class="p">(</span><span class="n">k_label</span><span class="p">,</span> <span class="o">&</span><span class="n">k</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">k</span><span class="p">));</span>
+
+  <span class="n">dfsan_label</span> <span class="n">ij_label</span> <span class="o">=</span> <span class="n">dfsan_get_label</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="n">j</span><span class="p">);</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ij_label</span><span class="p">,</span> <span class="n">i_label</span><span class="p">));</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ij_label</span><span class="p">,</span> <span class="n">j_label</span><span class="p">));</span>
+  <span class="n">assert</span><span class="p">(</span><span class="o">!</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ij_label</span><span class="p">,</span> <span class="n">k_label</span><span class="p">));</span>
+
+  <span class="n">dfsan_label</span> <span class="n">ijk_label</span> <span class="o">=</span> <span class="n">dfsan_get_label</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="n">j</span> <span class="o">+</span> <span class="n">k</span><span class="p">);</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ijk_label</span><span class="p">,</span> <span class="n">i_label</span><span class="p">));</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ijk_label</span><span class="p">,</span> <span class="n">j_label</span><span class="p">));</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">dfsan_has_label</span><span class="p">(</span><span class="n">ijk_label</span><span class="p">,</span> <span class="n">k_label</span><span class="p">));</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="current-status">
+<h2><a class="toc-backref" href="#id5">Current status</a><a class="headerlink" href="#current-status" title="Permalink to this headline">¶</a></h2>
+<p>DataFlowSanitizer is a work in progress, currently under development for
+x86_64 Linux.</p>
+</div>
+<div class="section" id="design">
+<h2><a class="toc-backref" href="#id6">Design</a><a class="headerlink" href="#design" title="Permalink to this headline">¶</a></h2>
+<p>Please refer to the <a class="reference internal" href="DataFlowSanitizerDesign.html"><em>design document</em></a>.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="MemorySanitizer.html">MemorySanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizerDesign.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizerDesign.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizerDesign.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DataFlowSanitizerDesign.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,295 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>DataFlowSanitizer Design Document — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="up" title="DataFlowSanitizer" href="DataFlowSanitizer.html" />
+    <link rel="next" title="LeakSanitizer" href="LeakSanitizer.html" />
+    <link rel="prev" title="DataFlowSanitizer" href="DataFlowSanitizer.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>DataFlowSanitizer Design Document</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="DataFlowSanitizer.html">DataFlowSanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LeakSanitizer.html">LeakSanitizer</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="dataflowsanitizer-design-document">
+<h1>DataFlowSanitizer Design Document<a class="headerlink" href="#dataflowsanitizer-design-document" title="Permalink to this headline">¶</a></h1>
+<p>This document sets out the design for DataFlowSanitizer, a general
+dynamic data flow analysis.  Unlike other Sanitizer tools, this tool is
+not designed to detect a specific class of bugs on its own. Instead,
+it provides a generic dynamic data flow analysis framework to be used
+by clients to help detect application-specific issues within their
+own code.</p>
+<p>DataFlowSanitizer is a program instrumentation which can associate
+a number of taint labels with any data stored in any memory region
+accessible by the program. The analysis is dynamic, which means that
+it operates on a running program, and tracks how the labels propagate
+through that program. The tool shall support a large (>100) number
+of labels, such that programs which operate on large numbers of data
+items may be analysed with each data item being tracked separately.</p>
+<div class="section" id="use-cases">
+<h2>Use Cases<a class="headerlink" href="#use-cases" title="Permalink to this headline">¶</a></h2>
+<p>This instrumentation can be used as a tool to help monitor how data
+flows from a program’s inputs (sources) to its outputs (sinks).
+This has applications from a privacy/security perspective in that
+one can audit how a sensitive data item is used within a program and
+ensure it isn’t exiting the program anywhere it shouldn’t be.</p>
+</div>
+<div class="section" id="interface">
+<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline">¶</a></h2>
+<p>A number of functions are provided which will create taint labels,
+attach labels to memory regions and extract the set of labels
+associated with a specific memory region. These functions are declared
+in the header file <tt class="docutils literal"><span class="pre">sanitizer/dfsan_interface.h</span></tt>.</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="c1">/// Creates and returns a base label with the given description and user data.</span>
+<span class="n">dfsan_label</span> <span class="nf">dfsan_create_label</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">desc</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">userdata</span><span class="p">);</span>
+
+<span class="c1">/// Sets the label for each address in [addr,addr+size) to \c label.</span>
+<span class="kt">void</span> <span class="nf">dfsan_set_label</span><span class="p">(</span><span class="n">dfsan_label</span> <span class="n">label</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">size</span><span class="p">);</span>
+
+<span class="c1">/// Sets the label for each address in [addr,addr+size) to the union of the</span>
+<span class="c1">/// current label for that address and \c label.</span>
+<span class="kt">void</span> <span class="nf">dfsan_add_label</span><span class="p">(</span><span class="n">dfsan_label</span> <span class="n">label</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">size</span><span class="p">);</span>
+
+<span class="c1">/// Retrieves the label associated with the given data.</span>
+<span class="c1">///</span>
+<span class="c1">/// The type of 'data' is arbitrary.  The function accepts a value of any type,</span>
+<span class="c1">/// which can be truncated or extended (implicitly or explicitly) as necessary.</span>
+<span class="c1">/// The truncation/extension operations will preserve the label of the original</span>
+<span class="c1">/// value.</span>
+<span class="n">dfsan_label</span> <span class="nf">dfsan_get_label</span><span class="p">(</span><span class="kt">long</span> <span class="n">data</span><span class="p">);</span>
+
+<span class="c1">/// Retrieves a pointer to the dfsan_label_info struct for the given label.</span>
+<span class="k">const</span> <span class="k">struct</span> <span class="n">dfsan_label_info</span> <span class="o">*</span><span class="nf">dfsan_get_label_info</span><span class="p">(</span><span class="n">dfsan_label</span> <span class="n">label</span><span class="p">);</span>
+
+<span class="c1">/// Returns whether the given label label contains the label elem.</span>
+<span class="kt">int</span> <span class="nf">dfsan_has_label</span><span class="p">(</span><span class="n">dfsan_label</span> <span class="n">label</span><span class="p">,</span> <span class="n">dfsan_label</span> <span class="n">elem</span><span class="p">);</span>
+
+<span class="c1">/// If the given label label contains a label with the description desc, returns</span>
+<span class="c1">/// that label, else returns 0.</span>
+<span class="n">dfsan_label</span> <span class="nf">dfsan_has_label_with_desc</span><span class="p">(</span><span class="n">dfsan_label</span> <span class="n">label</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">desc</span><span class="p">);</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="taint-label-representation">
+<h2>Taint label representation<a class="headerlink" href="#taint-label-representation" title="Permalink to this headline">¶</a></h2>
+<p>As stated above, the tool must track a large number of taint
+labels. This poses an implementation challenge, as most multiple-label
+tainting systems assign one label per bit to shadow storage, and
+union taint labels using a bitwise or operation. This will not scale
+to clients which use hundreds or thousands of taint labels, as the
+label union operation becomes O(n) in the number of supported labels,
+and data associated with it will quickly dominate the live variable
+set, causing register spills and hampering performance.</p>
+<p>Instead, a low overhead approach is proposed which is best-case O(log<sub>2</sub> n) during execution. The underlying assumption is that
+the required space of label unions is sparse, which is a reasonable
+assumption to make given that we are optimizing for the case where
+applications mostly copy data from one place to another, without often
+invoking the need for an actual union operation. The representation
+of a taint label is a 16-bit integer, and new labels are allocated
+sequentially from a pool. The label identifier 0 is special, and means
+that the data item is unlabelled.</p>
+<p>When a label union operation is requested at a join point (any
+arithmetic or logical operation with two or more operands, such as
+addition), the code checks whether a union is required, whether the
+same union has been requested before, and whether one union label
+subsumes the other. If so, it returns the previously allocated union
+label. If not, it allocates a new union label from the same pool used
+for new labels.</p>
+<p>Specifically, the instrumentation pass will insert code like this
+to decide the union label <tt class="docutils literal"><span class="pre">lu</span></tt> for a pair of labels <tt class="docutils literal"><span class="pre">l1</span></tt>
+and <tt class="docutils literal"><span class="pre">l2</span></tt>:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">l1</span> <span class="o">==</span> <span class="n">l2</span><span class="p">)</span>
+  <span class="n">lu</span> <span class="o">=</span> <span class="n">l1</span><span class="p">;</span>
+<span class="k">else</span>
+  <span class="n">lu</span> <span class="o">=</span> <span class="n">__dfsan_union</span><span class="p">(</span><span class="n">l1</span><span class="p">,</span> <span class="n">l2</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The equality comparison is outlined, to provide an early exit in
+the common cases where the program is processing unlabelled data, or
+where the two data items have the same label.  <tt class="docutils literal"><span class="pre">__dfsan_union</span></tt> is
+a runtime library function which performs all other union computation.</p>
+<p>Further optimizations are possible, for example if <tt class="docutils literal"><span class="pre">l1</span></tt> is known
+at compile time to be zero (e.g. it is derived from a constant),
+<tt class="docutils literal"><span class="pre">l2</span></tt> can be used for <tt class="docutils literal"><span class="pre">lu</span></tt>, and vice versa.</p>
+</div>
+<div class="section" id="memory-layout-and-label-management">
+<h2>Memory layout and label management<a class="headerlink" href="#memory-layout-and-label-management" title="Permalink to this headline">¶</a></h2>
+<p>The following is the current memory layout for Linux/x86_64:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="30%" />
+<col width="30%" />
+<col width="40%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Start</th>
+<th class="head">End</th>
+<th class="head">Use</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>0x700000008000</td>
+<td>0x800000000000</td>
+<td>application memory</td>
+</tr>
+<tr class="row-odd"><td>0x200200000000</td>
+<td>0x700000008000</td>
+<td>unused</td>
+</tr>
+<tr class="row-even"><td>0x200000000000</td>
+<td>0x200200000000</td>
+<td>union table</td>
+</tr>
+<tr class="row-odd"><td>0x000000010000</td>
+<td>0x200000000000</td>
+<td>shadow memory</td>
+</tr>
+<tr class="row-even"><td>0x000000000000</td>
+<td>0x000000010000</td>
+<td>reserved by kernel</td>
+</tr>
+</tbody>
+</table>
+<p>Each byte of application memory corresponds to two bytes of shadow
+memory, which are used to store its taint label. As for LLVM SSA
+registers, we have not found it necessary to associate a label with
+each byte or bit of data, as some other tools do. Instead, labels are
+associated directly with registers.  Loads will result in a union of
+all shadow labels corresponding to bytes loaded (which most of the
+time will be short circuited by the initial comparison) and stores will
+result in a copy of the label to the shadow of all bytes stored to.</p>
+</div>
+<div class="section" id="propagating-labels-through-arguments">
+<h2>Propagating labels through arguments<a class="headerlink" href="#propagating-labels-through-arguments" title="Permalink to this headline">¶</a></h2>
+<p>In order to propagate labels through function arguments and return values,
+DataFlowSanitizer changes the ABI of each function in the translation unit.
+There are currently two supported ABIs:</p>
+<ul class="simple">
+<li>Args – Argument and return value labels are passed through additional
+arguments and by modifying the return type.</li>
+<li>TLS – Argument and return value labels are passed through TLS variables
+<tt class="docutils literal"><span class="pre">__dfsan_arg_tls</span></tt> and <tt class="docutils literal"><span class="pre">__dfsan_retval_tls</span></tt>.</li>
+</ul>
+<p>The main advantage of the TLS ABI is that it is more tolerant of ABI mismatches
+(TLS storage is not shared with any other form of storage, whereas extra
+arguments may be stored in registers which under the native ABI are not used
+for parameter passing and thus could contain arbitrary values).  On the other
+hand the args ABI is more efficient and allows ABI mismatches to be more easily
+identified by checking for nonzero labels in nominally unlabelled programs.</p>
+</div>
+<div class="section" id="implementing-the-abi-list">
+<h2>Implementing the ABI list<a class="headerlink" href="#implementing-the-abi-list" title="Permalink to this headline">¶</a></h2>
+<p>The <a class="reference external" href="DataFlowSanitizer.html#abi-list">ABI list</a> provides a list of functions
+which conform to the native ABI, each of which is callable from an instrumented
+program.  This is implemented by replacing each reference to a native ABI
+function with a reference to a function which uses the instrumented ABI.
+Such functions are automatically-generated wrappers for the native functions.
+For example, given the ABI list example provided in the user manual, the
+following wrappers will be generated under the args ABI:</p>
+<div class="highlight-llvm"><div class="highlight"><pre><span class="k">define</span> <span class="k">linkonce_odr</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="vg">@"dfsw$malloc"</span><span class="p">(</span><span class="k">i64</span> <span class="nv-Anonymous">%0</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%1</span><span class="p">)</span> <span class="p">{</span>
+<span class="nl">entry:</span>
+  <span class="nv-Anonymous">%2</span> <span class="p">=</span> <span class="k">call</span> <span class="k">i8</span><span class="p">*</span> <span class="vg">@malloc</span><span class="p">(</span><span class="k">i64</span> <span class="nv-Anonymous">%0</span><span class="p">)</span>
+  <span class="nv-Anonymous">%3</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="k">undef</span><span class="p">,</span> <span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%2</span><span class="p">,</span> <span class="m">0</span>
+  <span class="nv-Anonymous">%4</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%3</span><span class="p">,</span> <span class="k">i16</span> <span class="m">0</span><span class="p">,</span> <span class="m">1</span>
+  <span class="k">ret</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%4</span>
+<span class="p">}</span>
+
+<span class="k">define</span> <span class="k">linkonce_odr</span> <span class="p">{</span> <span class="k">i32</span><span class="p">,</span> <span class="k">i16</span> <span class="p">}</span> <span class="vg">@"dfsw$tolower"</span><span class="p">(</span><span class="k">i32</span> <span class="nv-Anonymous">%0</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%1</span><span class="p">)</span> <span class="p">{</span>
+<span class="nl">entry:</span>
+  <span class="nv-Anonymous">%2</span> <span class="p">=</span> <span class="k">call</span> <span class="k">i32</span> <span class="vg">@tolower</span><span class="p">(</span><span class="k">i32</span> <span class="nv-Anonymous">%0</span><span class="p">)</span>
+  <span class="nv-Anonymous">%3</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i32</span><span class="p">,</span> <span class="k">i16</span> <span class="p">}</span> <span class="k">undef</span><span class="p">,</span> <span class="k">i32</span> <span class="nv-Anonymous">%2</span><span class="p">,</span> <span class="m">0</span>
+  <span class="nv-Anonymous">%4</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i32</span><span class="p">,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%3</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%1</span><span class="p">,</span> <span class="m">1</span>
+  <span class="k">ret</span> <span class="p">{</span> <span class="k">i32</span><span class="p">,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%4</span>
+<span class="p">}</span>
+
+<span class="k">define</span> <span class="k">linkonce_odr</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="vg">@"dfsw$memcpy"</span><span class="p">(</span><span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%0</span><span class="p">,</span> <span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%1</span><span class="p">,</span> <span class="k">i64</span> <span class="nv-Anonymous">%2</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%3</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%4</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%5</span><span class="p">)</span> <span class="p">{</span>
+<span class="nl">entry:</span>
+  <span class="nv">%labelreturn</span> <span class="p">=</span> <span class="k">alloca</span> <span class="k">i16</span>
+  <span class="nv-Anonymous">%6</span> <span class="p">=</span> <span class="k">call</span> <span class="k">i8</span><span class="p">*</span> <span class="vg">@__dfsw_memcpy</span><span class="p">(</span><span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%0</span><span class="p">,</span> <span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%1</span><span class="p">,</span> <span class="k">i64</span> <span class="nv-Anonymous">%2</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%3</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%4</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%5</span><span class="p">,</span> <span class="k">i16</span><span class="p">*</span> <span class="nv">%labelreturn</span><span class="p">)</span>
+  <span class="nv-Anonymous">%7</span> <span class="p">=</span> <span class="k">load</span> <span class="k">i16</span><span class="p">*</span> <span class="nv">%labelreturn</span>
+  <span class="nv-Anonymous">%8</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="k">undef</span><span class="p">,</span> <span class="k">i8</span><span class="p">*</span> <span class="nv-Anonymous">%6</span><span class="p">,</span> <span class="m">0</span>
+  <span class="nv-Anonymous">%9</span> <span class="p">=</span> <span class="k">insertvalue</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%8</span><span class="p">,</span> <span class="k">i16</span> <span class="nv-Anonymous">%7</span><span class="p">,</span> <span class="m">1</span>
+  <span class="k">ret</span> <span class="p">{</span> <span class="k">i8</span><span class="p">*,</span> <span class="k">i16</span> <span class="p">}</span> <span class="nv-Anonymous">%9</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>As an optimization, direct calls to native ABI functions will call the
+native ABI function directly and the pass will compute the appropriate label
+internally.  This has the advantage of reducing the number of union operations
+required when the return value label is known to be zero (i.e. <tt class="docutils literal"><span class="pre">discard</span></tt>
+functions, or <tt class="docutils literal"><span class="pre">functional</span></tt> functions with known unlabelled arguments).</p>
+</div>
+<div class="section" id="checking-abi-consistency">
+<h2>Checking ABI Consistency<a class="headerlink" href="#checking-abi-consistency" title="Permalink to this headline">¶</a></h2>
+<p>DFSan changes the ABI of each function in the module.  This makes it possible
+for a function with the native ABI to be called with the instrumented ABI,
+or vice versa, thus possibly invoking undefined behavior.  A simple way
+of statically detecting instances of this problem is to prepend the prefix
+“dfs$” to the name of each instrumented-ABI function.</p>
+<p>This will not catch every such problem; in particular function pointers passed
+across the instrumented-native barrier cannot be used on the other side.
+These problems could potentially be caught dynamically.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="DataFlowSanitizer.html">DataFlowSanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LeakSanitizer.html">LeakSanitizer</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DriverInternals.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DriverInternals.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DriverInternals.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/DriverInternals.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,456 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Driver Design & Internals — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Pretokenized Headers (PTH)" href="PTHInternals.html" />
+    <link rel="prev" title="“Clang” CFE Internals Manual" href="InternalsManual.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Driver Design & Internals</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="InternalsManual.html">“Clang” CFE Internals Manual</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="PTHInternals.html">Pretokenized Headers (PTH)</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="driver-design-internals">
+<h1>Driver Design & Internals<a class="headerlink" href="#driver-design-internals" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id2">Introduction</a></li>
+<li><a class="reference internal" href="#features-and-goals" id="id3">Features and Goals</a><ul>
+<li><a class="reference internal" href="#gcc-compatibility" id="id4">GCC Compatibility</a></li>
+<li><a class="reference internal" href="#flexible" id="id5">Flexible</a></li>
+<li><a class="reference internal" href="#low-overhead" id="id6">Low Overhead</a></li>
+<li><a class="reference internal" href="#simple" id="id7">Simple</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#internal-design-and-implementation" id="id8">Internal Design and Implementation</a><ul>
+<li><a class="reference internal" href="#internals-introduction" id="id9">Internals Introduction</a></li>
+<li><a class="reference internal" href="#design-overview" id="id10">Design Overview</a></li>
+<li><a class="reference internal" href="#driver-stages" id="id11">Driver Stages</a></li>
+<li><a class="reference internal" href="#additional-notes" id="id12">Additional Notes</a><ul>
+<li><a class="reference internal" href="#the-compilation-object" id="id13">The Compilation Object</a></li>
+<li><a class="reference internal" href="#unified-parsing-pipelining" id="id14">Unified Parsing & Pipelining</a></li>
+<li><a class="reference internal" href="#toolchain-argument-translation" id="id15">ToolChain Argument Translation</a></li>
+<li><a class="reference internal" href="#unused-argument-warnings" id="id16">Unused Argument Warnings</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#relation-to-gcc-driver-concepts" id="id17">Relation to GCC Driver Concepts</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id2">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document describes the Clang driver. The purpose of this document
+is to describe both the motivation and design goals for the driver, as
+well as details of the internal implementation.</p>
+</div>
+<div class="section" id="features-and-goals">
+<h2><a class="toc-backref" href="#id3">Features and Goals</a><a class="headerlink" href="#features-and-goals" title="Permalink to this headline">¶</a></h2>
+<p>The Clang driver is intended to be a production quality compiler driver
+providing access to the Clang compiler and tools, with a command line
+interface which is compatible with the gcc driver.</p>
+<p>Although the driver is part of and driven by the Clang project, it is
+logically a separate tool which shares many of the same goals as Clang:</p>
+<div class="contents local topic" id="features">
+<p class="topic-title first">Features</p>
+<ul class="simple">
+<li><a class="reference internal" href="#gcc-compatibility" id="id18">GCC Compatibility</a></li>
+<li><a class="reference internal" href="#flexible" id="id19">Flexible</a></li>
+<li><a class="reference internal" href="#low-overhead" id="id20">Low Overhead</a></li>
+<li><a class="reference internal" href="#simple" id="id21">Simple</a></li>
+</ul>
+</div>
+<div class="section" id="gcc-compatibility">
+<h3><a class="toc-backref" href="#id18">GCC Compatibility</a><a class="headerlink" href="#gcc-compatibility" title="Permalink to this headline">¶</a></h3>
+<p>The number one goal of the driver is to ease the adoption of Clang by
+allowing users to drop Clang into a build system which was designed to
+call GCC. Although this makes the driver much more complicated than
+might otherwise be necessary, we decided that being very compatible with
+the gcc command line interface was worth it in order to allow users to
+quickly test clang on their projects.</p>
+</div>
+<div class="section" id="flexible">
+<h3><a class="toc-backref" href="#id19">Flexible</a><a class="headerlink" href="#flexible" title="Permalink to this headline">¶</a></h3>
+<p>The driver was designed to be flexible and easily accommodate new uses
+as we grow the clang and LLVM infrastructure. As one example, the driver
+can easily support the introduction of tools which have an integrated
+assembler; something we hope to add to LLVM in the future.</p>
+<p>Similarly, most of the driver functionality is kept in a library which
+can be used to build other tools which want to implement or accept a gcc
+like interface.</p>
+</div>
+<div class="section" id="low-overhead">
+<h3><a class="toc-backref" href="#id20">Low Overhead</a><a class="headerlink" href="#low-overhead" title="Permalink to this headline">¶</a></h3>
+<p>The driver should have as little overhead as possible. In practice, we
+found that the gcc driver by itself incurred a small but meaningful
+overhead when compiling many small files. The driver doesn’t do much
+work compared to a compilation, but we have tried to keep it as
+efficient as possible by following a few simple principles:</p>
+<ul class="simple">
+<li>Avoid memory allocation and string copying when possible.</li>
+<li>Don’t parse arguments more than once.</li>
+<li>Provide a few simple interfaces for efficiently searching arguments.</li>
+</ul>
+</div>
+<div class="section" id="simple">
+<h3><a class="toc-backref" href="#id21">Simple</a><a class="headerlink" href="#simple" title="Permalink to this headline">¶</a></h3>
+<p>Finally, the driver was designed to be “as simple as possible”, given
+the other goals. Notably, trying to be completely compatible with the
+gcc driver adds a significant amount of complexity. However, the design
+of the driver attempts to mitigate this complexity by dividing the
+process into a number of independent stages instead of a single
+monolithic task.</p>
+</div>
+</div>
+<div class="section" id="internal-design-and-implementation">
+<h2><a class="toc-backref" href="#id8">Internal Design and Implementation</a><a class="headerlink" href="#internal-design-and-implementation" title="Permalink to this headline">¶</a></h2>
+<div class="contents local topic" id="id1">
+<ul class="simple">
+<li><a class="reference internal" href="#internals-introduction" id="id22">Internals Introduction</a></li>
+<li><a class="reference internal" href="#design-overview" id="id23">Design Overview</a></li>
+<li><a class="reference internal" href="#driver-stages" id="id24">Driver Stages</a></li>
+<li><a class="reference internal" href="#additional-notes" id="id25">Additional Notes</a></li>
+<li><a class="reference internal" href="#relation-to-gcc-driver-concepts" id="id26">Relation to GCC Driver Concepts</a></li>
+</ul>
+</div>
+<div class="section" id="internals-introduction">
+<h3><a class="toc-backref" href="#id22">Internals Introduction</a><a class="headerlink" href="#internals-introduction" title="Permalink to this headline">¶</a></h3>
+<p>In order to satisfy the stated goals, the driver was designed to
+completely subsume the functionality of the gcc executable; that is, the
+driver should not need to delegate to gcc to perform subtasks. On
+Darwin, this implies that the Clang driver also subsumes the gcc
+driver-driver, which is used to implement support for building universal
+images (binaries and object files). This also implies that the driver
+should be able to call the language specific compilers (e.g. cc1)
+directly, which means that it must have enough information to forward
+command line arguments to child processes correctly.</p>
+</div>
+<div class="section" id="design-overview">
+<h3><a class="toc-backref" href="#id23">Design Overview</a><a class="headerlink" href="#design-overview" title="Permalink to this headline">¶</a></h3>
+<p>The diagram below shows the significant components of the driver
+architecture and how they relate to one another. The orange components
+represent concrete data structures built by the driver, the green
+components indicate conceptually distinct stages which manipulate these
+data structures, and the blue components are important helper classes.</p>
+<img alt="Driver Architecture Diagram" class="align-center" src="_images/DriverArchitecture.png" />
+</div>
+<div class="section" id="driver-stages">
+<h3><a class="toc-backref" href="#id24">Driver Stages</a><a class="headerlink" href="#driver-stages" title="Permalink to this headline">¶</a></h3>
+<p>The driver functionality is conceptually divided into five stages:</p>
+<ol class="arabic">
+<li><p class="first"><strong>Parse: Option Parsing</strong></p>
+<p>The command line argument strings are decomposed into arguments
+(<tt class="docutils literal"><span class="pre">Arg</span></tt> instances). The driver expects to understand all available
+options, although there is some facility for just passing certain
+classes of options through (like <tt class="docutils literal"><span class="pre">-Wl,</span></tt>).</p>
+<p>Each argument corresponds to exactly one abstract <tt class="docutils literal"><span class="pre">Option</span></tt>
+definition, which describes how the option is parsed along with some
+additional metadata. The Arg instances themselves are lightweight and
+merely contain enough information for clients to determine which
+option they correspond to and their values (if they have additional
+parameters).</p>
+<p>For example, a command line like “-Ifoo -I foo” would parse to two
+Arg instances (a JoinedArg and a SeparateArg instance), but each
+would refer to the same Option.</p>
+<p>Options are lazily created in order to avoid populating all Option
+classes when the driver is loaded. Most of the driver code only needs
+to deal with options by their unique ID (e.g., <tt class="docutils literal"><span class="pre">options::OPT_I</span></tt>),</p>
+<p>Arg instances themselves do not generally store the values of
+parameters. In many cases, this would simply result in creating
+unnecessary string copies. Instead, Arg instances are always embedded
+inside an ArgList structure, which contains the original vector of
+argument strings. Each Arg itself only needs to contain an index into
+this vector instead of storing its values directly.</p>
+<p>The clang driver can dump the results of this stage using the
+<tt class="docutils literal"><span class="pre">-ccc-print-options</span></tt> flag (which must precede any actual command
+line arguments). For example:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -ccc-print-options -Xarch_i386 -fomit-frame-pointer -Wa,-fast -Ifoo -I foo t.c
+<span class="go">Option 0 - Name: "-Xarch_", Values: {"i386", "-fomit-frame-pointer"}</span>
+<span class="go">Option 1 - Name: "-Wa,", Values: {"-fast"}</span>
+<span class="go">Option 2 - Name: "-I", Values: {"foo"}</span>
+<span class="go">Option 3 - Name: "-I", Values: {"foo"}</span>
+<span class="go">Option 4 - Name: "<input>", Values: {"t.c"}</span>
+</pre></div>
+</div>
+<p>After this stage is complete the command line should be broken down
+into well defined option objects with their appropriate parameters.
+Subsequent stages should rarely, if ever, need to do any string
+processing.</p>
+</li>
+<li><p class="first"><strong>Pipeline: Compilation Job Construction</strong></p>
+<p>Once the arguments are parsed, the tree of subprocess jobs needed for
+the desired compilation sequence are constructed. This involves
+determining the input files and their types, what work is to be done
+on them (preprocess, compile, assemble, link, etc.), and constructing
+a list of Action instances for each task. The result is a list of one
+or more top-level actions, each of which generally corresponds to a
+single output (for example, an object or linked executable).</p>
+<p>The majority of Actions correspond to actual tasks, however there are
+two special Actions. The first is InputAction, which simply serves to
+adapt an input argument for use as an input to other Actions. The
+second is BindArchAction, which conceptually alters the architecture
+to be used for all of its input Actions.</p>
+<p>The clang driver can dump the results of this stage using the
+<tt class="docutils literal"><span class="pre">-ccc-print-phases</span></tt> flag. For example:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -ccc-print-phases -x c t.c -x assembler t.s
+<span class="go">0: input, "t.c", c</span>
+<span class="go">1: preprocessor, {0}, cpp-output</span>
+<span class="go">2: compiler, {1}, assembler</span>
+<span class="go">3: assembler, {2}, object</span>
+<span class="go">4: input, "t.s", assembler</span>
+<span class="go">5: assembler, {4}, object</span>
+<span class="go">6: linker, {3, 5}, image</span>
+</pre></div>
+</div>
+<p>Here the driver is constructing seven distinct actions, four to
+compile the “t.c” input into an object file, two to assemble the
+“t.s” input, and one to link them together.</p>
+<p>A rather different compilation pipeline is shown here; in this
+example there are two top level actions to compile the input files
+into two separate object files, where each object file is built using
+<tt class="docutils literal"><span class="pre">lipo</span></tt> to merge results built for two separate architectures.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -ccc-print-phases -c -arch i386 -arch x86_64 t0.c t1.c
+<span class="go">0: input, "t0.c", c</span>
+<span class="go">1: preprocessor, {0}, cpp-output</span>
+<span class="go">2: compiler, {1}, assembler</span>
+<span class="go">3: assembler, {2}, object</span>
+<span class="go">4: bind-arch, "i386", {3}, object</span>
+<span class="go">5: bind-arch, "x86_64", {3}, object</span>
+<span class="go">6: lipo, {4, 5}, object</span>
+<span class="go">7: input, "t1.c", c</span>
+<span class="go">8: preprocessor, {7}, cpp-output</span>
+<span class="go">9: compiler, {8}, assembler</span>
+<span class="go">10: assembler, {9}, object</span>
+<span class="go">11: bind-arch, "i386", {10}, object</span>
+<span class="go">12: bind-arch, "x86_64", {10}, object</span>
+<span class="go">13: lipo, {11, 12}, object</span>
+</pre></div>
+</div>
+<p>After this stage is complete the compilation process is divided into
+a simple set of actions which need to be performed to produce
+intermediate or final outputs (in some cases, like <tt class="docutils literal"><span class="pre">-fsyntax-only</span></tt>,
+there is no “real” final output). Phases are well known compilation
+steps, such as “preprocess”, “compile”, “assemble”, “link”, etc.</p>
+</li>
+<li><p class="first"><strong>Bind: Tool & Filename Selection</strong></p>
+<p>This stage (in conjunction with the Translate stage) turns the tree
+of Actions into a list of actual subprocess to run. Conceptually, the
+driver performs a top down matching to assign Action(s) to Tools. The
+ToolChain is responsible for selecting the tool to perform a
+particular action; once selected the driver interacts with the tool
+to see if it can match additional actions (for example, by having an
+integrated preprocessor).</p>
+<p>Once Tools have been selected for all actions, the driver determines
+how the tools should be connected (for example, using an inprocess
+module, pipes, temporary files, or user provided filenames). If an
+output file is required, the driver also computes the appropriate
+file name (the suffix and file location depend on the input types and
+options such as <tt class="docutils literal"><span class="pre">-save-temps</span></tt>).</p>
+<p>The driver interacts with a ToolChain to perform the Tool bindings.
+Each ToolChain contains information about all the tools needed for
+compilation for a particular architecture, platform, and operating
+system. A single driver invocation may query multiple ToolChains
+during one compilation in order to interact with tools for separate
+architectures.</p>
+<p>The results of this stage are not computed directly, but the driver
+can print the results via the <tt class="docutils literal"><span class="pre">-ccc-print-bindings</span></tt> option. For
+example:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -ccc-print-bindings -arch i386 -arch ppc t0.c
+<span class="gp">#</span> <span class="s2">"i386-apple-darwin9"</span> - <span class="s2">"clang"</span>, inputs: <span class="o">[</span><span class="s2">"t0.c"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-Sn4RKF.s"</span>
+<span class="gp">#</span> <span class="s2">"i386-apple-darwin9"</span> - <span class="s2">"darwin::Assemble"</span>, inputs: <span class="o">[</span><span class="s2">"/tmp/cc-Sn4RKF.s"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-gvSnbS.o"</span>
+<span class="gp">#</span> <span class="s2">"i386-apple-darwin9"</span> - <span class="s2">"darwin::Link"</span>, inputs: <span class="o">[</span><span class="s2">"/tmp/cc-gvSnbS.o"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-jgHQxi.out"</span>
+<span class="gp">#</span> <span class="s2">"ppc-apple-darwin9"</span> - <span class="s2">"gcc::Compile"</span>, inputs: <span class="o">[</span><span class="s2">"t0.c"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-Q0bTox.s"</span>
+<span class="gp">#</span> <span class="s2">"ppc-apple-darwin9"</span> - <span class="s2">"gcc::Assemble"</span>, inputs: <span class="o">[</span><span class="s2">"/tmp/cc-Q0bTox.s"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-WCdicw.o"</span>
+<span class="gp">#</span> <span class="s2">"ppc-apple-darwin9"</span> - <span class="s2">"gcc::Link"</span>, inputs: <span class="o">[</span><span class="s2">"/tmp/cc-WCdicw.o"</span><span class="o">]</span>, output: <span class="s2">"/tmp/cc-HHBEBh.out"</span>
+<span class="gp">#</span> <span class="s2">"i386-apple-darwin9"</span> - <span class="s2">"darwin::Lipo"</span>, inputs: <span class="o">[</span><span class="s2">"/tmp/cc-jgHQxi.out"</span>, <span class="s2">"/tmp/cc-HHBEBh.out"</span><span class="o">]</span>, output: <span class="s2">"a.out"</span>
+</pre></div>
+</div>
+<p>This shows the tool chain, tool, inputs and outputs which have been
+bound for this compilation sequence. Here clang is being used to
+compile t0.c on the i386 architecture and darwin specific versions of
+the tools are being used to assemble and link the result, but generic
+gcc versions of the tools are being used on PowerPC.</p>
+</li>
+<li><p class="first"><strong>Translate: Tool Specific Argument Translation</strong></p>
+<p>Once a Tool has been selected to perform a particular Action, the
+Tool must construct concrete Jobs which will be executed during
+compilation. The main work is in translating from the gcc style
+command line options to whatever options the subprocess expects.</p>
+<p>Some tools, such as the assembler, only interact with a handful of
+arguments and just determine the path of the executable to call and
+pass on their input and output arguments. Others, like the compiler
+or the linker, may translate a large number of arguments in addition.</p>
+<p>The ArgList class provides a number of simple helper methods to
+assist with translating arguments; for example, to pass on only the
+last of arguments corresponding to some option, or all arguments for
+an option.</p>
+<p>The result of this stage is a list of Jobs (executable paths and
+argument strings) to execute.</p>
+</li>
+<li><p class="first"><strong>Execute</strong></p>
+<p>Finally, the compilation pipeline is executed. This is mostly
+straightforward, although there is some interaction with options like
+<tt class="docutils literal"><span class="pre">-pipe</span></tt>, <tt class="docutils literal"><span class="pre">-pass-exit-codes</span></tt> and <tt class="docutils literal"><span class="pre">-time</span></tt>.</p>
+</li>
+</ol>
+</div>
+<div class="section" id="additional-notes">
+<h3><a class="toc-backref" href="#id25">Additional Notes</a><a class="headerlink" href="#additional-notes" title="Permalink to this headline">¶</a></h3>
+<div class="section" id="the-compilation-object">
+<h4><a class="toc-backref" href="#id13">The Compilation Object</a><a class="headerlink" href="#the-compilation-object" title="Permalink to this headline">¶</a></h4>
+<p>The driver constructs a Compilation object for each set of command line
+arguments. The Driver itself is intended to be invariant during
+construction of a Compilation; an IDE should be able to construct a
+single long lived driver instance to use for an entire build, for
+example.</p>
+<p>The Compilation object holds information that is particular to each
+compilation sequence. For example, the list of used temporary files
+(which must be removed once compilation is finished) and result files
+(which should be removed if compilation fails).</p>
+</div>
+<div class="section" id="unified-parsing-pipelining">
+<h4><a class="toc-backref" href="#id14">Unified Parsing & Pipelining</a><a class="headerlink" href="#unified-parsing-pipelining" title="Permalink to this headline">¶</a></h4>
+<p>Parsing and pipelining both occur without reference to a Compilation
+instance. This is by design; the driver expects that both of these
+phases are platform neutral, with a few very well defined exceptions
+such as whether the platform uses a driver driver.</p>
+</div>
+<div class="section" id="toolchain-argument-translation">
+<h4><a class="toc-backref" href="#id15">ToolChain Argument Translation</a><a class="headerlink" href="#toolchain-argument-translation" title="Permalink to this headline">¶</a></h4>
+<p>In order to match gcc very closely, the clang driver currently allows
+tool chains to perform their own translation of the argument list (into
+a new ArgList data structure). Although this allows the clang driver to
+match gcc easily, it also makes the driver operation much harder to
+understand (since the Tools stop seeing some arguments the user
+provided, and see new ones instead).</p>
+<p>For example, on Darwin <tt class="docutils literal"><span class="pre">-gfull</span></tt> gets translated into two separate
+arguments, <tt class="docutils literal"><span class="pre">-g</span></tt> and <tt class="docutils literal"><span class="pre">-fno-eliminate-unused-debug-symbols</span></tt>. Trying to
+write Tool logic to do something with <tt class="docutils literal"><span class="pre">-gfull</span></tt> will not work, because
+Tool argument translation is done after the arguments have been
+translated.</p>
+<p>A long term goal is to remove this tool chain specific translation, and
+instead force each tool to change its own logic to do the right thing on
+the untranslated original arguments.</p>
+</div>
+<div class="section" id="unused-argument-warnings">
+<h4><a class="toc-backref" href="#id16">Unused Argument Warnings</a><a class="headerlink" href="#unused-argument-warnings" title="Permalink to this headline">¶</a></h4>
+<p>The driver operates by parsing all arguments but giving Tools the
+opportunity to choose which arguments to pass on. One downside of this
+infrastructure is that if the user misspells some option, or is confused
+about which options to use, some command line arguments the user really
+cared about may go unused. This problem is particularly important when
+using clang as a compiler, since the clang compiler does not support
+anywhere near all the options that gcc does, and we want to make sure
+users know which ones are being used.</p>
+<p>To support this, the driver maintains a bit associated with each
+argument of whether it has been used (at all) during the compilation.
+This bit usually doesn’t need to be set by hand, as the key ArgList
+accessors will set it automatically.</p>
+<p>When a compilation is successful (there are no errors), the driver
+checks the bit and emits an “unused argument” warning for any arguments
+which were never accessed. This is conservative (the argument may not
+have been used to do what the user wanted) but still catches the most
+obvious cases.</p>
+</div>
+</div>
+<div class="section" id="relation-to-gcc-driver-concepts">
+<h3><a class="toc-backref" href="#id26">Relation to GCC Driver Concepts</a><a class="headerlink" href="#relation-to-gcc-driver-concepts" title="Permalink to this headline">¶</a></h3>
+<p>For those familiar with the gcc driver, this section provides a brief
+overview of how things from the gcc driver map to the clang driver.</p>
+<ul>
+<li><p class="first"><strong>Driver Driver</strong></p>
+<p>The driver driver is fully integrated into the clang driver. The
+driver simply constructs additional Actions to bind the architecture
+during the <em>Pipeline</em> phase. The tool chain specific argument
+translation is responsible for handling <tt class="docutils literal"><span class="pre">-Xarch_</span></tt>.</p>
+<p>The one caveat is that this approach requires <tt class="docutils literal"><span class="pre">-Xarch_</span></tt> not be used
+to alter the compilation itself (for example, one cannot provide
+<tt class="docutils literal"><span class="pre">-S</span></tt> as an <tt class="docutils literal"><span class="pre">-Xarch_</span></tt> argument). The driver attempts to reject
+such invocations, and overall there isn’t a good reason to abuse
+<tt class="docutils literal"><span class="pre">-Xarch_</span></tt> to that end in practice.</p>
+<p>The upside is that the clang driver is more efficient and does little
+extra work to support universal builds. It also provides better error
+reporting and UI consistency.</p>
+</li>
+<li><p class="first"><strong>Specs</strong></p>
+<p>The clang driver has no direct correspondent for “specs”. The
+majority of the functionality that is embedded in specs is in the
+Tool specific argument translation routines. The parts of specs which
+control the compilation pipeline are generally part of the <em>Pipeline</em>
+stage.</p>
+</li>
+<li><p class="first"><strong>Toolchains</strong></p>
+<p>The gcc driver has no direct understanding of tool chains. Each gcc
+binary roughly corresponds to the information which is embedded
+inside a single ToolChain.</p>
+<p>The clang driver is intended to be portable and support complex
+compilation environments. All platform and tool chain specific code
+should be protected behind either abstract or well defined interfaces
+(such as whether the platform supports use as a driver driver).</p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="InternalsManual.html">“Clang” CFE Internals Manual</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="PTHInternals.html">Pretokenized Headers (PTH)</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ExternalClangExamples.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ExternalClangExamples.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ExternalClangExamples.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/ExternalClangExamples.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,145 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>External Clang Examples — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Introduction to the Clang AST" href="IntroductionToTheClangAST.html" />
+    <link rel="prev" title="Choosing the Right Interface for Your Application" href="Tooling.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>External Clang Examples</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="Tooling.html">Choosing the Right Interface for Your Application</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="IntroductionToTheClangAST.html">Introduction to the Clang AST</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="external-clang-examples">
+<h1>External Clang Examples<a class="headerlink" href="#external-clang-examples" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This page provides some examples of the kinds of things that people have
+done with Clang that might serve as useful guides (or starting points) from
+which to develop your own tools. They may be helpful even for something as
+banal (but necessary) as how to set up your build to integrate Clang.</p>
+<p>Clang’s library-based design is deliberately aimed at facilitating use by
+external projects, and we are always interested in improving Clang to
+better serve our external users. Some typical categories of applications
+where Clang is used are:</p>
+<ul class="simple">
+<li>Static analysis.</li>
+<li>Documentation/cross-reference generation.</li>
+</ul>
+<p>If you know of (or wrote!) a tool or project using Clang, please send an
+email to Clang’s <a class="reference external" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">development discussion mailing list</a> to have it added.
+(or if you are already a Clang contributor, feel free to directly commit
+additions). Since the primary purpose of this page is to provide examples
+that can help developers, generally they must have code available.</p>
+</div>
+<div class="section" id="list-of-projects-and-tools">
+<h2>List of projects and tools<a class="headerlink" href="#list-of-projects-and-tools" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><a class="reference external" href="https://github.com/Andersbakken/rtags/">https://github.com/Andersbakken/rtags/</a></dt>
+<dd>“RTags is a client/server application that indexes c/c++ code and keeps
+a persistent in-memory database of references, symbolnames, completions
+etc.”</dd>
+<dt><a class="reference external" href="http://rprichard.github.com/sourceweb/">http://rprichard.github.com/sourceweb/</a></dt>
+<dd>“A C/C++ source code indexer and navigator”</dd>
+<dt><a class="reference external" href="https://github.com/etaoins/qconnectlint">https://github.com/etaoins/qconnectlint</a></dt>
+<dd>“qconnectlint is a Clang tool for statically verifying the consistency
+of signal and slot connections made with Qt’s <tt class="docutils literal"><span class="pre">QObject::connect</span></tt>.”</dd>
+<dt><a class="reference external" href="https://github.com/woboq/woboq_codebrowser">https://github.com/woboq/woboq_codebrowser</a></dt>
+<dd>“The Woboq Code Browser is a web-based code browser for C/C++ projects.
+Check out <a class="reference external" href="http://code.woboq.org/">http://code.woboq.org/</a> for an example!”</dd>
+<dt><a class="reference external" href="https://github.com/mozilla/dxr">https://github.com/mozilla/dxr</a></dt>
+<dd>“DXR is a source code cross-reference tool that uses static analysis
+data collected by instrumented compilers.”</dd>
+<dt><a class="reference external" href="https://github.com/eschulte/clang-mutate">https://github.com/eschulte/clang-mutate</a></dt>
+<dd>“This tool performs a number of operations on C-language source files.”</dd>
+<dt><a class="reference external" href="https://github.com/gmarpons/Crisp">https://github.com/gmarpons/Crisp</a></dt>
+<dd>“A coding rule validation add-on for LLVM/clang. Crisp rules are written
+in Prolog. A high-level declarative DSL to easily write new rules is under
+development. It will be called CRISP, an acronym for <em>Coding Rules in
+Sugared Prolog</em>.”</dd>
+<dt><a class="reference external" href="https://github.com/drothlis/clang-ctags">https://github.com/drothlis/clang-ctags</a></dt>
+<dd>“Generate tag file for C++ source code.”</dd>
+<dt><a class="reference external" href="https://github.com/exclipy/clang_indexer">https://github.com/exclipy/clang_indexer</a></dt>
+<dd>“This is an indexer for C and C++ based on the libclang library.”</dd>
+<dt><a class="reference external" href="https://github.com/holtgrewe/linty">https://github.com/holtgrewe/linty</a></dt>
+<dd>“Linty - C/C++ Style Checking with Python & libclang.”</dd>
+<dt><a class="reference external" href="https://github.com/axw/cmonster">https://github.com/axw/cmonster</a></dt>
+<dd>“cmonster is a Python wrapper for the Clang C++ parser.”</dd>
+<dt><a class="reference external" href="https://github.com/rizsotto/Constantine">https://github.com/rizsotto/Constantine</a></dt>
+<dd>“Constantine is a toy project to learn how to write clang plugin.
+Implements pseudo const analysis. Generates warnings about variables,
+which were declared without const qualifier.”</dd>
+<dt><a class="reference external" href="https://github.com/jessevdk/cldoc">https://github.com/jessevdk/cldoc</a></dt>
+<dd>“cldoc is a Clang based documentation generator for C and C++.
+cldoc tries to solve the issue of writing C/C++ software documentation
+with a modern, non-intrusive and robust approach.”</dd>
+<dt><a class="reference external" href="https://github.com/AlexDenisov/ToyClangPlugin">https://github.com/AlexDenisov/ToyClangPlugin</a></dt>
+<dd>“The simplest Clang plugin implementing a semantic check for Objective-C.
+This example shows how to use the <tt class="docutils literal"><span class="pre">DiagnosticsEngine</span></tt> (emit warnings,
+errors, fixit hints).  See also <a class="reference external" href="http://l.rw.rw/clang_plugin">http://l.rw.rw/clang_plugin</a> for
+step-by-step instructions.”</dd>
+</dl>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="Tooling.html">Choosing the Right Interface for Your Application</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="IntroductionToTheClangAST.html">Introduction to the Clang AST</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/FAQ.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/FAQ.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/FAQ.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/FAQ.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,131 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Frequently Asked Questions (FAQ) — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Choosing the Right Interface for Your Application" href="Tooling.html" />
+    <link rel="prev" title="MSVC compatibility" href="MSVCCompatibility.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Frequently Asked Questions (FAQ)</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="MSVCCompatibility.html">MSVC compatibility</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="Tooling.html">Choosing the Right Interface for Your Application</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="frequently-asked-questions-faq">
+<h1>Frequently Asked Questions (FAQ)<a class="headerlink" href="#frequently-asked-questions-faq" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#driver" id="id1">Driver</a><ul>
+<li><a class="reference internal" href="#i-run-clang-cc1-and-get-weird-errors-about-missing-headers" id="id2">I run <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">...</span></tt> and get weird errors about missing headers</a></li>
+<li><a class="reference internal" href="#i-get-errors-about-some-headers-being-missing-stddef-h-stdarg-h" id="id3">I get errors about some headers being missing (<tt class="docutils literal"><span class="pre">stddef.h</span></tt>, <tt class="docutils literal"><span class="pre">stdarg.h</span></tt>)</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="driver">
+<h2><a class="toc-backref" href="#id1">Driver</a><a class="headerlink" href="#driver" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="i-run-clang-cc1-and-get-weird-errors-about-missing-headers">
+<h3><a class="toc-backref" href="#id2">I run <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">...</span></tt> and get weird errors about missing headers</a><a class="headerlink" href="#i-run-clang-cc1-and-get-weird-errors-about-missing-headers" title="Permalink to this headline">¶</a></h3>
+<p>Given this source file:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include <stdio.h></span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">printf</span><span class="p">(</span><span class="s">"Hello world</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If you run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -cc1 hello.c
+<span class="go">hello.c:1:10: fatal error: 'stdio.h' file not found</span>
+<span class="gp">#</span>include <stdio.h>
+<span class="go">         ^</span>
+<span class="go">1 error generated.</span>
+</pre></div>
+</div>
+<p><tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span></tt> is the frontend, <tt class="docutils literal"><span class="pre">clang</span></tt> is the <a class="reference internal" href="DriverInternals.html"><em>driver</em></a>.  The driver invokes the frontend with options appropriate
+for your system.  To see these options, run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang -### -c hello.c
+</pre></div>
+</div>
+<p>Some clang command line options are driver-only options, some are frontend-only
+options.  Frontend-only options are intended to be used only by clang developers.
+Users should not run <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span></tt> directly, because <tt class="docutils literal"><span class="pre">-cc1</span></tt> options are not
+guaranteed to be stable.</p>
+<p>If you want to use a frontend-only option (“a <tt class="docutils literal"><span class="pre">-cc1</span></tt> option”), for example
+<tt class="docutils literal"><span class="pre">-ast-dump</span></tt>, then you need to take the <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span></tt> line generated by the
+driver and add the option you need.  Alternatively, you can run
+<tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-Xclang</span> <span class="pre"><option></span> <span class="pre">...</span></tt> to force the driver pass <tt class="docutils literal"><span class="pre"><option></span></tt> to
+<tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span></tt>.</p>
+</div>
+<div class="section" id="i-get-errors-about-some-headers-being-missing-stddef-h-stdarg-h">
+<h3><a class="toc-backref" href="#id3">I get errors about some headers being missing (<tt class="docutils literal"><span class="pre">stddef.h</span></tt>, <tt class="docutils literal"><span class="pre">stdarg.h</span></tt>)</a><a class="headerlink" href="#i-get-errors-about-some-headers-being-missing-stddef-h-stdarg-h" title="Permalink to this headline">¶</a></h3>
+<p>Some header files (<tt class="docutils literal"><span class="pre">stddef.h</span></tt>, <tt class="docutils literal"><span class="pre">stdarg.h</span></tt>, and others) are shipped with
+Clang — these are called builtin includes.  Clang searches for them in a
+directory relative to the location of the <tt class="docutils literal"><span class="pre">clang</span></tt> binary.  If you moved the
+<tt class="docutils literal"><span class="pre">clang</span></tt> binary, you need to move the builtin headers, too.</p>
+<p>More information can be found in the <a class="reference internal" href="LibTooling.html#libtooling-builtin-includes"><em>Builtin includes</em></a>
+section.</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="MSVCCompatibility.html">MSVC compatibility</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="Tooling.html">Choosing the Right Interface for Your Application</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/HowToSetupToolingForLLVM.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/HowToSetupToolingForLLVM.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/HowToSetupToolingForLLVM.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/HowToSetupToolingForLLVM.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,240 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>How To Setup Clang Tooling For LLVM — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="JSON Compilation Database Format Specification" href="JSONCompilationDatabase.html" />
+    <link rel="prev" title="Matching the Clang AST" href="LibASTMatchers.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>How To Setup Clang Tooling For LLVM</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="LibASTMatchers.html">Matching the Clang AST</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="JSONCompilationDatabase.html">JSON Compilation Database Format Specification</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="how-to-setup-clang-tooling-for-llvm">
+<h1>How To Setup Clang Tooling For LLVM<a class="headerlink" href="#how-to-setup-clang-tooling-for-llvm" title="Permalink to this headline">¶</a></h1>
+<p>Clang Tooling provides infrastructure to write tools that need syntactic
+and semantic information about a program. This term also relates to a set
+of specific tools using this infrastructure (e.g. <tt class="docutils literal"><span class="pre">clang-check</span></tt>). This
+document provides information on how to set up and use Clang Tooling for
+the LLVM source code.</p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Clang Tooling needs a compilation database to figure out specific build
+options for each file. Currently it can create a compilation database
+from the <tt class="docutils literal"><span class="pre">compilation_commands.json</span></tt> file, generated by CMake. When
+invoking clang tools, you can either specify a path to a build directory
+using a command line parameter <tt class="docutils literal"><span class="pre">-p</span></tt> or let Clang Tooling find this
+file in your source tree. In either case you need to configure your
+build using CMake to use clang tools.</p>
+</div>
+<div class="section" id="setup-clang-tooling-using-cmake-and-make">
+<h2>Setup Clang Tooling Using CMake and Make<a class="headerlink" href="#setup-clang-tooling-using-cmake-and-make" title="Permalink to this headline">¶</a></h2>
+<p>If you intend to use make to build LLVM, you should have CMake 2.8.6 or
+later installed (can be found <a class="reference external" href="http://cmake.org">here</a>).</p>
+<p>First, you need to generate Makefiles for LLVM with CMake. You need to
+make a build directory and run CMake from it:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> mkdir your/build/directory
+<span class="gp">$</span> <span class="nb">cd </span>your/build/directory
+<span class="gp">$</span> cmake -DCMAKE_EXPORT_COMPILE_COMMANDS<span class="o">=</span>ON path/to/llvm/sources
+</pre></div>
+</div>
+<p>If you want to use clang instead of GCC, you can add
+<tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER=/path/to/clang</span> <span class="pre">-DCMAKE_CXX_COMPILER=/path/to/clang++</span></tt>.
+You can also use <tt class="docutils literal"><span class="pre">ccmake</span></tt>, which provides a curses interface to configure
+CMake variables for lazy people.</p>
+<p>As a result, the new <tt class="docutils literal"><span class="pre">compile_commands.json</span></tt> file should appear in the
+current directory. You should link it to the LLVM source tree so that
+Clang Tooling is able to use it:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> ln -s <span class="nv">$PWD</span>/compile_commands.json path/to/llvm/source/
+</pre></div>
+</div>
+<p>Now you are ready to build and test LLVM using make:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> make check-all
+</pre></div>
+</div>
+</div>
+<div class="section" id="using-clang-tools">
+<h2>Using Clang Tools<a class="headerlink" href="#using-clang-tools" title="Permalink to this headline">¶</a></h2>
+<p>After you completed the previous steps, you are ready to run clang tools. If
+you have a recent clang installed, you should have <tt class="docutils literal"><span class="pre">clang-check</span></tt> in
+<tt class="docutils literal"><span class="pre">$PATH</span></tt>. Try to run it on any <tt class="docutils literal"><span class="pre">.cpp</span></tt> file inside the LLVM source tree:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang-check tools/clang/lib/Tooling/CompilationDatabase.cpp
+</pre></div>
+</div>
+<p>If you’re using vim, it’s convenient to have clang-check integrated. Put
+this into your <tt class="docutils literal"><span class="pre">.vimrc</span></tt>:</p>
+<div class="highlight-python"><pre>function! ClangCheckImpl(cmd)
+  if &autowrite | wall | endif
+  echo "Running " . a:cmd . " ..."
+  let l:output = system(a:cmd)
+  cexpr l:output
+  cwindow
+  let w:quickfix_title = a:cmd
+  if v:shell_error != 0
+    cc
+  endif
+  let g:clang_check_last_cmd = a:cmd
+endfunction
+
+function! ClangCheck()
+  let l:filename = expand('%')
+  if l:filename =~ '\.\(cpp\|cxx\|cc\|c\)$'
+    call ClangCheckImpl("clang-check " . l:filename)
+  elseif exists("g:clang_check_last_cmd")
+    call ClangCheckImpl(g:clang_check_last_cmd)
+  else
+    echo "Can't detect file's compilation arguments and no previous clang-check invocation!"
+  endif
+endfunction
+
+nmap <silent> <F5> :call ClangCheck()<CR><CR></pre>
+</div>
+<p>When editing a .cpp/.cxx/.cc/.c file, hit F5 to reparse the file. In
+case the current file has a different extension (for example, .h), F5
+will re-run the last clang-check invocation made from this vim instance
+(if any). The output will go into the error window, which is opened
+automatically when clang-check finds errors, and can be re-opened with
+<tt class="docutils literal"><span class="pre">:cope</span></tt>.</p>
+<p>Other <tt class="docutils literal"><span class="pre">clang-check</span></tt> options that can be useful when working with clang
+AST:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-ast-print</span></tt> — Build ASTs and then pretty-print them.</li>
+<li><tt class="docutils literal"><span class="pre">-ast-dump</span></tt> — Build ASTs and then debug dump them.</li>
+<li><tt class="docutils literal"><span class="pre">-ast-dump-filter=<string></span></tt> — Use with <tt class="docutils literal"><span class="pre">-ast-dump</span></tt> or <tt class="docutils literal"><span class="pre">-ast-print</span></tt> to
+dump/print only AST declaration nodes having a certain substring in a
+qualified name. Use <tt class="docutils literal"><span class="pre">-ast-list</span></tt> to list all filterable declaration node
+names.</li>
+<li><tt class="docutils literal"><span class="pre">-ast-list</span></tt> — Build ASTs and print the list of declaration node qualified
+names.</li>
+</ul>
+<p>Examples:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-dump -ast-dump-filter ActionFactory::newASTConsumer
+<span class="go">Processing: tools/clang/tools/clang-check/ClangCheck.cpp.</span>
+<span class="go">Dumping ::ActionFactory::newASTConsumer:</span>
+<span class="go">clang::ASTConsumer *newASTConsumer() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:64:40, line:72:3></span>
+<span class="go">  (IfStmt 0x44d97c8 <line:65:5, line:66:45></span>
+<span class="go">    <<<NULL>>></span>
+<span class="go">      (ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool':'_Bool' <UserDefinedConversion></span>
+<span class="go">...</span>
+<span class="gp">$</span> clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFactory::newASTConsumer
+<span class="go">Processing: tools/clang/tools/clang-check/ClangCheck.cpp.</span>
+<span class="go">Printing <anonymous namespace>::ActionFactory::newASTConsumer:</span>
+<span class="go">clang::ASTConsumer *newASTConsumer() {</span>
+<span class="go">    if (this->ASTList.operator _Bool())</span>
+<span class="go">        return clang::CreateASTDeclNodeLister();</span>
+<span class="go">    if (this->ASTDump.operator _Bool())</span>
+<span class="go">        return clang::CreateASTDumper(this->ASTDumpFilter);</span>
+<span class="go">    if (this->ASTPrint.operator _Bool())</span>
+<span class="go">        return clang::CreateASTPrinter(&llvm::outs(), this->ASTDumpFilter);</span>
+<span class="go">    return new clang::ASTConsumer();</span>
+<span class="go">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="experimental-using-ninja-build-system">
+<h2>(Experimental) Using Ninja Build System<a class="headerlink" href="#experimental-using-ninja-build-system" title="Permalink to this headline">¶</a></h2>
+<p>Optionally you can use the <a class="reference external" href="https://github.com/martine/ninja">Ninja</a>
+build system instead of make. It is aimed at making your builds faster.
+Currently this step will require building Ninja from sources.</p>
+<p>To take advantage of using Clang Tools along with Ninja build you need
+at least CMake 2.8.9.</p>
+<p>Clone the Ninja git repository and build Ninja from sources:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git clone git://github.com/martine/ninja.git
+<span class="gp">$</span> <span class="nb">cd </span>ninja/
+<span class="gp">$</span> ./bootstrap.py
+</pre></div>
+</div>
+<p>This will result in a single binary <tt class="docutils literal"><span class="pre">ninja</span></tt> in the current directory.
+It doesn’t require installation and can just be copied to any location
+inside <tt class="docutils literal"><span class="pre">$PATH</span></tt>, say <tt class="docutils literal"><span class="pre">/usr/local/bin/</span></tt>:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> sudo cp ninja /usr/local/bin/
+<span class="gp">$</span> sudo chmod a+rx /usr/local/bin/ninja
+</pre></div>
+</div>
+<p>After doing all of this, you’ll need to generate Ninja build files for
+LLVM with CMake. You need to make a build directory and run CMake from
+it:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> mkdir your/build/directory
+<span class="gp">$</span> <span class="nb">cd </span>your/build/directory
+<span class="gp">$</span> cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS<span class="o">=</span>ON path/to/llvm/sources
+</pre></div>
+</div>
+<p>If you want to use clang instead of GCC, you can add
+<tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER=/path/to/clang</span> <span class="pre">-DCMAKE_CXX_COMPILER=/path/to/clang++</span></tt>.
+You can also use <tt class="docutils literal"><span class="pre">ccmake</span></tt>, which provides a curses interface to configure
+CMake variables in an interactive manner.</p>
+<p>As a result, the new <tt class="docutils literal"><span class="pre">compile_commands.json</span></tt> file should appear in the
+current directory. You should link it to the LLVM source tree so that
+Clang Tooling is able to use it:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> ln -s <span class="nv">$PWD</span>/compile_commands.json path/to/llvm/source/
+</pre></div>
+</div>
+<p>Now you are ready to build and test LLVM using Ninja:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> ninja check-all
+</pre></div>
+</div>
+<p>Other target names can be used in the same way as with make.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="LibASTMatchers.html">Matching the Clang AST</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="JSONCompilationDatabase.html">JSON Compilation Database Format Specification</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/InternalsManual.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/InternalsManual.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/InternalsManual.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/InternalsManual.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,1861 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>“Clang” CFE Internals Manual — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Driver Design & Internals" href="DriverInternals.html" />
+    <link rel="prev" title="Clang-Format Style Options" href="ClangFormatStyleOptions.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>“Clang” CFE Internals Manual</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DriverInternals.html">Driver Design & Internals</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-cfe-internals-manual">
+<h1>“Clang” CFE Internals Manual<a class="headerlink" href="#clang-cfe-internals-manual" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id2">Introduction</a></li>
+<li><a class="reference internal" href="#llvm-support-library" id="id3">LLVM Support Library</a></li>
+<li><a class="reference internal" href="#the-clang-basic-library" id="id4">The Clang “Basic” Library</a><ul>
+<li><a class="reference internal" href="#the-diagnostics-subsystem" id="id5">The Diagnostics Subsystem</a><ul>
+<li><a class="reference internal" href="#the-diagnostic-kinds-td-files" id="id6">The <tt class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></tt> files</a></li>
+<li><a class="reference internal" href="#the-format-string" id="id7">The Format String</a></li>
+<li><a class="reference internal" href="#formatting-a-diagnostic-argument" id="id8">Formatting a Diagnostic Argument</a></li>
+<li><a class="reference internal" href="#producing-the-diagnostic" id="id9">Producing the Diagnostic</a></li>
+<li><a class="reference internal" href="#fix-it-hints" id="id10">Fix-It Hints</a></li>
+<li><a class="reference internal" href="#the-diagnosticclient-interface" id="id11">The <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> Interface</a></li>
+<li><a class="reference internal" href="#adding-translations-to-clang" id="id12">Adding Translations to Clang</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-sourcelocation-and-sourcemanager-classes" id="id13">The <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> and <tt class="docutils literal"><span class="pre">SourceManager</span></tt> classes</a></li>
+<li><a class="reference internal" href="#sourcerange-and-charsourcerange" id="id14"><tt class="docutils literal"><span class="pre">SourceRange</span></tt> and <tt class="docutils literal"><span class="pre">CharSourceRange</span></tt></a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-driver-library" id="id15">The Driver Library</a></li>
+<li><a class="reference internal" href="#precompiled-headers" id="id16">Precompiled Headers</a></li>
+<li><a class="reference internal" href="#the-frontend-library" id="id17">The Frontend Library</a></li>
+<li><a class="reference internal" href="#the-lexer-and-preprocessor-library" id="id18">The Lexer and Preprocessor Library</a><ul>
+<li><a class="reference internal" href="#the-token-class" id="id19">The Token class</a></li>
+<li><a class="reference internal" href="#annotation-tokens" id="id20">Annotation Tokens</a></li>
+<li><a class="reference internal" href="#the-lexer-class" id="id21">The <tt class="docutils literal"><span class="pre">Lexer</span></tt> class</a></li>
+<li><a class="reference internal" href="#the-tokenlexer-class" id="id22">The <tt class="docutils literal"><span class="pre">TokenLexer</span></tt> class</a></li>
+<li><a class="reference internal" href="#the-multipleincludeopt-class" id="id23">The <tt class="docutils literal"><span class="pre">MultipleIncludeOpt</span></tt> class</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-parser-library" id="id24">The Parser Library</a></li>
+<li><a class="reference internal" href="#the-ast-library" id="id25">The AST Library</a><ul>
+<li><a class="reference internal" href="#the-type-class-and-its-subclasses" id="id26">The <tt class="docutils literal"><span class="pre">Type</span></tt> class and its subclasses</a><ul>
+<li><a class="reference internal" href="#canonical-types" id="id27">Canonical Types</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-qualtype-class" id="id28">The <tt class="docutils literal"><span class="pre">QualType</span></tt> class</a></li>
+<li><a class="reference internal" href="#declaration-names" id="id29">Declaration names</a></li>
+<li><a class="reference internal" href="#declaration-contexts" id="id30">Declaration contexts</a><ul>
+<li><a class="reference internal" href="#redeclarations-and-overloads" id="id31">Redeclarations and Overloads</a></li>
+<li><a class="reference internal" href="#lexical-and-semantic-contexts" id="id32">Lexical and Semantic Contexts</a></li>
+<li><a class="reference internal" href="#transparent-declaration-contexts" id="id33">Transparent Declaration Contexts</a></li>
+<li><a class="reference internal" href="#multiply-defined-declaration-contexts" id="id34">Multiply-Defined Declaration Contexts</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-cfg-class" id="id35">The <tt class="docutils literal"><span class="pre">CFG</span></tt> class</a><ul>
+<li><a class="reference internal" href="#basic-blocks" id="id36">Basic Blocks</a></li>
+<li><a class="reference internal" href="#entry-and-exit-blocks" id="id37">Entry and Exit Blocks</a></li>
+<li><a class="reference internal" href="#conditional-control-flow" id="id38">Conditional Control-Flow</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#constant-folding-in-the-clang-ast" id="id39">Constant Folding in the Clang AST</a><ul>
+<li><a class="reference internal" href="#implementation-approach" id="id40">Implementation Approach</a></li>
+<li><a class="reference internal" href="#extensions" id="id41">Extensions</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference internal" href="#how-to-change-clang" id="id42">How to change Clang</a><ul>
+<li><a class="reference internal" href="#how-to-add-an-attribute" id="id43">How to add an attribute</a><ul>
+<li><a class="reference internal" href="#attribute-basics" id="id44">Attribute Basics</a></li>
+<li><a class="reference internal" href="#include-clang-basic-attr-td" id="id45"><tt class="docutils literal"><span class="pre">include/clang/Basic/Attr.td</span></tt></a></li>
+<li><a class="reference internal" href="#boilerplate" id="id46">Boilerplate</a></li>
+<li><a class="reference internal" href="#the-meat-of-your-attribute" id="id47">The meat of your attribute</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#how-to-add-an-expression-or-statement" id="id48">How to add an expression or statement</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id2">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document describes some of the more important APIs and internal design
+decisions made in the Clang C front-end.  The purpose of this document is to
+both capture some of this high level information and also describe some of the
+design decisions behind it.  This is meant for people interested in hacking on
+Clang, not for end-users.  The description below is categorized by libraries,
+and does not describe any of the clients of the libraries.</p>
+</div>
+<div class="section" id="llvm-support-library">
+<h2><a class="toc-backref" href="#id3">LLVM Support Library</a><a class="headerlink" href="#llvm-support-library" title="Permalink to this headline">¶</a></h2>
+<p>The LLVM <tt class="docutils literal"><span class="pre">libSupport</span></tt> library provides many underlying libraries and
+<a class="reference external" href="http://llvm.org/docs/ProgrammersManual.html">data-structures</a>, including
+command line option processing, various containers and a system abstraction
+layer, which is used for file system access.</p>
+</div>
+<div class="section" id="the-clang-basic-library">
+<h2><a class="toc-backref" href="#id4">The Clang “Basic” Library</a><a class="headerlink" href="#the-clang-basic-library" title="Permalink to this headline">¶</a></h2>
+<p>This library certainly needs a better name.  The “basic” library contains a
+number of low-level utilities for tracking and manipulating source buffers,
+locations within the source buffers, diagnostics, tokens, target abstraction,
+and information about the subset of the language being compiled for.</p>
+<p>Part of this infrastructure is specific to C (such as the <tt class="docutils literal"><span class="pre">TargetInfo</span></tt>
+class), other parts could be reused for other non-C-based languages
+(<tt class="docutils literal"><span class="pre">SourceLocation</span></tt>, <tt class="docutils literal"><span class="pre">SourceManager</span></tt>, <tt class="docutils literal"><span class="pre">Diagnostics</span></tt>, <tt class="docutils literal"><span class="pre">FileManager</span></tt>).
+When and if there is future demand we can figure out if it makes sense to
+introduce a new library, move the general classes somewhere else, or introduce
+some other solution.</p>
+<p>We describe the roles of these classes in order of their dependencies.</p>
+<div class="section" id="the-diagnostics-subsystem">
+<h3><a class="toc-backref" href="#id5">The Diagnostics Subsystem</a><a class="headerlink" href="#the-diagnostics-subsystem" title="Permalink to this headline">¶</a></h3>
+<p>The Clang Diagnostics subsystem is an important part of how the compiler
+communicates with the human.  Diagnostics are the warnings and errors produced
+when the code is incorrect or dubious.  In Clang, each diagnostic produced has
+(at the minimum) a unique ID, an English translation associated with it, a
+<a class="reference internal" href="#sourcelocation"><em>SourceLocation</em></a> to “put the caret”, and a severity
+(e.g., <tt class="docutils literal"><span class="pre">WARNING</span></tt> or <tt class="docutils literal"><span class="pre">ERROR</span></tt>).  They can also optionally include a number of
+arguments to the dianostic (which fill in “%0“‘s in the string) as well as a
+number of source ranges that related to the diagnostic.</p>
+<p>In this section, we’ll be giving examples produced by the Clang command line
+driver, but diagnostics can be <a class="reference internal" href="#diagnosticclient"><em>rendered in many different ways</em></a> depending on how the <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> interface is
+implemented.  A representative example of a diagnostic is:</p>
+<div class="highlight-c++"><pre>t.c:38:15: error: invalid operands to binary expression ('int *' and '_Complex float')
+P = (P-42) + Gamma*4;
+    ~~~~~~ ^ ~~~~~~~</pre>
+</div>
+<p>In this example, you can see the English translation, the severity (error), you
+can see the source location (the caret (“<tt class="docutils literal"><span class="pre">^</span></tt>”) and file/line/column info),
+the source ranges “<tt class="docutils literal"><span class="pre">~~~~</span></tt>”, arguments to the diagnostic (“<tt class="docutils literal"><span class="pre">int*</span></tt>” and
+“<tt class="docutils literal"><span class="pre">_Complex</span> <span class="pre">float</span></tt>”).  You’ll have to believe me that there is a unique ID
+backing the diagnostic :).</p>
+<p>Getting all of this to happen has several steps and involves many moving
+pieces, this section describes them and talks about best practices when adding
+a new diagnostic.</p>
+<div class="section" id="the-diagnostic-kinds-td-files">
+<h4><a class="toc-backref" href="#id6">The <tt class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></tt> files</a><a class="headerlink" href="#the-diagnostic-kinds-td-files" title="Permalink to this headline">¶</a></h4>
+<p>Diagnostics are created by adding an entry to one of the
+<tt class="docutils literal"><span class="pre">clang/Basic/Diagnostic*Kinds.td</span></tt> files, depending on what library will be
+using it.  From this file, <strong class="program">tblgen</strong> generates the unique ID of the
+diagnostic, the severity of the diagnostic and the English translation + format
+string.</p>
+<p>There is little sanity with the naming of the unique ID’s right now.  Some
+start with <tt class="docutils literal"><span class="pre">err_</span></tt>, <tt class="docutils literal"><span class="pre">warn_</span></tt>, <tt class="docutils literal"><span class="pre">ext_</span></tt> to encode the severity into the name.
+Since the enum is referenced in the C++ code that produces the diagnostic, it
+is somewhat useful for it to be reasonably short.</p>
+<p>The severity of the diagnostic comes from the set {<tt class="docutils literal"><span class="pre">NOTE</span></tt>, <tt class="docutils literal"><span class="pre">REMARK</span></tt>,
+<tt class="docutils literal"><span class="pre">WARNING</span></tt>,
+<tt class="docutils literal"><span class="pre">EXTENSION</span></tt>, <tt class="docutils literal"><span class="pre">EXTWARN</span></tt>, <tt class="docutils literal"><span class="pre">ERROR</span></tt>}.  The <tt class="docutils literal"><span class="pre">ERROR</span></tt> severity is used for
+diagnostics indicating the program is never acceptable under any circumstances.
+When an error is emitted, the AST for the input code may not be fully built.
+The <tt class="docutils literal"><span class="pre">EXTENSION</span></tt> and <tt class="docutils literal"><span class="pre">EXTWARN</span></tt> severities are used for extensions to the
+language that Clang accepts.  This means that Clang fully understands and can
+represent them in the AST, but we produce diagnostics to tell the user their
+code is non-portable.  The difference is that the former are ignored by
+default, and the later warn by default.  The <tt class="docutils literal"><span class="pre">WARNING</span></tt> severity is used for
+constructs that are valid in the currently selected source language but that
+are dubious in some way.  The <tt class="docutils literal"><span class="pre">REMARK</span></tt> severity provides generic information
+about the compilation that is not necessarily related to any dubious code.  The
+<tt class="docutils literal"><span class="pre">NOTE</span></tt> level is used to staple more information onto previous diagnostics.</p>
+<p>These <em>severities</em> are mapped into a smaller set (the <tt class="docutils literal"><span class="pre">Diagnostic::Level</span></tt>
+enum, {<tt class="docutils literal"><span class="pre">Ignored</span></tt>, <tt class="docutils literal"><span class="pre">Note</span></tt>, <tt class="docutils literal"><span class="pre">Remark</span></tt>, <tt class="docutils literal"><span class="pre">Warning</span></tt>, <tt class="docutils literal"><span class="pre">Error</span></tt>, <tt class="docutils literal"><span class="pre">Fatal</span></tt>}) of
+output
+<em>levels</em> by the diagnostics subsystem based on various configuration options.
+Clang internally supports a fully fine grained mapping mechanism that allows
+you to map almost any diagnostic to the output level that you want.  The only
+diagnostics that cannot be mapped are <tt class="docutils literal"><span class="pre">NOTE</span></tt>s, which always follow the
+severity of the previously emitted diagnostic and <tt class="docutils literal"><span class="pre">ERROR</span></tt>s, which can only
+be mapped to <tt class="docutils literal"><span class="pre">Fatal</span></tt> (it is not possible to turn an error into a warning, for
+example).</p>
+<p>Diagnostic mappings are used in many ways.  For example, if the user specifies
+<tt class="docutils literal"><span class="pre">-pedantic</span></tt>, <tt class="docutils literal"><span class="pre">EXTENSION</span></tt> maps to <tt class="docutils literal"><span class="pre">Warning</span></tt>, if they specify
+<tt class="docutils literal"><span class="pre">-pedantic-errors</span></tt>, it turns into <tt class="docutils literal"><span class="pre">Error</span></tt>.  This is used to implement
+options like <tt class="docutils literal"><span class="pre">-Wunused_macros</span></tt>, <tt class="docutils literal"><span class="pre">-Wundef</span></tt> etc.</p>
+<p>Mapping to <tt class="docutils literal"><span class="pre">Fatal</span></tt> should only be used for diagnostics that are considered so
+severe that error recovery won’t be able to recover sensibly from them (thus
+spewing a ton of bogus errors).  One example of this class of error are failure
+to <tt class="docutils literal"><span class="pre">#include</span></tt> a file.</p>
+</div>
+<div class="section" id="the-format-string">
+<h4><a class="toc-backref" href="#id7">The Format String</a><a class="headerlink" href="#the-format-string" title="Permalink to this headline">¶</a></h4>
+<p>The format string for the diagnostic is very simple, but it has some power.  It
+takes the form of a string in English with markers that indicate where and how
+arguments to the diagnostic are inserted and formatted.  For example, here are
+some simple format strings:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="s">"binary integer literals are an extension"</span>
+<span class="s">"format string contains '</span><span class="se">\\</span><span class="s">0' within the string body"</span>
+<span class="s">"more '%%' conversions than data arguments"</span>
+<span class="s">"invalid operands to binary expression (%0 and %1)"</span>
+<span class="s">"overloaded '%0' must be a %select{unary|binary|unary or binary}2 operator"</span>
+     <span class="s">" (has %1 parameter%s1)"</span>
+</pre></div>
+</div>
+<p>These examples show some important points of format strings.  You can use any
+plain ASCII character in the diagnostic string except “<tt class="docutils literal"><span class="pre">%</span></tt>” without a
+problem, but these are C strings, so you have to use and be aware of all the C
+escape sequences (as in the second example).  If you want to produce a “<tt class="docutils literal"><span class="pre">%</span></tt>”
+in the output, use the “<tt class="docutils literal"><span class="pre">%%</span></tt>” escape sequence, like the third diagnostic.
+Finally, Clang uses the “<tt class="docutils literal"><span class="pre">%...[digit]</span></tt>” sequences to specify where and how
+arguments to the diagnostic are formatted.</p>
+<p>Arguments to the diagnostic are numbered according to how they are specified by
+the C++ code that <a class="reference internal" href="#internals-producing-diag"><em>produces them</em></a>, and are
+referenced by <tt class="docutils literal"><span class="pre">%0</span></tt> .. <tt class="docutils literal"><span class="pre">%9</span></tt>.  If you have more than 10 arguments to your
+diagnostic, you are doing something wrong :).  Unlike <tt class="docutils literal"><span class="pre">printf</span></tt>, there is no
+requirement that arguments to the diagnostic end up in the output in the same
+order as they are specified, you could have a format string with “<tt class="docutils literal"><span class="pre">%1</span> <span class="pre">%0</span></tt>”
+that swaps them, for example.  The text in between the percent and digit are
+formatting instructions.  If there are no instructions, the argument is just
+turned into a string and substituted in.</p>
+<p>Here are some “best practices” for writing the English format string:</p>
+<ul class="simple">
+<li>Keep the string short.  It should ideally fit in the 80 column limit of the
+<tt class="docutils literal"><span class="pre">DiagnosticKinds.td</span></tt> file.  This avoids the diagnostic wrapping when
+printed, and forces you to think about the important point you are conveying
+with the diagnostic.</li>
+<li>Take advantage of location information.  The user will be able to see the
+line and location of the caret, so you don’t need to tell them that the
+problem is with the 4th argument to the function: just point to it.</li>
+<li>Do not capitalize the diagnostic string, and do not end it with a period.</li>
+<li>If you need to quote something in the diagnostic string, use single quotes.</li>
+</ul>
+<p>Diagnostics should never take random English strings as arguments: you
+shouldn’t use “<tt class="docutils literal"><span class="pre">you</span> <span class="pre">have</span> <span class="pre">a</span> <span class="pre">problem</span> <span class="pre">with</span> <span class="pre">%0</span></tt>” and pass in things like “<tt class="docutils literal"><span class="pre">your</span>
+<span class="pre">argument</span></tt>” or “<tt class="docutils literal"><span class="pre">your</span> <span class="pre">return</span> <span class="pre">value</span></tt>” as arguments.  Doing this prevents
+<a class="reference internal" href="#internals-diag-translation"><em>translating</em></a> the Clang diagnostics to other
+languages (because they’ll get random English words in their otherwise
+localized diagnostic).  The exceptions to this are C/C++ language keywords
+(e.g., <tt class="docutils literal"><span class="pre">auto</span></tt>, <tt class="docutils literal"><span class="pre">const</span></tt>, <tt class="docutils literal"><span class="pre">mutable</span></tt>, etc) and C/C++ operators (<tt class="docutils literal"><span class="pre">/=</span></tt>).
+Note that things like “pointer” and “reference” are not keywords.  On the other
+hand, you <em>can</em> include anything that comes from the user’s source code,
+including variable names, types, labels, etc.  The “<tt class="docutils literal"><span class="pre">select</span></tt>” format can be
+used to achieve this sort of thing in a localizable way, see below.</p>
+</div>
+<div class="section" id="formatting-a-diagnostic-argument">
+<h4><a class="toc-backref" href="#id8">Formatting a Diagnostic Argument</a><a class="headerlink" href="#formatting-a-diagnostic-argument" title="Permalink to this headline">¶</a></h4>
+<p>Arguments to diagnostics are fully typed internally, and come from a couple
+different classes: integers, types, names, and random strings.  Depending on
+the class of the argument, it can be optionally formatted in different ways.
+This gives the <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> information about what the argument means
+without requiring it to use a specific presentation (consider this MVC for
+Clang :).</p>
+<p>Here are the different diagnostic argument formats currently supported by
+Clang:</p>
+<p><strong>“s” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"requires</span> <span class="pre">%1</span> <span class="pre">parameter%s1"</span></tt></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter for integers that is useful when producing English
+diagnostics.  When the integer is 1, it prints as nothing.  When the integer
+is not 1, it prints as “<tt class="docutils literal"><span class="pre">s</span></tt>”.  This allows some simple grammatical forms to
+be to be handled correctly, and eliminates the need to use gross things like
+<tt class="docutils literal"><span class="pre">"requires</span> <span class="pre">%1</span> <span class="pre">parameter(s)"</span></tt>.</dd>
+</dl>
+<p><strong>“select” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"must</span> <span class="pre">be</span> <span class="pre">a</span> <span class="pre">%select{unary|binary|unary</span> <span class="pre">or</span> <span class="pre">binary}2</span> <span class="pre">operator"</span></tt></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This format specifier is used to merge multiple related diagnostics together
+into one common one, without requiring the difference to be specified as an
+English string argument.  Instead of specifying the string, the diagnostic
+gets an integer argument and the format string selects the numbered option.
+In this case, the “<tt class="docutils literal"><span class="pre">%2</span></tt>” value must be an integer in the range [0..2].  If
+it is 0, it prints “unary”, if it is 1 it prints “binary” if it is 2, it
+prints “unary or binary”.  This allows other language translations to
+substitute reasonable words (or entire phrases) based on the semantics of the
+diagnostic instead of having to do things textually.  The selected string
+does undergo formatting.</dd>
+</dl>
+<p><strong>“plural” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"you</span> <span class="pre">have</span> <span class="pre">%1</span> <span class="pre">%plural{1:mouse|:mice}1</span> <span class="pre">connected</span> <span class="pre">to</span> <span class="pre">your</span> <span class="pre">computer"</span></tt></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd><p class="first">This is a formatter for complex plural forms.  It is designed to handle even
+the requirements of languages with very complex plural forms, as many Baltic
+languages have.  The argument consists of a series of expression/form pairs,
+separated by ”:”, where the first form whose expression evaluates to true is
+the result of the modifier.</p>
+<p>An expression can be empty, in which case it is always true.  See the example
+at the top.  Otherwise, it is a series of one or more numeric conditions,
+separated by ”,”.  If any condition matches, the expression matches.  Each
+numeric condition can take one of three forms.</p>
+<ul class="simple">
+<li>number: A simple decimal number matches if the argument is the same as the
+number.  Example: <tt class="docutils literal"><span class="pre">"%plural{1:mouse|:mice}4"</span></tt></li>
+<li>range: A range in square brackets matches if the argument is within the
+range.  Then range is inclusive on both ends.  Example:
+<tt class="docutils literal"><span class="pre">"%plural{0:none|1:one|[2,5]:some|:many}2"</span></tt></li>
+<li>modulo: A modulo operator is followed by a number, and equals sign and
+either a number or a range.  The tests are the same as for plain numbers
+and ranges, but the argument is taken modulo the number first.  Example:
+<tt class="docutils literal"><span class="pre">"%plural{%100=0:even</span> <span class="pre">hundred|%100=[1,50]:lower</span> <span class="pre">half|:everything</span> <span class="pre">else}1"</span></tt></li>
+</ul>
+<p class="last">The parser is very unforgiving.  A syntax error, even whitespace, will abort,
+as will a failure to match the argument against any expression.</p>
+</dd>
+</dl>
+<p><strong>“ordinal” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"ambiguity</span> <span class="pre">in</span> <span class="pre">%ordinal0</span> <span class="pre">argument"</span></tt></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This is a formatter which represents the argument number as an ordinal: the
+value <tt class="docutils literal"><span class="pre">1</span></tt> becomes <tt class="docutils literal"><span class="pre">1st</span></tt>, <tt class="docutils literal"><span class="pre">3</span></tt> becomes <tt class="docutils literal"><span class="pre">3rd</span></tt>, and so on.  Values less
+than <tt class="docutils literal"><span class="pre">1</span></tt> are not supported.  This formatter is currently hard-coded to use
+English ordinals.</dd>
+</dl>
+<p><strong>“objcclass” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"method</span> <span class="pre">%objcclass0</span> <span class="pre">not</span> <span class="pre">found"</span></tt></dd>
+<dt>Class:</dt>
+<dd><tt class="docutils literal"><span class="pre">DeclarationName</span></tt></dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter that indicates the <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> corresponds
+to an Objective-C class method selector.  As such, it prints the selector
+with a leading “<tt class="docutils literal"><span class="pre">+</span></tt>”.</dd>
+</dl>
+<p><strong>“objcinstance” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"method</span> <span class="pre">%objcinstance0</span> <span class="pre">not</span> <span class="pre">found"</span></tt></dd>
+<dt>Class:</dt>
+<dd><tt class="docutils literal"><span class="pre">DeclarationName</span></tt></dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter that indicates the <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> corresponds
+to an Objective-C instance method selector.  As such, it prints the selector
+with a leading “<tt class="docutils literal"><span class="pre">-</span></tt>”.</dd>
+</dl>
+<p><strong>“q” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"candidate</span> <span class="pre">found</span> <span class="pre">by</span> <span class="pre">name</span> <span class="pre">lookup</span> <span class="pre">is</span> <span class="pre">%q0"</span></tt></dd>
+<dt>Class:</dt>
+<dd><tt class="docutils literal"><span class="pre">NamedDecl</span> <span class="pre">*</span></tt></dd>
+<dt>Description:</dt>
+<dd>This formatter indicates that the fully-qualified name of the declaration
+should be printed, e.g., “<tt class="docutils literal"><span class="pre">std::vector</span></tt>” rather than “<tt class="docutils literal"><span class="pre">vector</span></tt>”.</dd>
+</dl>
+<p><strong>“diff” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><tt class="docutils literal"><span class="pre">"no</span> <span class="pre">known</span> <span class="pre">conversion</span> <span class="pre">%diff{from</span> <span class="pre">$</span> <span class="pre">to</span> <span class="pre">$|from</span> <span class="pre">argument</span> <span class="pre">type</span> <span class="pre">to</span> <span class="pre">parameter</span> <span class="pre">type}1,2"</span></tt></dd>
+<dt>Class:</dt>
+<dd><tt class="docutils literal"><span class="pre">QualType</span></tt></dd>
+<dt>Description:</dt>
+<dd>This formatter takes two <tt class="docutils literal"><span class="pre">QualType</span></tt>s and attempts to print a template
+difference between the two.  If tree printing is off, the text inside the
+braces before the pipe is printed, with the formatted text replacing the $.
+If tree printing is on, the text after the pipe is printed and a type tree is
+printed after the diagnostic message.</dd>
+</dl>
+<p>It is really easy to add format specifiers to the Clang diagnostics system, but
+they should be discussed before they are added.  If you are creating a lot of
+repetitive diagnostics and/or have an idea for a useful formatter, please bring
+it up on the cfe-dev mailing list.</p>
+</div>
+<div class="section" id="producing-the-diagnostic">
+<span id="internals-producing-diag"></span><h4><a class="toc-backref" href="#id9">Producing the Diagnostic</a><a class="headerlink" href="#producing-the-diagnostic" title="Permalink to this headline">¶</a></h4>
+<p>Now that you’ve created the diagnostic in the <tt class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></tt> file, you
+need to write the code that detects the condition in question and emits the new
+diagnostic.  Various components of Clang (e.g., the preprocessor, <tt class="docutils literal"><span class="pre">Sema</span></tt>,
+etc.) provide a helper function named “<tt class="docutils literal"><span class="pre">Diag</span></tt>”.  It creates a diagnostic and
+accepts the arguments, ranges, and other information that goes along with it.</p>
+<p>For example, the binary expression error comes from code like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">various</span> <span class="n">things</span> <span class="n">that</span> <span class="n">are</span> <span class="n">bad</span><span class="p">)</span>
+  <span class="n">Diag</span><span class="p">(</span><span class="n">Loc</span><span class="p">,</span> <span class="n">diag</span><span class="o">::</span><span class="n">err_typecheck_invalid_operands</span><span class="p">)</span>
+    <span class="o"><<</span> <span class="n">lex</span><span class="o">-></span><span class="n">getType</span><span class="p">()</span> <span class="o"><<</span> <span class="n">rex</span><span class="o">-></span><span class="n">getType</span><span class="p">()</span>
+    <span class="o"><<</span> <span class="n">lex</span><span class="o">-></span><span class="n">getSourceRange</span><span class="p">()</span> <span class="o"><<</span> <span class="n">rex</span><span class="o">-></span><span class="n">getSourceRange</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>This shows that use of the <tt class="docutils literal"><span class="pre">Diag</span></tt> method: it takes a location (a
+<a class="reference internal" href="#sourcelocation"><em>SourceLocation</em></a> object) and a diagnostic enum value
+(which matches the name from <tt class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></tt>).  If the diagnostic takes
+arguments, they are specified with the <tt class="docutils literal"><span class="pre"><<</span></tt> operator: the first argument
+becomes <tt class="docutils literal"><span class="pre">%0</span></tt>, the second becomes <tt class="docutils literal"><span class="pre">%1</span></tt>, etc.  The diagnostic interface
+allows you to specify arguments of many different types, including <tt class="docutils literal"><span class="pre">int</span></tt> and
+<tt class="docutils literal"><span class="pre">unsigned</span></tt> for integer arguments, <tt class="docutils literal"><span class="pre">const</span> <span class="pre">char*</span></tt> and <tt class="docutils literal"><span class="pre">std::string</span></tt> for
+string arguments, <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> and <tt class="docutils literal"><span class="pre">const</span> <span class="pre">IdentifierInfo</span> <span class="pre">*</span></tt> for names,
+<tt class="docutils literal"><span class="pre">QualType</span></tt> for types, etc.  <tt class="docutils literal"><span class="pre">SourceRange</span></tt>s are also specified with the
+<tt class="docutils literal"><span class="pre"><<</span></tt> operator, but do not have a specific ordering requirement.</p>
+<p>As you can see, adding and producing a diagnostic is pretty straightforward.
+The hard part is deciding exactly what you need to say to help the user,
+picking a suitable wording, and providing the information needed to format it
+correctly.  The good news is that the call site that issues a diagnostic should
+be completely independent of how the diagnostic is formatted and in what
+language it is rendered.</p>
+</div>
+<div class="section" id="fix-it-hints">
+<h4><a class="toc-backref" href="#id10">Fix-It Hints</a><a class="headerlink" href="#fix-it-hints" title="Permalink to this headline">¶</a></h4>
+<p>In some cases, the front end emits diagnostics when it is clear that some small
+change to the source code would fix the problem.  For example, a missing
+semicolon at the end of a statement or a use of deprecated syntax that is
+easily rewritten into a more modern form.  Clang tries very hard to emit the
+diagnostic and recover gracefully in these and other cases.</p>
+<p>However, for these cases where the fix is obvious, the diagnostic can be
+annotated with a hint (referred to as a “fix-it hint”) that describes how to
+change the code referenced by the diagnostic to fix the problem.  For example,
+it might add the missing semicolon at the end of the statement or rewrite the
+use of a deprecated construct into something more palatable.  Here is one such
+example from the C++ front end, where we warn about the right-shift operator
+changing meaning from C++98 to C++11:</p>
+<div class="highlight-c++"><pre>test.cpp:3:7: warning: use of right-shift operator ('>>') in template argument
+                       will require parentheses in C++11
+A<100 >> 2> *a;
+      ^
+  (       )</pre>
+</div>
+<p>Here, the fix-it hint is suggesting that parentheses be added, and showing
+exactly where those parentheses would be inserted into the source code.  The
+fix-it hints themselves describe what changes to make to the source code in an
+abstract manner, which the text diagnostic printer renders as a line of
+“insertions” below the caret line.  <a class="reference internal" href="#diagnosticclient"><em>Other diagnostic clients</em></a> might choose to render the code differently (e.g., as
+markup inline) or even give the user the ability to automatically fix the
+problem.</p>
+<p>Fix-it hints on errors and warnings need to obey these rules:</p>
+<ul class="simple">
+<li>Since they are automatically applied if <tt class="docutils literal"><span class="pre">-Xclang</span> <span class="pre">-fixit</span></tt> is passed to the
+driver, they should only be used when it’s very likely they match the user’s
+intent.</li>
+<li>Clang must recover from errors as if the fix-it had been applied.</li>
+</ul>
+<p>If a fix-it can’t obey these rules, put the fix-it on a note.  Fix-its on notes
+are not applied automatically.</p>
+<p>All fix-it hints are described by the <tt class="docutils literal"><span class="pre">FixItHint</span></tt> class, instances of which
+should be attached to the diagnostic using the <tt class="docutils literal"><span class="pre"><<</span></tt> operator in the same way
+that highlighted source ranges and arguments are passed to the diagnostic.
+Fix-it hints can be created with one of three constructors:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">FixItHint::CreateInsertion(Loc,</span> <span class="pre">Code)</span></tt></p>
+<blockquote>
+<div><p>Specifies that the given <tt class="docutils literal"><span class="pre">Code</span></tt> (a string) should be inserted before the
+source location <tt class="docutils literal"><span class="pre">Loc</span></tt>.</p>
+</div></blockquote>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">FixItHint::CreateRemoval(Range)</span></tt></p>
+<blockquote>
+<div><p>Specifies that the code in the given source <tt class="docutils literal"><span class="pre">Range</span></tt> should be removed.</p>
+</div></blockquote>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">FixItHint::CreateReplacement(Range,</span> <span class="pre">Code)</span></tt></p>
+<blockquote>
+<div><p>Specifies that the code in the given source <tt class="docutils literal"><span class="pre">Range</span></tt> should be removed,
+and replaced with the given <tt class="docutils literal"><span class="pre">Code</span></tt> string.</p>
+</div></blockquote>
+</li>
+</ul>
+</div>
+<div class="section" id="the-diagnosticclient-interface">
+<span id="diagnosticclient"></span><h4><a class="toc-backref" href="#id11">The <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> Interface</a><a class="headerlink" href="#the-diagnosticclient-interface" title="Permalink to this headline">¶</a></h4>
+<p>Once code generates a diagnostic with all of the arguments and the rest of the
+relevant information, Clang needs to know what to do with it.  As previously
+mentioned, the diagnostic machinery goes through some filtering to map a
+severity onto a diagnostic level, then (assuming the diagnostic is not mapped
+to “<tt class="docutils literal"><span class="pre">Ignore</span></tt>”) it invokes an object that implements the <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt>
+interface with the information.</p>
+<p>It is possible to implement this interface in many different ways.  For
+example, the normal Clang <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> (named
+<tt class="docutils literal"><span class="pre">TextDiagnosticPrinter</span></tt>) turns the arguments into strings (according to the
+various formatting rules), prints out the file/line/column information and the
+string, then prints out the line of code, the source ranges, and the caret.
+However, this behavior isn’t required.</p>
+<p>Another implementation of the <tt class="docutils literal"><span class="pre">DiagnosticClient</span></tt> interface is the
+<tt class="docutils literal"><span class="pre">TextDiagnosticBuffer</span></tt> class, which is used when Clang is in <tt class="docutils literal"><span class="pre">-verify</span></tt>
+mode.  Instead of formatting and printing out the diagnostics, this
+implementation just captures and remembers the diagnostics as they fly by.
+Then <tt class="docutils literal"><span class="pre">-verify</span></tt> compares the list of produced diagnostics to the list of
+expected ones.  If they disagree, it prints out its own output.  Full
+documentation for the <tt class="docutils literal"><span class="pre">-verify</span></tt> mode can be found in the Clang API
+documentation for <a class="reference external" href="/doxygen/classclang_1_1VerifyDiagnosticConsumer.html#details">VerifyDiagnosticConsumer</a>.</p>
+<p>There are many other possible implementations of this interface, and this is
+why we prefer diagnostics to pass down rich structured information in
+arguments.  For example, an HTML output might want declaration names be
+linkified to where they come from in the source.  Another example is that a GUI
+might let you click on typedefs to expand them.  This application would want to
+pass significantly more information about types through to the GUI than a
+simple flat string.  The interface allows this to happen.</p>
+</div>
+<div class="section" id="adding-translations-to-clang">
+<span id="internals-diag-translation"></span><h4><a class="toc-backref" href="#id12">Adding Translations to Clang</a><a class="headerlink" href="#adding-translations-to-clang" title="Permalink to this headline">¶</a></h4>
+<p>Not possible yet! Diagnostic strings should be written in UTF-8, the client can
+translate to the relevant code page if needed.  Each translation completely
+replaces the format string for the diagnostic.</p>
+</div>
+</div>
+<div class="section" id="the-sourcelocation-and-sourcemanager-classes">
+<span id="sourcemanager"></span><span id="sourcelocation"></span><h3><a class="toc-backref" href="#id13">The <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> and <tt class="docutils literal"><span class="pre">SourceManager</span></tt> classes</a><a class="headerlink" href="#the-sourcelocation-and-sourcemanager-classes" title="Permalink to this headline">¶</a></h3>
+<p>Strangely enough, the <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> class represents a location within the
+source code of the program.  Important design points include:</p>
+<ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">sizeof(SourceLocation)</span></tt> must be extremely small, as these are embedded
+into many AST nodes and are passed around often.  Currently it is 32 bits.</li>
+<li><tt class="docutils literal"><span class="pre">SourceLocation</span></tt> must be a simple value object that can be efficiently
+copied.</li>
+<li>We should be able to represent a source location for any byte of any input
+file.  This includes in the middle of tokens, in whitespace, in trigraphs,
+etc.</li>
+<li>A <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> must encode the current <tt class="docutils literal"><span class="pre">#include</span></tt> stack that was
+active when the location was processed.  For example, if the location
+corresponds to a token, it should contain the set of <tt class="docutils literal"><span class="pre">#include</span></tt>s active
+when the token was lexed.  This allows us to print the <tt class="docutils literal"><span class="pre">#include</span></tt> stack
+for a diagnostic.</li>
+<li><tt class="docutils literal"><span class="pre">SourceLocation</span></tt> must be able to describe macro expansions, capturing both
+the ultimate instantiation point and the source of the original character
+data.</li>
+</ol>
+<p>In practice, the <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> works together with the <tt class="docutils literal"><span class="pre">SourceManager</span></tt>
+class to encode two pieces of information about a location: its spelling
+location and its instantiation location.  For most tokens, these will be the
+same.  However, for a macro expansion (or tokens that came from a <tt class="docutils literal"><span class="pre">_Pragma</span></tt>
+directive) these will describe the location of the characters corresponding to
+the token and the location where the token was used (i.e., the macro
+instantiation point or the location of the <tt class="docutils literal"><span class="pre">_Pragma</span></tt> itself).</p>
+<p>The Clang front-end inherently depends on the location of a token being tracked
+correctly.  If it is ever incorrect, the front-end may get confused and die.
+The reason for this is that the notion of the “spelling” of a <tt class="docutils literal"><span class="pre">Token</span></tt> in
+Clang depends on being able to find the original input characters for the
+token.  This concept maps directly to the “spelling location” for the token.</p>
+</div>
+<div class="section" id="sourcerange-and-charsourcerange">
+<h3><a class="toc-backref" href="#id14"><tt class="docutils literal"><span class="pre">SourceRange</span></tt> and <tt class="docutils literal"><span class="pre">CharSourceRange</span></tt></a><a class="headerlink" href="#sourcerange-and-charsourcerange" title="Permalink to this headline">¶</a></h3>
+<p>Clang represents most source ranges by [first, last], where “first” and “last”
+each point to the beginning of their respective tokens.  For example consider
+the <tt class="docutils literal"><span class="pre">SourceRange</span></tt> of the following statement:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">x</span> <span class="o">=</span> <span class="n">foo</span> <span class="o">+</span> <span class="n">bar</span><span class="p">;</span>
+<span class="o">^</span><span class="n">first</span>    <span class="o">^</span><span class="n">last</span>
+</pre></div>
+</div>
+<p>To map from this representation to a character-based representation, the “last”
+location needs to be adjusted to point to (or past) the end of that token with
+either <tt class="docutils literal"><span class="pre">Lexer::MeasureTokenLength()</span></tt> or <tt class="docutils literal"><span class="pre">Lexer::getLocForEndOfToken()</span></tt>.  For
+the rare cases where character-level source ranges information is needed we use
+the <tt class="docutils literal"><span class="pre">CharSourceRange</span></tt> class.</p>
+</div>
+</div>
+<div class="section" id="the-driver-library">
+<h2><a class="toc-backref" href="#id15">The Driver Library</a><a class="headerlink" href="#the-driver-library" title="Permalink to this headline">¶</a></h2>
+<p>The clang Driver and library are documented <a class="reference internal" href="DriverInternals.html"><em>here</em></a>.</p>
+</div>
+<div class="section" id="precompiled-headers">
+<h2><a class="toc-backref" href="#id16">Precompiled Headers</a><a class="headerlink" href="#precompiled-headers" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports two implementations of precompiled headers.  The default
+implementation, precompiled headers (<a class="reference internal" href="PCHInternals.html"><em>PCH</em></a>) uses a
+serialized representation of Clang’s internal data structures, encoded with the
+<a class="reference external" href="http://llvm.org/docs/BitCodeFormat.html">LLVM bitstream format</a>.
+Pretokenized headers (<a class="reference internal" href="PTHInternals.html"><em>PTH</em></a>), on the other hand, contain a
+serialized representation of the tokens encountered when preprocessing a header
+(and anything that header includes).</p>
+</div>
+<div class="section" id="the-frontend-library">
+<h2><a class="toc-backref" href="#id17">The Frontend Library</a><a class="headerlink" href="#the-frontend-library" title="Permalink to this headline">¶</a></h2>
+<p>The Frontend library contains functionality useful for building tools on top of
+the Clang libraries, for example several methods for outputting diagnostics.</p>
+</div>
+<div class="section" id="the-lexer-and-preprocessor-library">
+<h2><a class="toc-backref" href="#id18">The Lexer and Preprocessor Library</a><a class="headerlink" href="#the-lexer-and-preprocessor-library" title="Permalink to this headline">¶</a></h2>
+<p>The Lexer library contains several tightly-connected classes that are involved
+with the nasty process of lexing and preprocessing C source code.  The main
+interface to this library for outside clients is the large <tt class="docutils literal"><span class="pre">Preprocessor</span></tt>
+class.  It contains the various pieces of state that are required to coherently
+read tokens out of a translation unit.</p>
+<p>The core interface to the <tt class="docutils literal"><span class="pre">Preprocessor</span></tt> object (once it is set up) is the
+<tt class="docutils literal"><span class="pre">Preprocessor::Lex</span></tt> method, which returns the next <a class="reference internal" href="#token"><em>Token</em></a> from
+the preprocessor stream.  There are two types of token providers that the
+preprocessor is capable of reading from: a buffer lexer (provided by the
+<a class="reference internal" href="#lexer"><em>Lexer</em></a> class) and a buffered token stream (provided by the
+<a class="reference internal" href="#tokenlexer"><em>TokenLexer</em></a> class).</p>
+<div class="section" id="the-token-class">
+<span id="token"></span><h3><a class="toc-backref" href="#id19">The Token class</a><a class="headerlink" href="#the-token-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">Token</span></tt> class is used to represent a single lexed token.  Tokens are
+intended to be used by the lexer/preprocess and parser libraries, but are not
+intended to live beyond them (for example, they should not live in the ASTs).</p>
+<p>Tokens most often live on the stack (or some other location that is efficient
+to access) as the parser is running, but occasionally do get buffered up.  For
+example, macro definitions are stored as a series of tokens, and the C++
+front-end periodically needs to buffer tokens up for tentative parsing and
+various pieces of look-ahead.  As such, the size of a <tt class="docutils literal"><span class="pre">Token</span></tt> matters.  On a
+32-bit system, <tt class="docutils literal"><span class="pre">sizeof(Token)</span></tt> is currently 16 bytes.</p>
+<p>Tokens occur in two forms: <a class="reference internal" href="#annotationtoken"><em>annotation tokens</em></a> and
+normal tokens.  Normal tokens are those returned by the lexer, annotation
+tokens represent semantic information and are produced by the parser, replacing
+normal tokens in the token stream.  Normal tokens contain the following
+information:</p>
+<ul class="simple">
+<li><strong>A SourceLocation</strong> — This indicates the location of the start of the
+token.</li>
+<li><strong>A length</strong> — This stores the length of the token as stored in the
+<tt class="docutils literal"><span class="pre">SourceBuffer</span></tt>.  For tokens that include them, this length includes
+trigraphs and escaped newlines which are ignored by later phases of the
+compiler.  By pointing into the original source buffer, it is always possible
+to get the original spelling of a token completely accurately.</li>
+<li><strong>IdentifierInfo</strong> — If a token takes the form of an identifier, and if
+identifier lookup was enabled when the token was lexed (e.g., the lexer was
+not reading in “raw” mode) this contains a pointer to the unique hash value
+for the identifier.  Because the lookup happens before keyword
+identification, this field is set even for language keywords like “<tt class="docutils literal"><span class="pre">for</span></tt>”.</li>
+<li><strong>TokenKind</strong> — This indicates the kind of token as classified by the
+lexer.  This includes things like <tt class="docutils literal"><span class="pre">tok::starequal</span></tt> (for the “<tt class="docutils literal"><span class="pre">*=</span></tt>”
+operator), <tt class="docutils literal"><span class="pre">tok::ampamp</span></tt> for the “<tt class="docutils literal"><span class="pre">&&</span></tt>” token, and keyword values (e.g.,
+<tt class="docutils literal"><span class="pre">tok::kw_for</span></tt>) for identifiers that correspond to keywords.  Note that
+some tokens can be spelled multiple ways.  For example, C++ supports
+“operator keywords”, where things like “<tt class="docutils literal"><span class="pre">and</span></tt>” are treated exactly like the
+“<tt class="docutils literal"><span class="pre">&&</span></tt>” operator.  In these cases, the kind value is set to <tt class="docutils literal"><span class="pre">tok::ampamp</span></tt>,
+which is good for the parser, which doesn’t have to consider both forms.  For
+something that cares about which form is used (e.g., the preprocessor
+“stringize” operator) the spelling indicates the original form.</li>
+<li><strong>Flags</strong> — There are currently four flags tracked by the
+lexer/preprocessor system on a per-token basis:<ol class="arabic">
+<li><strong>StartOfLine</strong> — This was the first token that occurred on its input
+source line.</li>
+<li><strong>LeadingSpace</strong> — There was a space character either immediately before
+the token or transitively before the token as it was expanded through a
+macro.  The definition of this flag is very closely defined by the
+stringizing requirements of the preprocessor.</li>
+<li><strong>DisableExpand</strong> — This flag is used internally to the preprocessor to
+represent identifier tokens which have macro expansion disabled.  This
+prevents them from being considered as candidates for macro expansion ever
+in the future.</li>
+<li><strong>NeedsCleaning</strong> — This flag is set if the original spelling for the
+token includes a trigraph or escaped newline.  Since this is uncommon,
+many pieces of code can fast-path on tokens that did not need cleaning.</li>
+</ol>
+</li>
+</ul>
+<p>One interesting (and somewhat unusual) aspect of normal tokens is that they
+don’t contain any semantic information about the lexed value.  For example, if
+the token was a pp-number token, we do not represent the value of the number
+that was lexed (this is left for later pieces of code to decide).
+Additionally, the lexer library has no notion of typedef names vs variable
+names: both are returned as identifiers, and the parser is left to decide
+whether a specific identifier is a typedef or a variable (tracking this
+requires scope information among other things).  The parser can do this
+translation by replacing tokens returned by the preprocessor with “Annotation
+Tokens”.</p>
+</div>
+<div class="section" id="annotation-tokens">
+<span id="annotationtoken"></span><h3><a class="toc-backref" href="#id20">Annotation Tokens</a><a class="headerlink" href="#annotation-tokens" title="Permalink to this headline">¶</a></h3>
+<p>Annotation tokens are tokens that are synthesized by the parser and injected
+into the preprocessor’s token stream (replacing existing tokens) to record
+semantic information found by the parser.  For example, if “<tt class="docutils literal"><span class="pre">foo</span></tt>” is found
+to be a typedef, the “<tt class="docutils literal"><span class="pre">foo</span></tt>” <tt class="docutils literal"><span class="pre">tok::identifier</span></tt> token is replaced with an
+<tt class="docutils literal"><span class="pre">tok::annot_typename</span></tt>.  This is useful for a couple of reasons: 1) this makes
+it easy to handle qualified type names (e.g., “<tt class="docutils literal"><span class="pre">foo::bar::baz<42>::t</span></tt>”) in
+C++ as a single “token” in the parser.  2) if the parser backtracks, the
+reparse does not need to redo semantic analysis to determine whether a token
+sequence is a variable, type, template, etc.</p>
+<p>Annotation tokens are created by the parser and reinjected into the parser’s
+token stream (when backtracking is enabled).  Because they can only exist in
+tokens that the preprocessor-proper is done with, it doesn’t need to keep
+around flags like “start of line” that the preprocessor uses to do its job.
+Additionally, an annotation token may “cover” a sequence of preprocessor tokens
+(e.g., “<tt class="docutils literal"><span class="pre">a::b::c</span></tt>” is five preprocessor tokens).  As such, the valid fields
+of an annotation token are different than the fields for a normal token (but
+they are multiplexed into the normal <tt class="docutils literal"><span class="pre">Token</span></tt> fields):</p>
+<ul class="simple">
+<li><strong>SourceLocation “Location”</strong> — The <tt class="docutils literal"><span class="pre">SourceLocation</span></tt> for the annotation
+token indicates the first token replaced by the annotation token.  In the
+example above, it would be the location of the “<tt class="docutils literal"><span class="pre">a</span></tt>” identifier.</li>
+<li><strong>SourceLocation “AnnotationEndLoc”</strong> — This holds the location of the last
+token replaced with the annotation token.  In the example above, it would be
+the location of the “<tt class="docutils literal"><span class="pre">c</span></tt>” identifier.</li>
+<li><strong>void* “AnnotationValue”</strong> — This contains an opaque object that the
+parser gets from <tt class="docutils literal"><span class="pre">Sema</span></tt>.  The parser merely preserves the information for
+<tt class="docutils literal"><span class="pre">Sema</span></tt> to later interpret based on the annotation token kind.</li>
+<li><strong>TokenKind “Kind”</strong> — This indicates the kind of Annotation token this is.
+See below for the different valid kinds.</li>
+</ul>
+<p>Annotation tokens currently come in three kinds:</p>
+<ol class="arabic simple">
+<li><strong>tok::annot_typename</strong>: This annotation token represents a resolved
+typename token that is potentially qualified.  The <tt class="docutils literal"><span class="pre">AnnotationValue</span></tt> field
+contains the <tt class="docutils literal"><span class="pre">QualType</span></tt> returned by <tt class="docutils literal"><span class="pre">Sema::getTypeName()</span></tt>, possibly with
+source location information attached.</li>
+<li><strong>tok::annot_cxxscope</strong>: This annotation token represents a C++ scope
+specifier, such as “<tt class="docutils literal"><span class="pre">A::B::</span></tt>”.  This corresponds to the grammar
+productions “<em>::</em>” and “<em>:: [opt] nested-name-specifier</em>”.  The
+<tt class="docutils literal"><span class="pre">AnnotationValue</span></tt> pointer is a <tt class="docutils literal"><span class="pre">NestedNameSpecifier</span> <span class="pre">*</span></tt> returned by the
+<tt class="docutils literal"><span class="pre">Sema::ActOnCXXGlobalScopeSpecifier</span></tt> and
+<tt class="docutils literal"><span class="pre">Sema::ActOnCXXNestedNameSpecifier</span></tt> callbacks.</li>
+<li><strong>tok::annot_template_id</strong>: This annotation token represents a C++
+template-id such as “<tt class="docutils literal"><span class="pre">foo<int,</span> <span class="pre">4></span></tt>”, where “<tt class="docutils literal"><span class="pre">foo</span></tt>” is the name of a
+template.  The <tt class="docutils literal"><span class="pre">AnnotationValue</span></tt> pointer is a pointer to a <tt class="docutils literal"><span class="pre">malloc</span></tt>‘d
+<tt class="docutils literal"><span class="pre">TemplateIdAnnotation</span></tt> object.  Depending on the context, a parsed
+template-id that names a type might become a typename annotation token (if
+all we care about is the named type, e.g., because it occurs in a type
+specifier) or might remain a template-id token (if we want to retain more
+source location information or produce a new type, e.g., in a declaration of
+a class template specialization).  template-id annotation tokens that refer
+to a type can be “upgraded” to typename annotation tokens by the parser.</li>
+</ol>
+<p>As mentioned above, annotation tokens are not returned by the preprocessor,
+they are formed on demand by the parser.  This means that the parser has to be
+aware of cases where an annotation could occur and form it where appropriate.
+This is somewhat similar to how the parser handles Translation Phase 6 of C99:
+String Concatenation (see C99 5.1.1.2).  In the case of string concatenation,
+the preprocessor just returns distinct <tt class="docutils literal"><span class="pre">tok::string_literal</span></tt> and
+<tt class="docutils literal"><span class="pre">tok::wide_string_literal</span></tt> tokens and the parser eats a sequence of them
+wherever the grammar indicates that a string literal can occur.</p>
+<p>In order to do this, whenever the parser expects a <tt class="docutils literal"><span class="pre">tok::identifier</span></tt> or
+<tt class="docutils literal"><span class="pre">tok::coloncolon</span></tt>, it should call the <tt class="docutils literal"><span class="pre">TryAnnotateTypeOrScopeToken</span></tt> or
+<tt class="docutils literal"><span class="pre">TryAnnotateCXXScopeToken</span></tt> methods to form the annotation token.  These
+methods will maximally form the specified annotation tokens and replace the
+current token with them, if applicable.  If the current tokens is not valid for
+an annotation token, it will remain an identifier or “<tt class="docutils literal"><span class="pre">::</span></tt>” token.</p>
+</div>
+<div class="section" id="the-lexer-class">
+<span id="lexer"></span><h3><a class="toc-backref" href="#id21">The <tt class="docutils literal"><span class="pre">Lexer</span></tt> class</a><a class="headerlink" href="#the-lexer-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> class provides the mechanics of lexing tokens out of a source
+buffer and deciding what they mean.  The <tt class="docutils literal"><span class="pre">Lexer</span></tt> is complicated by the fact
+that it operates on raw buffers that have not had spelling eliminated (this is
+a necessity to get decent performance), but this is countered with careful
+coding as well as standard performance techniques (for example, the comment
+handling code is vectorized on X86 and PowerPC hosts).</p>
+<p>The lexer has a couple of interesting modal features:</p>
+<ul class="simple">
+<li>The lexer can operate in “raw” mode.  This mode has several features that
+make it possible to quickly lex the file (e.g., it stops identifier lookup,
+doesn’t specially handle preprocessor tokens, handles EOF differently, etc).
+This mode is used for lexing within an “<tt class="docutils literal"><span class="pre">#if</span> <span class="pre">0</span></tt>” block, for example.</li>
+<li>The lexer can capture and return comments as tokens.  This is required to
+support the <tt class="docutils literal"><span class="pre">-C</span></tt> preprocessor mode, which passes comments through, and is
+used by the diagnostic checker to identifier expect-error annotations.</li>
+<li>The lexer can be in <tt class="docutils literal"><span class="pre">ParsingFilename</span></tt> mode, which happens when
+preprocessing after reading a <tt class="docutils literal"><span class="pre">#include</span></tt> directive.  This mode changes the
+parsing of “<tt class="docutils literal"><span class="pre"><</span></tt>” to return an “angled string” instead of a bunch of tokens
+for each thing within the filename.</li>
+<li>When parsing a preprocessor directive (after “<tt class="docutils literal"><span class="pre">#</span></tt>”) the
+<tt class="docutils literal"><span class="pre">ParsingPreprocessorDirective</span></tt> mode is entered.  This changes the parser to
+return EOD at a newline.</li>
+<li>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> uses a <tt class="docutils literal"><span class="pre">LangOptions</span></tt> object to know whether trigraphs are
+enabled, whether C++ or ObjC keywords are recognized, etc.</li>
+</ul>
+<p>In addition to these modes, the lexer keeps track of a couple of other features
+that are local to a lexed buffer, which change as the buffer is lexed:</p>
+<ul class="simple">
+<li>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> uses <tt class="docutils literal"><span class="pre">BufferPtr</span></tt> to keep track of the current character being
+lexed.</li>
+<li>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> uses <tt class="docutils literal"><span class="pre">IsAtStartOfLine</span></tt> to keep track of whether the next
+lexed token will start with its “start of line” bit set.</li>
+<li>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> keeps track of the current “<tt class="docutils literal"><span class="pre">#if</span></tt>” directives that are active
+(which can be nested).</li>
+<li>The <tt class="docutils literal"><span class="pre">Lexer</span></tt> keeps track of an <a class="reference internal" href="#multipleincludeopt"><em>MultipleIncludeOpt</em></a> object, which is used to detect whether the buffer uses
+the standard “<tt class="docutils literal"><span class="pre">#ifndef</span> <span class="pre">XX</span></tt> / <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">XX</span></tt>” idiom to prevent multiple
+inclusion.  If a buffer does, subsequent includes can be ignored if the
+“<tt class="docutils literal"><span class="pre">XX</span></tt>” macro is defined.</li>
+</ul>
+</div>
+<div class="section" id="the-tokenlexer-class">
+<span id="tokenlexer"></span><h3><a class="toc-backref" href="#id22">The <tt class="docutils literal"><span class="pre">TokenLexer</span></tt> class</a><a class="headerlink" href="#the-tokenlexer-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">TokenLexer</span></tt> class is a token provider that returns tokens from a list of
+tokens that came from somewhere else.  It typically used for two things: 1)
+returning tokens from a macro definition as it is being expanded 2) returning
+tokens from an arbitrary buffer of tokens.  The later use is used by
+<tt class="docutils literal"><span class="pre">_Pragma</span></tt> and will most likely be used to handle unbounded look-ahead for the
+C++ parser.</p>
+</div>
+<div class="section" id="the-multipleincludeopt-class">
+<span id="multipleincludeopt"></span><h3><a class="toc-backref" href="#id23">The <tt class="docutils literal"><span class="pre">MultipleIncludeOpt</span></tt> class</a><a class="headerlink" href="#the-multipleincludeopt-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">MultipleIncludeOpt</span></tt> class implements a really simple little state
+machine that is used to detect the standard “<tt class="docutils literal"><span class="pre">#ifndef</span> <span class="pre">XX</span></tt> / <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">XX</span></tt>”
+idiom that people typically use to prevent multiple inclusion of headers.  If a
+buffer uses this idiom and is subsequently <tt class="docutils literal"><span class="pre">#include</span></tt>‘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.</p>
+</div>
+</div>
+<div class="section" id="the-parser-library">
+<h2><a class="toc-backref" href="#id24">The Parser Library</a><a class="headerlink" href="#the-parser-library" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="the-ast-library">
+<h2><a class="toc-backref" href="#id25">The AST Library</a><a class="headerlink" href="#the-ast-library" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="the-type-class-and-its-subclasses">
+<span id="type"></span><h3><a class="toc-backref" href="#id26">The <tt class="docutils literal"><span class="pre">Type</span></tt> class and its subclasses</a><a class="headerlink" href="#the-type-class-and-its-subclasses" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">Type</span></tt> class (and its subclasses) are an important part of the AST.
+Types are accessed through the <tt class="docutils literal"><span class="pre">ASTContext</span></tt> class, which implicitly creates
+and uniques them as they are needed.  Types have a couple of non-obvious
+features: 1) they do not capture type qualifiers like <tt class="docutils literal"><span class="pre">const</span></tt> or <tt class="docutils literal"><span class="pre">volatile</span></tt>
+(see <a class="reference internal" href="#qualtype"><em>QualType</em></a>), and 2) they implicitly capture typedef
+information.  Once created, types are immutable (unlike decls).</p>
+<p>Typedefs in C make semantic analysis a bit more complex than it would be without
+them.  The issue is that we want to capture typedef information and represent it
+in the AST perfectly, but the semantics of operations need to “see through”
+typedefs.  For example, consider this code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">func</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">typedef</span> <span class="kt">int</span> <span class="n">foo</span><span class="p">;</span>
+  <span class="n">foo</span> <span class="n">X</span><span class="p">,</span> <span class="o">*</span><span class="n">Y</span><span class="p">;</span>
+  <span class="k">typedef</span> <span class="n">foo</span> <span class="o">*</span><span class="n">bar</span><span class="p">;</span>
+  <span class="n">bar</span> <span class="n">Z</span><span class="p">;</span>
+  <span class="o">*</span><span class="n">X</span><span class="p">;</span> <span class="c1">// error</span>
+  <span class="o">**</span><span class="n">Y</span><span class="p">;</span> <span class="c1">// error</span>
+  <span class="o">**</span><span class="n">Z</span><span class="p">;</span> <span class="c1">// error</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The code above is illegal, and thus we expect there to be diagnostics emitted
+on the annotated lines.  In this example, we expect to get:</p>
+<div class="highlight-c++"><pre>test.c:6:1: error: indirection requires pointer operand ('foo' invalid)
+  *X; // error
+  ^~
+test.c:7:1: error: indirection requires pointer operand ('foo' invalid)
+  **Y; // error
+  ^~~
+test.c:8:1: error: indirection requires pointer operand ('foo' invalid)
+  **Z; // error
+  ^~~</pre>
+</div>
+<p>While this example is somewhat silly, it illustrates the point: we want to
+retain typedef information where possible, so that we can emit errors about
+“<tt class="docutils literal"><span class="pre">std::string</span></tt>” instead of “<tt class="docutils literal"><span class="pre">std::basic_string<char,</span> <span class="pre">std:...</span></tt>”.  Doing this
+requires properly keeping typedef information (for example, the type of <tt class="docutils literal"><span class="pre">X</span></tt>
+is “<tt class="docutils literal"><span class="pre">foo</span></tt>”, not “<tt class="docutils literal"><span class="pre">int</span></tt>”), and requires properly propagating it through the
+various operators (for example, the type of <tt class="docutils literal"><span class="pre">*Y</span></tt> is “<tt class="docutils literal"><span class="pre">foo</span></tt>”, not
+“<tt class="docutils literal"><span class="pre">int</span></tt>”).  In order to retain this information, the type of these expressions
+is an instance of the <tt class="docutils literal"><span class="pre">TypedefType</span></tt> class, which indicates that the type of
+these expressions is a typedef for “<tt class="docutils literal"><span class="pre">foo</span></tt>”.</p>
+<p>Representing types like this is great for diagnostics, because the
+user-specified type is always immediately available.  There are two problems
+with this: first, various semantic checks need to make judgements about the
+<em>actual structure</em> of a type, ignoring typedefs.  Second, we need an efficient
+way to query whether two types are structurally identical to each other,
+ignoring typedefs.  The solution to both of these problems is the idea of
+canonical types.</p>
+<div class="section" id="canonical-types">
+<h4><a class="toc-backref" href="#id27">Canonical Types</a><a class="headerlink" href="#canonical-types" title="Permalink to this headline">¶</a></h4>
+<p>Every instance of the <tt class="docutils literal"><span class="pre">Type</span></tt> class contains a canonical type pointer.  For
+simple types with no typedefs involved (e.g., “<tt class="docutils literal"><span class="pre">int</span></tt>”, “<tt class="docutils literal"><span class="pre">int*</span></tt>”,
+“<tt class="docutils literal"><span class="pre">int**</span></tt>”), the type just points to itself.  For types that have a typedef
+somewhere in their structure (e.g., “<tt class="docutils literal"><span class="pre">foo</span></tt>”, “<tt class="docutils literal"><span class="pre">foo*</span></tt>”, “<tt class="docutils literal"><span class="pre">foo**</span></tt>”,
+“<tt class="docutils literal"><span class="pre">bar</span></tt>”), the canonical type pointer points to their structurally equivalent
+type without any typedefs (e.g., “<tt class="docutils literal"><span class="pre">int</span></tt>”, “<tt class="docutils literal"><span class="pre">int*</span></tt>”, “<tt class="docutils literal"><span class="pre">int**</span></tt>”, and
+“<tt class="docutils literal"><span class="pre">int*</span></tt>” respectively).</p>
+<p>This design provides a constant time operation (dereferencing the canonical type
+pointer) that gives us access to the structure of types.  For example, we can
+trivially tell that “<tt class="docutils literal"><span class="pre">bar</span></tt>” and “<tt class="docutils literal"><span class="pre">foo*</span></tt>” are the same type by dereferencing
+their canonical type pointers and doing a pointer comparison (they both point
+to the single “<tt class="docutils literal"><span class="pre">int*</span></tt>” type).</p>
+<p>Canonical types and typedef types bring up some complexities that must be
+carefully managed.  Specifically, the <tt class="docutils literal"><span class="pre">isa</span></tt>/<tt class="docutils literal"><span class="pre">cast</span></tt>/<tt class="docutils literal"><span class="pre">dyn_cast</span></tt> operators
+generally shouldn’t be used in code that is inspecting the AST.  For example,
+when type checking the indirection operator (unary “<tt class="docutils literal"><span class="pre">*</span></tt>” on a pointer), the
+type checker must verify that the operand has a pointer type.  It would not be
+correct to check that with “<tt class="docutils literal"><span class="pre">isa<PointerType>(SubExpr->getType())</span></tt>”, because
+this predicate would fail if the subexpression had a typedef type.</p>
+<p>The solution to this problem are a set of helper methods on <tt class="docutils literal"><span class="pre">Type</span></tt>, used to
+check their properties.  In this case, it would be correct to use
+“<tt class="docutils literal"><span class="pre">SubExpr->getType()->isPointerType()</span></tt>” to do the check.  This predicate will
+return true if the <em>canonical type is a pointer</em>, which is true any time the
+type is structurally a pointer type.  The only hard part here is remembering
+not to use the <tt class="docutils literal"><span class="pre">isa</span></tt>/<tt class="docutils literal"><span class="pre">cast</span></tt>/<tt class="docutils literal"><span class="pre">dyn_cast</span></tt> operations.</p>
+<p>The second problem we face is how to get access to the pointer type once we
+know it exists.  To continue the example, the result type of the indirection
+operator is the pointee type of the subexpression.  In order to determine the
+type, we need to get the instance of <tt class="docutils literal"><span class="pre">PointerType</span></tt> that best captures the
+typedef information in the program.  If the type of the expression is literally
+a <tt class="docutils literal"><span class="pre">PointerType</span></tt>, we can return that, otherwise we have to dig through the
+typedefs to find the pointer type.  For example, if the subexpression had type
+“<tt class="docutils literal"><span class="pre">foo*</span></tt>”, we could return that type as the result.  If the subexpression had
+type “<tt class="docutils literal"><span class="pre">bar</span></tt>”, we want to return “<tt class="docutils literal"><span class="pre">foo*</span></tt>” (note that we do <em>not</em> want
+“<tt class="docutils literal"><span class="pre">int*</span></tt>”).  In order to provide all of this, <tt class="docutils literal"><span class="pre">Type</span></tt> has a
+<tt class="docutils literal"><span class="pre">getAsPointerType()</span></tt> method that checks whether the type is structurally a
+<tt class="docutils literal"><span class="pre">PointerType</span></tt> and, if so, returns the best one.  If not, it returns a null
+pointer.</p>
+<p>This structure is somewhat mystical, but after meditating on it, it will make
+sense to you :).</p>
+</div>
+</div>
+<div class="section" id="the-qualtype-class">
+<span id="qualtype"></span><h3><a class="toc-backref" href="#id28">The <tt class="docutils literal"><span class="pre">QualType</span></tt> class</a><a class="headerlink" href="#the-qualtype-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">QualType</span></tt> class is designed as a trivial value class that is small,
+passed by-value and is efficient to query.  The idea of <tt class="docutils literal"><span class="pre">QualType</span></tt> is that it
+stores the type qualifiers (<tt class="docutils literal"><span class="pre">const</span></tt>, <tt class="docutils literal"><span class="pre">volatile</span></tt>, <tt class="docutils literal"><span class="pre">restrict</span></tt>, plus some
+extended qualifiers required by language extensions) separately from the types
+themselves.  <tt class="docutils literal"><span class="pre">QualType</span></tt> is conceptually a pair of “<tt class="docutils literal"><span class="pre">Type*</span></tt>” and the bits
+for these type qualifiers.</p>
+<p>By storing the type qualifiers as bits in the conceptual pair, it is extremely
+efficient to get the set of qualifiers on a <tt class="docutils literal"><span class="pre">QualType</span></tt> (just return the field
+of the pair), add a type qualifier (which is a trivial constant-time operation
+that sets a bit), and remove one or more type qualifiers (just return a
+<tt class="docutils literal"><span class="pre">QualType</span></tt> with the bitfield set to empty).</p>
+<p>Further, because the bits are stored outside of the type itself, we do not need
+to create duplicates of types with different sets of qualifiers (i.e. there is
+only a single heap allocated “<tt class="docutils literal"><span class="pre">int</span></tt>” type: “<tt class="docutils literal"><span class="pre">const</span> <span class="pre">int</span></tt>” and “<tt class="docutils literal"><span class="pre">volatile</span>
+<span class="pre">const</span> <span class="pre">int</span></tt>” both point to the same heap allocated “<tt class="docutils literal"><span class="pre">int</span></tt>” type).  This
+reduces the heap size used to represent bits and also means we do not have to
+consider qualifiers when uniquing types (<a class="reference internal" href="#type"><em>Type</em></a> does not even
+contain qualifiers).</p>
+<p>In practice, the two most common type qualifiers (<tt class="docutils literal"><span class="pre">const</span></tt> and <tt class="docutils literal"><span class="pre">restrict</span></tt>)
+are stored in the low bits of the pointer to the <tt class="docutils literal"><span class="pre">Type</span></tt> object, together with
+a flag indicating whether extended qualifiers are present (which must be
+heap-allocated).  This means that <tt class="docutils literal"><span class="pre">QualType</span></tt> is exactly the same size as a
+pointer.</p>
+</div>
+<div class="section" id="declaration-names">
+<span id="declarationname"></span><h3><a class="toc-backref" href="#id29">Declaration names</a><a class="headerlink" href="#declaration-names" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> class represents the name of a declaration in Clang.
+Declarations in the C family of languages can take several different forms.
+Most declarations are named by simple identifiers, e.g., “<tt class="docutils literal"><span class="pre">f</span></tt>” and “<tt class="docutils literal"><span class="pre">x</span></tt>” in
+the function declaration <tt class="docutils literal"><span class="pre">f(int</span> <span class="pre">x)</span></tt>.  In C++, declaration names can also name
+class constructors (“<tt class="docutils literal"><span class="pre">Class</span></tt>” in <tt class="docutils literal"><span class="pre">struct</span> <span class="pre">Class</span> <span class="pre">{</span> <span class="pre">Class();</span> <span class="pre">}</span></tt>), class
+destructors (“<tt class="docutils literal"><span class="pre">~Class</span></tt>”), overloaded operator names (“<tt class="docutils literal"><span class="pre">operator+</span></tt>”), and
+conversion functions (“<tt class="docutils literal"><span class="pre">operator</span> <span class="pre">void</span> <span class="pre">const</span> <span class="pre">*</span></tt>”).  In Objective-C,
+declaration names can refer to the names of Objective-C methods, which involve
+the method name and the parameters, collectively called a <em>selector</em>, e.g.,
+“<tt class="docutils literal"><span class="pre">setWidth:height:</span></tt>”.  Since all of these kinds of entities — variables,
+functions, Objective-C methods, C++ constructors, destructors, and operators
+— are represented as subclasses of Clang’s common <tt class="docutils literal"><span class="pre">NamedDecl</span></tt> class,
+<tt class="docutils literal"><span class="pre">DeclarationName</span></tt> is designed to efficiently represent any kind of name.</p>
+<p>Given a <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> <tt class="docutils literal"><span class="pre">N</span></tt>, <tt class="docutils literal"><span class="pre">N.getNameKind()</span></tt> will produce a value
+that describes what kind of name <tt class="docutils literal"><span class="pre">N</span></tt> stores.  There are 10 options (all of
+the names are inside the <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> class).</p>
+<p><tt class="docutils literal"><span class="pre">Identifier</span></tt></p>
+<blockquote>
+<div>The name is a simple identifier.  Use <tt class="docutils literal"><span class="pre">N.getAsIdentifierInfo()</span></tt> to retrieve
+the corresponding <tt class="docutils literal"><span class="pre">IdentifierInfo*</span></tt> pointing to the actual identifier.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">ObjCZeroArgSelector</span></tt>, <tt class="docutils literal"><span class="pre">ObjCOneArgSelector</span></tt>, <tt class="docutils literal"><span class="pre">ObjCMultiArgSelector</span></tt></p>
+<blockquote>
+<div>The name is an Objective-C selector, which can be retrieved as a <tt class="docutils literal"><span class="pre">Selector</span></tt>
+instance via <tt class="docutils literal"><span class="pre">N.getObjCSelector()</span></tt>.  The three possible name kinds for
+Objective-C reflect an optimization within the <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> class:
+both zero- and one-argument selectors are stored as a masked
+<tt class="docutils literal"><span class="pre">IdentifierInfo</span></tt> pointer, and therefore require very little space, since
+zero- and one-argument selectors are far more common than multi-argument
+selectors (which use a different structure).</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXConstructorName</span></tt></p>
+<blockquote>
+<div>The name is a C++ constructor name.  Use <tt class="docutils literal"><span class="pre">N.getCXXNameType()</span></tt> to retrieve
+the <a class="reference internal" href="#qualtype"><em>type</em></a> that this constructor is meant to construct.  The
+type is always the canonical type, since all constructors for a given type
+have the same name.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXDestructorName</span></tt></p>
+<blockquote>
+<div>The name is a C++ destructor name.  Use <tt class="docutils literal"><span class="pre">N.getCXXNameType()</span></tt> to retrieve
+the <a class="reference internal" href="#qualtype"><em>type</em></a> whose destructor is being named.  This type is
+always a canonical type.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXConversionFunctionName</span></tt></p>
+<blockquote>
+<div>The name is a C++ conversion function.  Conversion functions are named
+according to the type they convert to, e.g., “<tt class="docutils literal"><span class="pre">operator</span> <span class="pre">void</span> <span class="pre">const</span> <span class="pre">*</span></tt>”.
+Use <tt class="docutils literal"><span class="pre">N.getCXXNameType()</span></tt> to retrieve the type that this conversion function
+converts to.  This type is always a canonical type.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXOperatorName</span></tt></p>
+<blockquote>
+<div>The name is a C++ overloaded operator name.  Overloaded operators are named
+according to their spelling, e.g., “<tt class="docutils literal"><span class="pre">operator+</span></tt>” or “<tt class="docutils literal"><span class="pre">operator</span> <span class="pre">new</span> <span class="pre">[]</span></tt>”.
+Use <tt class="docutils literal"><span class="pre">N.getCXXOverloadedOperator()</span></tt> to retrieve the overloaded operator (a
+value of type <tt class="docutils literal"><span class="pre">OverloadedOperatorKind</span></tt>).</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXLiteralOperatorName</span></tt></p>
+<blockquote>
+<div>The name is a C++11 user defined literal operator.  User defined
+Literal operators are named according to the suffix they define,
+e.g., “<tt class="docutils literal"><span class="pre">_foo</span></tt>” for “<tt class="docutils literal"><span class="pre">operator</span> <span class="pre">""</span> <span class="pre">_foo</span></tt>”.  Use
+<tt class="docutils literal"><span class="pre">N.getCXXLiteralIdentifier()</span></tt> to retrieve the corresponding
+<tt class="docutils literal"><span class="pre">IdentifierInfo*</span></tt> pointing to the identifier.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">CXXUsingDirective</span></tt></p>
+<blockquote>
+<div>The name is a C++ using directive.  Using directives are not really
+NamedDecls, in that they all have the same name, but they are
+implemented as such in order to store them in DeclContext
+effectively.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">DeclarationName</span></tt>s are cheap to create, copy, and compare.  They require
+only a single pointer’s worth of storage in the common cases (identifiers,
+zero- and one-argument Objective-C selectors) and use dense, uniqued storage
+for the other kinds of names.  Two <tt class="docutils literal"><span class="pre">DeclarationName</span></tt>s can be compared for
+equality (<tt class="docutils literal"><span class="pre">==</span></tt>, <tt class="docutils literal"><span class="pre">!=</span></tt>) using a simple bitwise comparison, can be ordered
+with <tt class="docutils literal"><span class="pre"><</span></tt>, <tt class="docutils literal"><span class="pre">></span></tt>, <tt class="docutils literal"><span class="pre"><=</span></tt>, and <tt class="docutils literal"><span class="pre">>=</span></tt> (which provide a lexicographical ordering
+for normal identifiers but an unspecified ordering for other kinds of names),
+and can be placed into LLVM <tt class="docutils literal"><span class="pre">DenseMap</span></tt>s and <tt class="docutils literal"><span class="pre">DenseSet</span></tt>s.</p>
+<p><tt class="docutils literal"><span class="pre">DeclarationName</span></tt> instances can be created in different ways depending on
+what kind of name the instance will store.  Normal identifiers
+(<tt class="docutils literal"><span class="pre">IdentifierInfo</span></tt> pointers) and Objective-C selectors (<tt class="docutils literal"><span class="pre">Selector</span></tt>) can be
+implicitly converted to <tt class="docutils literal"><span class="pre">DeclarationNames</span></tt>.  Names for C++ constructors,
+destructors, conversion functions, and overloaded operators can be retrieved
+from the <tt class="docutils literal"><span class="pre">DeclarationNameTable</span></tt>, an instance of which is available as
+<tt class="docutils literal"><span class="pre">ASTContext::DeclarationNames</span></tt>.  The member functions
+<tt class="docutils literal"><span class="pre">getCXXConstructorName</span></tt>, <tt class="docutils literal"><span class="pre">getCXXDestructorName</span></tt>,
+<tt class="docutils literal"><span class="pre">getCXXConversionFunctionName</span></tt>, and <tt class="docutils literal"><span class="pre">getCXXOperatorName</span></tt>, respectively,
+return <tt class="docutils literal"><span class="pre">DeclarationName</span></tt> instances for the four kinds of C++ special function
+names.</p>
+</div>
+<div class="section" id="declaration-contexts">
+<span id="declcontext"></span><h3><a class="toc-backref" href="#id30">Declaration contexts</a><a class="headerlink" href="#declaration-contexts" title="Permalink to this headline">¶</a></h3>
+<p>Every declaration in a program exists within some <em>declaration context</em>, such
+as a translation unit, namespace, class, or function.  Declaration contexts in
+Clang are represented by the <tt class="docutils literal"><span class="pre">DeclContext</span></tt> class, from which the various
+declaration-context AST nodes (<tt class="docutils literal"><span class="pre">TranslationUnitDecl</span></tt>, <tt class="docutils literal"><span class="pre">NamespaceDecl</span></tt>,
+<tt class="docutils literal"><span class="pre">RecordDecl</span></tt>, <tt class="docutils literal"><span class="pre">FunctionDecl</span></tt>, etc.) will derive.  The <tt class="docutils literal"><span class="pre">DeclContext</span></tt> class
+provides several facilities common to each declaration context:</p>
+<p>Source-centric vs. Semantics-centric View of Declarations</p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">DeclContext</span></tt> provides two views of the declarations stored within a
+declaration context.  The source-centric view accurately represents the
+program source code as written, including multiple declarations of entities
+where present (see the section <a class="reference internal" href="#redeclarations"><em>Redeclarations and Overloads</em></a>), while the semantics-centric view represents the program
+semantics.  The two views are kept synchronized by semantic analysis while
+the ASTs are being constructed.</div></blockquote>
+<p>Storage of declarations within that context</p>
+<blockquote>
+<div>Every declaration context can contain some number of declarations.  For
+example, a C++ class (represented by <tt class="docutils literal"><span class="pre">RecordDecl</span></tt>) contains various member
+functions, fields, nested types, and so on.  All of these declarations will
+be stored within the <tt class="docutils literal"><span class="pre">DeclContext</span></tt>, and one can iterate over the
+declarations via [<tt class="docutils literal"><span class="pre">DeclContext::decls_begin()</span></tt>,
+<tt class="docutils literal"><span class="pre">DeclContext::decls_end()</span></tt>).  This mechanism provides the source-centric
+view of declarations in the context.</div></blockquote>
+<p>Lookup of declarations within that context</p>
+<blockquote>
+<div>The <tt class="docutils literal"><span class="pre">DeclContext</span></tt> structure provides efficient name lookup for names within
+that declaration context.  For example, if <tt class="docutils literal"><span class="pre">N</span></tt> is a namespace we can look
+for the name <tt class="docutils literal"><span class="pre">N::f</span></tt> using <tt class="docutils literal"><span class="pre">DeclContext::lookup</span></tt>.  The lookup itself is
+based on a lazily-constructed array (for declaration contexts with a small
+number of declarations) or hash table (for declaration contexts with more
+declarations).  The lookup operation provides the semantics-centric view of
+the declarations in the context.</div></blockquote>
+<p>Ownership of declarations</p>
+<blockquote>
+<div>The <tt class="docutils literal"><span class="pre">DeclContext</span></tt> owns all of the declarations that were declared within
+its declaration context, and is responsible for the management of their
+memory as well as their (de-)serialization.</div></blockquote>
+<p>All declarations are stored within a declaration context, and one can query
+information about the context in which each declaration lives.  One can
+retrieve the <tt class="docutils literal"><span class="pre">DeclContext</span></tt> that contains a particular <tt class="docutils literal"><span class="pre">Decl</span></tt> using
+<tt class="docutils literal"><span class="pre">Decl::getDeclContext</span></tt>.  However, see the section
+<a class="reference internal" href="#lexicalandsemanticcontexts"><em>Lexical and Semantic Contexts</em></a> for more information about how to interpret
+this context information.</p>
+<div class="section" id="redeclarations-and-overloads">
+<span id="redeclarations"></span><h4><a class="toc-backref" href="#id31">Redeclarations and Overloads</a><a class="headerlink" href="#redeclarations-and-overloads" title="Permalink to this headline">¶</a></h4>
+<p>Within a translation unit, it is common for an entity to be declared several
+times.  For example, we might declare a function “<tt class="docutils literal"><span class="pre">f</span></tt>” and then later
+re-declare it as part of an inlined definition:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="n">z</span> <span class="o">=</span> <span class="mi">1</span><span class="p">);</span>
+
+<span class="kr">inline</span> <span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="n">z</span><span class="p">)</span> <span class="p">{</span> <span class="cm">/* ...  */</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>The representation of “<tt class="docutils literal"><span class="pre">f</span></tt>” differs in the source-centric and
+semantics-centric views of a declaration context.  In the source-centric view,
+all redeclarations will be present, in the order they occurred in the source
+code, making this view suitable for clients that wish to see the structure of
+the source code.  In the semantics-centric view, only the most recent “<tt class="docutils literal"><span class="pre">f</span></tt>”
+will be found by the lookup, since it effectively replaces the first
+declaration of “<tt class="docutils literal"><span class="pre">f</span></tt>”.</p>
+<p>In the semantics-centric view, overloading of functions is represented
+explicitly.  For example, given two declarations of a function “<tt class="docutils literal"><span class="pre">g</span></tt>” that are
+overloaded, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">g</span><span class="p">();</span>
+<span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>the <tt class="docutils literal"><span class="pre">DeclContext::lookup</span></tt> operation will return a
+<tt class="docutils literal"><span class="pre">DeclContext::lookup_result</span></tt> that contains a range of iterators over
+declarations of “<tt class="docutils literal"><span class="pre">g</span></tt>”.  Clients that perform semantic analysis on a program
+that is not concerned with the actual source code will primarily use this
+semantics-centric view.</p>
+</div>
+<div class="section" id="lexical-and-semantic-contexts">
+<span id="lexicalandsemanticcontexts"></span><h4><a class="toc-backref" href="#id32">Lexical and Semantic Contexts</a><a class="headerlink" href="#lexical-and-semantic-contexts" title="Permalink to this headline">¶</a></h4>
+<p>Each declaration has two potentially different declaration contexts: a
+<em>lexical</em> context, which corresponds to the source-centric view of the
+declaration context, and a <em>semantic</em> context, which corresponds to the
+semantics-centric view.  The lexical context is accessible via
+<tt class="docutils literal"><span class="pre">Decl::getLexicalDeclContext</span></tt> while the semantic context is accessible via
+<tt class="docutils literal"><span class="pre">Decl::getDeclContext</span></tt>, both of which return <tt class="docutils literal"><span class="pre">DeclContext</span></tt> pointers.  For
+most declarations, the two contexts are identical.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">class</span> <span class="nc">X</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">);</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Here, the semantic and lexical contexts of <tt class="docutils literal"><span class="pre">X::f</span></tt> are the <tt class="docutils literal"><span class="pre">DeclContext</span></tt>
+associated with the class <tt class="docutils literal"><span class="pre">X</span></tt> (itself stored as a <tt class="docutils literal"><span class="pre">RecordDecl</span></tt> AST node).
+However, we can now define <tt class="docutils literal"><span class="pre">X::f</span></tt> out-of-line:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="n">X</span><span class="o">::</span><span class="n">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">17</span><span class="p">)</span> <span class="p">{</span> <span class="cm">/* ...  */</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>This definition of “<tt class="docutils literal"><span class="pre">f</span></tt>” has different lexical and semantic contexts.  The
+lexical context corresponds to the declaration context in which the actual
+declaration occurred in the source code, e.g., the translation unit containing
+<tt class="docutils literal"><span class="pre">X</span></tt>.  Thus, this declaration of <tt class="docutils literal"><span class="pre">X::f</span></tt> can be found by traversing the
+declarations provided by [<tt class="docutils literal"><span class="pre">decls_begin()</span></tt>, <tt class="docutils literal"><span class="pre">decls_end()</span></tt>) in the
+translation unit.</p>
+<p>The semantic context of <tt class="docutils literal"><span class="pre">X::f</span></tt> corresponds to the class <tt class="docutils literal"><span class="pre">X</span></tt>, since this
+member function is (semantically) a member of <tt class="docutils literal"><span class="pre">X</span></tt>.  Lookup of the name <tt class="docutils literal"><span class="pre">f</span></tt>
+into the <tt class="docutils literal"><span class="pre">DeclContext</span></tt> associated with <tt class="docutils literal"><span class="pre">X</span></tt> will then return the definition
+of <tt class="docutils literal"><span class="pre">X::f</span></tt> (including information about the default argument).</p>
+</div>
+<div class="section" id="transparent-declaration-contexts">
+<h4><a class="toc-backref" href="#id33">Transparent Declaration Contexts</a><a class="headerlink" href="#transparent-declaration-contexts" title="Permalink to this headline">¶</a></h4>
+<p>In C and C++, there are several contexts in which names that are logically
+declared inside another declaration will actually “leak” out into the enclosing
+scope from the perspective of name lookup.  The most obvious instance of this
+behavior is in enumeration types, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">enum</span> <span class="n">Color</span> <span class="p">{</span>
+  <span class="n">Red</span><span class="p">,</span>
+  <span class="n">Green</span><span class="p">,</span>
+  <span class="n">Blue</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Here, <tt class="docutils literal"><span class="pre">Color</span></tt> is an enumeration, which is a declaration context that contains
+the enumerators <tt class="docutils literal"><span class="pre">Red</span></tt>, <tt class="docutils literal"><span class="pre">Green</span></tt>, and <tt class="docutils literal"><span class="pre">Blue</span></tt>.  Thus, traversing the list of
+declarations contained in the enumeration <tt class="docutils literal"><span class="pre">Color</span></tt> will yield <tt class="docutils literal"><span class="pre">Red</span></tt>,
+<tt class="docutils literal"><span class="pre">Green</span></tt>, and <tt class="docutils literal"><span class="pre">Blue</span></tt>.  However, outside of the scope of <tt class="docutils literal"><span class="pre">Color</span></tt> one can
+name the enumerator <tt class="docutils literal"><span class="pre">Red</span></tt> without qualifying the name, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Color</span> <span class="n">c</span> <span class="o">=</span> <span class="n">Red</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>There are other entities in C++ that provide similar behavior.  For example,
+linkage specifications that use curly braces:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">extern</span> <span class="s">"C"</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+  <span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="c1">// f and g are visible here</span>
+</pre></div>
+</div>
+<p>For source-level accuracy, we treat the linkage specification and enumeration
+type as a declaration context in which its enclosed declarations (“<tt class="docutils literal"><span class="pre">Red</span></tt>”,
+“<tt class="docutils literal"><span class="pre">Green</span></tt>”, and “<tt class="docutils literal"><span class="pre">Blue</span></tt>”; “<tt class="docutils literal"><span class="pre">f</span></tt>” and “<tt class="docutils literal"><span class="pre">g</span></tt>”) are declared.  However, these
+declarations are visible outside of the scope of the declaration context.</p>
+<p>These language features (and several others, described below) have roughly the
+same set of requirements: declarations are declared within a particular lexical
+context, but the declarations are also found via name lookup in scopes
+enclosing the declaration itself.  This feature is implemented via
+<em>transparent</em> declaration contexts (see
+<tt class="docutils literal"><span class="pre">DeclContext::isTransparentContext()</span></tt>), whose declarations are visible in the
+nearest enclosing non-transparent declaration context.  This means that the
+lexical context of the declaration (e.g., an enumerator) will be the
+transparent <tt class="docutils literal"><span class="pre">DeclContext</span></tt> itself, as will the semantic context, but the
+declaration will be visible in every outer context up to and including the
+first non-transparent declaration context (since transparent declaration
+contexts can be nested).</p>
+<p>The transparent <tt class="docutils literal"><span class="pre">DeclContext</span></tt>s are:</p>
+<ul>
+<li><p class="first">Enumerations (but not C++11 “scoped enumerations”):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">enum</span> <span class="n">Color</span> <span class="p">{</span>
+  <span class="n">Red</span><span class="p">,</span>
+  <span class="n">Green</span><span class="p">,</span>
+  <span class="n">Blue</span>
+<span class="p">};</span>
+<span class="c1">// Red, Green, and Blue are in scope</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">C++ linkage specifications:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">extern</span> <span class="s">"C"</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+  <span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="c1">// f and g are in scope</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Anonymous unions and structs:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">struct</span> <span class="n">LookupTable</span> <span class="p">{</span>
+  <span class="kt">bool</span> <span class="n">IsVector</span><span class="p">;</span>
+  <span class="k">union</span> <span class="p">{</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Item</span><span class="o">></span> <span class="o">*</span><span class="n">Vector</span><span class="p">;</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">set</span><span class="o"><</span><span class="n">Item</span><span class="o">></span> <span class="o">*</span><span class="n">Set</span><span class="p">;</span>
+  <span class="p">};</span>
+<span class="p">};</span>
+
+<span class="n">LookupTable</span> <span class="n">LT</span><span class="p">;</span>
+<span class="n">LT</span><span class="p">.</span><span class="n">Vector</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// Okay: finds Vector inside the unnamed union</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">C++11 inline namespaces:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">namespace</span> <span class="n">mylib</span> <span class="p">{</span>
+  <span class="kr">inline</span> <span class="k">namespace</span> <span class="n">debug</span> <span class="p">{</span>
+    <span class="k">class</span> <span class="nc">X</span><span class="p">;</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+<span class="n">mylib</span><span class="o">::</span><span class="n">X</span> <span class="o">*</span><span class="n">xp</span><span class="p">;</span> <span class="c1">// okay: mylib::X refers to mylib::debug::X</span>
+</pre></div>
+</div>
+</li>
+</ul>
+</div>
+<div class="section" id="multiply-defined-declaration-contexts">
+<span id="multideclcontext"></span><h4><a class="toc-backref" href="#id34">Multiply-Defined Declaration Contexts</a><a class="headerlink" href="#multiply-defined-declaration-contexts" title="Permalink to this headline">¶</a></h4>
+<p>C++ namespaces have the interesting — and, so far, unique — property that
+the namespace can be defined multiple times, and the declarations provided by
+each namespace definition are effectively merged (from the semantic point of
+view).  For example, the following two code snippets are semantically
+indistinguishable:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Snippet #1:</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">();</span>
+<span class="p">}</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">// Snippet #2:</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">();</span>
+  <span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In Clang’s representation, the source-centric view of declaration contexts will
+actually have two separate <tt class="docutils literal"><span class="pre">NamespaceDecl</span></tt> nodes in Snippet #1, each of which
+is a declaration context that contains a single declaration of “<tt class="docutils literal"><span class="pre">f</span></tt>”.
+However, the semantics-centric view provided by name lookup into the namespace
+<tt class="docutils literal"><span class="pre">N</span></tt> for “<tt class="docutils literal"><span class="pre">f</span></tt>” will return a <tt class="docutils literal"><span class="pre">DeclContext::lookup_result</span></tt> that contains a
+range of iterators over declarations of “<tt class="docutils literal"><span class="pre">f</span></tt>”.</p>
+<p><tt class="docutils literal"><span class="pre">DeclContext</span></tt> manages multiply-defined declaration contexts internally.  The
+function <tt class="docutils literal"><span class="pre">DeclContext::getPrimaryContext</span></tt> retrieves the “primary” context for
+a given <tt class="docutils literal"><span class="pre">DeclContext</span></tt> instance, which is the <tt class="docutils literal"><span class="pre">DeclContext</span></tt> responsible for
+maintaining the lookup table used for the semantics-centric view.  Given the
+primary context, one can follow the chain of <tt class="docutils literal"><span class="pre">DeclContext</span></tt> nodes that define
+additional declarations via <tt class="docutils literal"><span class="pre">DeclContext::getNextContext</span></tt>.  Note that these
+functions are used internally within the lookup and insertion methods of the
+<tt class="docutils literal"><span class="pre">DeclContext</span></tt>, so the vast majority of clients can ignore them.</p>
+</div>
+</div>
+<div class="section" id="the-cfg-class">
+<span id="cfg"></span><h3><a class="toc-backref" href="#id35">The <tt class="docutils literal"><span class="pre">CFG</span></tt> class</a><a class="headerlink" href="#the-cfg-class" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">CFG</span></tt> class is designed to represent a source-level control-flow graph
+for a single statement (<tt class="docutils literal"><span class="pre">Stmt*</span></tt>).  Typically instances of <tt class="docutils literal"><span class="pre">CFG</span></tt> are
+constructed for function bodies (usually an instance of <tt class="docutils literal"><span class="pre">CompoundStmt</span></tt>), but
+can also be instantiated to represent the control-flow of any class that
+subclasses <tt class="docutils literal"><span class="pre">Stmt</span></tt>, which includes simple expressions.  Control-flow graphs
+are especially useful for performing <a class="reference external" href="http://en.wikipedia.org/wiki/Data_flow_analysis#Sensitivities">flow- or path-sensitive</a> program
+analyses on a given function.</p>
+<div class="section" id="basic-blocks">
+<h4><a class="toc-backref" href="#id36">Basic Blocks</a><a class="headerlink" href="#basic-blocks" title="Permalink to this headline">¶</a></h4>
+<p>Concretely, an instance of <tt class="docutils literal"><span class="pre">CFG</span></tt> is a collection of basic blocks.  Each basic
+block is an instance of <tt class="docutils literal"><span class="pre">CFGBlock</span></tt>, which simply contains an ordered sequence
+of <tt class="docutils literal"><span class="pre">Stmt*</span></tt> (each referring to statements in the AST).  The ordering of
+statements within a block indicates unconditional flow of control from one
+statement to the next.  <a class="reference internal" href="#conditionalcontrolflow"><em>Conditional control-flow</em></a> is represented using edges between basic blocks.  The
+statements within a given <tt class="docutils literal"><span class="pre">CFGBlock</span></tt> can be traversed using the
+<tt class="docutils literal"><span class="pre">CFGBlock::*iterator</span></tt> interface.</p>
+<p>A <tt class="docutils literal"><span class="pre">CFG</span></tt> object owns the instances of <tt class="docutils literal"><span class="pre">CFGBlock</span></tt> within the control-flow
+graph it represents.  Each <tt class="docutils literal"><span class="pre">CFGBlock</span></tt> within a CFG is also uniquely numbered
+(accessible via <tt class="docutils literal"><span class="pre">CFGBlock::getBlockID()</span></tt>).  Currently the number is based on
+the ordering the blocks were created, but no assumptions should be made on how
+<tt class="docutils literal"><span class="pre">CFGBlocks</span></tt> are numbered other than their numbers are unique and that they
+are numbered from 0..N-1 (where N is the number of basic blocks in the CFG).</p>
+</div>
+<div class="section" id="entry-and-exit-blocks">
+<h4><a class="toc-backref" href="#id37">Entry and Exit Blocks</a><a class="headerlink" href="#entry-and-exit-blocks" title="Permalink to this headline">¶</a></h4>
+<p>Each instance of <tt class="docutils literal"><span class="pre">CFG</span></tt> contains two special blocks: an <em>entry</em> block
+(accessible via <tt class="docutils literal"><span class="pre">CFG::getEntry()</span></tt>), which has no incoming edges, and an
+<em>exit</em> block (accessible via <tt class="docutils literal"><span class="pre">CFG::getExit()</span></tt>), which has no outgoing edges.
+Neither block contains any statements, and they serve the role of providing a
+clear entrance and exit for a body of code such as a function body.  The
+presence of these empty blocks greatly simplifies the implementation of many
+analyses built on top of CFGs.</p>
+</div>
+<div class="section" id="conditional-control-flow">
+<span id="conditionalcontrolflow"></span><h4><a class="toc-backref" href="#id38">Conditional Control-Flow</a><a class="headerlink" href="#conditional-control-flow" title="Permalink to this headline">¶</a></h4>
+<p>Conditional control-flow (such as those induced by if-statements and loops) is
+represented as edges between <tt class="docutils literal"><span class="pre">CFGBlocks</span></tt>.  Because different C language
+constructs can induce control-flow, each <tt class="docutils literal"><span class="pre">CFGBlock</span></tt> also records an extra
+<tt class="docutils literal"><span class="pre">Stmt*</span></tt> that represents the <em>terminator</em> of the block.  A terminator is
+simply the statement that caused the control-flow, and is used to identify the
+nature of the conditional control-flow between blocks.  For example, in the
+case of an if-statement, the terminator refers to the <tt class="docutils literal"><span class="pre">IfStmt</span></tt> object in the
+AST that represented the given branch.</p>
+<p>To illustrate, consider the following code example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">int</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span>
+    <span class="n">x</span><span class="o">++</span><span class="p">;</span>
+  <span class="k">else</span> <span class="p">{</span>
+    <span class="n">x</span> <span class="o">+=</span> <span class="mi">2</span><span class="p">;</span>
+    <span class="n">x</span> <span class="o">*=</span> <span class="mi">2</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">return</span> <span class="n">x</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>After invoking the parser+semantic analyzer on this code fragment, the AST of
+the body of <tt class="docutils literal"><span class="pre">foo</span></tt> is referenced by a single <tt class="docutils literal"><span class="pre">Stmt*</span></tt>.  We can then construct
+an instance of <tt class="docutils literal"><span class="pre">CFG</span></tt> representing the control-flow graph of this function
+body by single call to a static class method:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Stmt</span> <span class="o">*</span><span class="n">FooBody</span> <span class="o">=</span> <span class="p">...</span>
+<span class="n">CFG</span> <span class="o">*</span><span class="n">FooCFG</span> <span class="o">=</span> <span class="n">CFG</span><span class="o">::</span><span class="n">buildCFG</span><span class="p">(</span><span class="n">FooBody</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>It is the responsibility of the caller of <tt class="docutils literal"><span class="pre">CFG::buildCFG</span></tt> to <tt class="docutils literal"><span class="pre">delete</span></tt> the
+returned <tt class="docutils literal"><span class="pre">CFG*</span></tt> when the CFG is no longer needed.</p>
+<p>Along with providing an interface to iterate over its <tt class="docutils literal"><span class="pre">CFGBlocks</span></tt>, the
+<tt class="docutils literal"><span class="pre">CFG</span></tt> class also provides methods that are useful for debugging and
+visualizing CFGs.  For example, the method <tt class="docutils literal"><span class="pre">CFG::dump()</span></tt> dumps a
+pretty-printed version of the CFG to standard error.  This is especially useful
+when one is using a debugger such as gdb.  For example, here is the output of
+<tt class="docutils literal"><span class="pre">FooCFG->dump()</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="p">[</span> <span class="n">B5</span> <span class="p">(</span><span class="n">ENTRY</span><span class="p">)</span> <span class="p">]</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">:</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B4</span>
+
+<span class="p">[</span> <span class="n">B4</span> <span class="p">]</span>
+   <span class="mi">1</span><span class="o">:</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span>
+   <span class="mi">2</span><span class="o">:</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span>
+   <span class="nl">T:</span> <span class="k">if</span> <span class="p">[</span><span class="n">B4</span><span class="mf">.2</span><span class="p">]</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B5</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">:</span> <span class="n">B3</span> <span class="n">B2</span>
+
+<span class="p">[</span> <span class="n">B3</span> <span class="p">]</span>
+   <span class="mi">1</span><span class="o">:</span> <span class="n">x</span><span class="o">++</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B4</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B1</span>
+
+<span class="p">[</span> <span class="n">B2</span> <span class="p">]</span>
+   <span class="mi">1</span><span class="o">:</span> <span class="n">x</span> <span class="o">+=</span> <span class="mi">2</span>
+   <span class="mi">2</span><span class="o">:</span> <span class="n">x</span> <span class="o">*=</span> <span class="mi">2</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B4</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B1</span>
+
+<span class="p">[</span> <span class="n">B1</span> <span class="p">]</span>
+   <span class="mi">1</span><span class="o">:</span> <span class="k">return</span> <span class="n">x</span><span class="p">;</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">:</span> <span class="n">B2</span> <span class="n">B3</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B0</span>
+
+<span class="p">[</span> <span class="n">B0</span> <span class="p">(</span><span class="n">EXIT</span><span class="p">)</span> <span class="p">]</span>
+   <span class="n">Predecessors</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">:</span> <span class="n">B1</span>
+   <span class="n">Successors</span> <span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">:</span>
+</pre></div>
+</div>
+<p>For each block, the pretty-printed output displays for each block the number of
+<em>predecessor</em> blocks (blocks that have outgoing control-flow to the given
+block) and <em>successor</em> blocks (blocks that have control-flow that have incoming
+control-flow from the given block).  We can also clearly see the special entry
+and exit blocks at the beginning and end of the pretty-printed output.  For the
+entry block (block B5), the number of predecessor blocks is 0, while for the
+exit block (block B0) the number of successor blocks is 0.</p>
+<p>The most interesting block here is B4, whose outgoing control-flow represents
+the branching caused by the sole if-statement in <tt class="docutils literal"><span class="pre">foo</span></tt>.  Of particular
+interest is the second statement in the block, <tt class="docutils literal"><span class="pre">(x</span> <span class="pre">></span> <span class="pre">2)</span></tt>, and the terminator,
+printed as <tt class="docutils literal"><span class="pre">if</span> <span class="pre">[B4.2]</span></tt>.  The second statement represents the evaluation of
+the condition of the if-statement, which occurs before the actual branching of
+control-flow.  Within the <tt class="docutils literal"><span class="pre">CFGBlock</span></tt> for B4, the <tt class="docutils literal"><span class="pre">Stmt*</span></tt> for the second
+statement refers to the actual expression in the AST for <tt class="docutils literal"><span class="pre">(x</span> <span class="pre">></span> <span class="pre">2)</span></tt>.  Thus
+pointers to subclasses of <tt class="docutils literal"><span class="pre">Expr</span></tt> can appear in the list of statements in a
+block, and not just subclasses of <tt class="docutils literal"><span class="pre">Stmt</span></tt> that refer to proper C statements.</p>
+<p>The terminator of block B4 is a pointer to the <tt class="docutils literal"><span class="pre">IfStmt</span></tt> object in the AST.
+The pretty-printer outputs <tt class="docutils literal"><span class="pre">if</span> <span class="pre">[B4.2]</span></tt> because the condition expression of
+the if-statement has an actual place in the basic block, and thus the
+terminator is essentially <em>referring</em> to the expression that is the second
+statement of block B4 (i.e., B4.2).  In this manner, conditions for
+control-flow (which also includes conditions for loops and switch statements)
+are hoisted into the actual basic block.</p>
+</div>
+</div>
+<div class="section" id="constant-folding-in-the-clang-ast">
+<h3><a class="toc-backref" href="#id39">Constant Folding in the Clang AST</a><a class="headerlink" href="#constant-folding-in-the-clang-ast" title="Permalink to this headline">¶</a></h3>
+<p>There are several places where constants and constant folding matter a lot to
+the Clang front-end.  First, in general, we prefer the AST to retain the source
+code as close to how the user wrote it as possible.  This means that if they
+wrote “<tt class="docutils literal"><span class="pre">5+4</span></tt>”, we want to keep the addition and two constants in the AST, we
+don’t want to fold to “<tt class="docutils literal"><span class="pre">9</span></tt>”.  This means that constant folding in various
+ways turns into a tree walk that needs to handle the various cases.</p>
+<p>However, there are places in both C and C++ that require constants to be
+folded.  For example, the C standard defines what an “integer constant
+expression” (i-c-e) is with very precise and specific requirements.  The
+language then requires i-c-e’s in a lot of places (for example, the size of a
+bitfield, the value for a case statement, etc).  For these, we have to be able
+to constant fold the constants, to do semantic checks (e.g., verify bitfield
+size is non-negative and that case statements aren’t duplicated).  We aim for
+Clang to be very pedantic about this, diagnosing cases when the code does not
+use an i-c-e where one is required, but accepting the code unless running with
+<tt class="docutils literal"><span class="pre">-pedantic-errors</span></tt>.</p>
+<p>Things get a little bit more tricky when it comes to compatibility with
+real-world source code.  Specifically, GCC has historically accepted a huge
+superset of expressions as i-c-e’s, and a lot of real world code depends on
+this unfortuate accident of history (including, e.g., the glibc system
+headers).  GCC accepts anything its “fold” optimizer is capable of reducing to
+an integer constant, which means that the definition of what it accepts changes
+as its optimizer does.  One example is that GCC accepts things like “<tt class="docutils literal"><span class="pre">case</span>
+<span class="pre">X-X:</span></tt>” even when <tt class="docutils literal"><span class="pre">X</span></tt> is a variable, because it can fold this to 0.</p>
+<p>Another issue are how constants interact with the extensions we support, such
+as <tt class="docutils literal"><span class="pre">__builtin_constant_p</span></tt>, <tt class="docutils literal"><span class="pre">__builtin_inf</span></tt>, <tt class="docutils literal"><span class="pre">__extension__</span></tt> and many
+others.  C99 obviously does not specify the semantics of any of these
+extensions, and the definition of i-c-e does not include them.  However, these
+extensions are often used in real code, and we have to have a way to reason
+about them.</p>
+<p>Finally, this is not just a problem for semantic analysis.  The code generator
+and other clients have to be able to fold constants (e.g., to initialize global
+variables) and has to handle a superset of what C99 allows.  Further, these
+clients can benefit from extended information.  For example, we know that
+“<tt class="docutils literal"><span class="pre">foo()</span> <span class="pre">||</span> <span class="pre">1</span></tt>” always evaluates to <tt class="docutils literal"><span class="pre">true</span></tt>, but we can’t replace the
+expression with <tt class="docutils literal"><span class="pre">true</span></tt> because it has side effects.</p>
+<div class="section" id="implementation-approach">
+<h4><a class="toc-backref" href="#id40">Implementation Approach</a><a class="headerlink" href="#implementation-approach" title="Permalink to this headline">¶</a></h4>
+<p>After trying several different approaches, we’ve finally converged on a design
+(Note, at the time of this writing, not all of this has been implemented,
+consider this a design goal!).  Our basic approach is to define a single
+recursive method evaluation method (<tt class="docutils literal"><span class="pre">Expr::Evaluate</span></tt>), which is implemented
+in <tt class="docutils literal"><span class="pre">AST/ExprConstant.cpp</span></tt>.  Given an expression with “scalar” type (integer,
+fp, complex, or pointer) this method returns the following information:</p>
+<ul class="simple">
+<li>Whether the expression is an integer constant expression, a general constant
+that was folded but has no side effects, a general constant that was folded
+but that does have side effects, or an uncomputable/unfoldable value.</li>
+<li>If the expression was computable in any way, this method returns the
+<tt class="docutils literal"><span class="pre">APValue</span></tt> for the result of the expression.</li>
+<li>If the expression is not evaluatable at all, this method returns information
+on one of the problems with the expression.  This includes a
+<tt class="docutils literal"><span class="pre">SourceLocation</span></tt> for where the problem is, and a diagnostic ID that explains
+the problem.  The diagnostic should have <tt class="docutils literal"><span class="pre">ERROR</span></tt> type.</li>
+<li>If the expression is not an integer constant expression, this method returns
+information on one of the problems with the expression.  This includes a
+<tt class="docutils literal"><span class="pre">SourceLocation</span></tt> for where the problem is, and a diagnostic ID that
+explains the problem.  The diagnostic should have <tt class="docutils literal"><span class="pre">EXTENSION</span></tt> type.</li>
+</ul>
+<p>This information gives various clients the flexibility that they want, and we
+will eventually have some helper methods for various extensions.  For example,
+<tt class="docutils literal"><span class="pre">Sema</span></tt> should have a <tt class="docutils literal"><span class="pre">Sema::VerifyIntegerConstantExpression</span></tt> method, which
+calls <tt class="docutils literal"><span class="pre">Evaluate</span></tt> on the expression.  If the expression is not foldable, the
+error is emitted, and it would return <tt class="docutils literal"><span class="pre">true</span></tt>.  If the expression is not an
+i-c-e, the <tt class="docutils literal"><span class="pre">EXTENSION</span></tt> diagnostic is emitted.  Finally it would return
+<tt class="docutils literal"><span class="pre">false</span></tt> to indicate that the AST is OK.</p>
+<p>Other clients can use the information in other ways, for example, codegen can
+just use expressions that are foldable in any way.</p>
+</div>
+<div class="section" id="extensions">
+<h4><a class="toc-backref" href="#id41">Extensions</a><a class="headerlink" href="#extensions" title="Permalink to this headline">¶</a></h4>
+<p>This section describes how some of the various extensions Clang supports
+interacts with constant evaluation:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">__extension__</span></tt>: The expression form of this extension causes any
+evaluatable subexpression to be accepted as an integer constant expression.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_constant_p</span></tt>: This returns true (as an integer constant
+expression) if the operand evaluates to either a numeric value (that is, not
+a pointer cast to integral type) of integral, enumeration, floating or
+complex type, or if it evaluates to the address of the first character of a
+string literal (possibly cast to some other type).  As a special case, if
+<tt class="docutils literal"><span class="pre">__builtin_constant_p</span></tt> is the (potentially parenthesized) condition of a
+conditional operator expression (“<tt class="docutils literal"><span class="pre">?:</span></tt>”), only the true side of the
+conditional operator is considered, and it is evaluated with full constant
+folding.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_choose_expr</span></tt>: The condition is required to be an integer
+constant expression, but we accept any constant as an “extension of an
+extension”.  This only evaluates one operand depending on which way the
+condition evaluates.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_classify_type</span></tt>: This always returns an integer constant
+expression.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_inf,</span> <span class="pre">nan,</span> <span class="pre">...</span></tt>: These are treated just like a floating-point
+literal.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_abs,</span> <span class="pre">copysign,</span> <span class="pre">...</span></tt>: These are constant folded as general
+constant expressions.</li>
+<li><tt class="docutils literal"><span class="pre">__builtin_strlen</span></tt> and <tt class="docutils literal"><span class="pre">strlen</span></tt>: These are constant folded as integer
+constant expressions if the argument is a string literal.</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="section" id="how-to-change-clang">
+<h2><a class="toc-backref" href="#id42">How to change Clang</a><a class="headerlink" href="#how-to-change-clang" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="how-to-add-an-attribute">
+<h3><a class="toc-backref" href="#id43">How to add an attribute</a><a class="headerlink" href="#how-to-add-an-attribute" title="Permalink to this headline">¶</a></h3>
+<div class="section" id="attribute-basics">
+<h4><a class="toc-backref" href="#id44">Attribute Basics</a><a class="headerlink" href="#attribute-basics" title="Permalink to this headline">¶</a></h4>
+<p>Attributes in clang come in two forms: parsed form, and semantic form. Both
+forms are represented via a tablegen definition of the attribute, specified in
+Attr.td.</p>
+</div>
+<div class="section" id="include-clang-basic-attr-td">
+<h4><a class="toc-backref" href="#id45"><tt class="docutils literal"><span class="pre">include/clang/Basic/Attr.td</span></tt></a><a class="headerlink" href="#include-clang-basic-attr-td" title="Permalink to this headline">¶</a></h4>
+<p>First, add your attribute to the <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup">include/clang/Basic/Attr.td</a>
+file.</p>
+<p>Each attribute gets a <tt class="docutils literal"><span class="pre">def</span></tt> inheriting from <tt class="docutils literal"><span class="pre">Attr</span></tt> or one of its
+subclasses.  <tt class="docutils literal"><span class="pre">InheritableAttr</span></tt> means that the attribute also applies to
+subsequent declarations of the same name.  <tt class="docutils literal"><span class="pre">InheritableParamAttr</span></tt> is similar
+to <tt class="docutils literal"><span class="pre">InheritableAttr</span></tt>, except that the attribute is written on a parameter
+instead of a declaration, type or statement.  Attributes inheriting from
+<tt class="docutils literal"><span class="pre">TypeAttr</span></tt> are pure type attributes which generally are not given a
+representation in the AST.  Attributes inheriting from <tt class="docutils literal"><span class="pre">TargetSpecificAttr</span></tt>
+are attributes specific to one or more target architectures.  An attribute that
+inherits from <tt class="docutils literal"><span class="pre">IgnoredAttr</span></tt> is parsed, but will generate an ignored attribute
+diagnostic when used.  The attribute type may be useful when an attribute is
+supported by another vendor, but not supported by clang.</p>
+<p><tt class="docutils literal"><span class="pre">Spellings</span></tt> lists the strings that can appear in <tt class="docutils literal"><span class="pre">__attribute__((here))</span></tt> or
+<tt class="docutils literal"><span class="pre">[[here]]</span></tt>.  All such strings will be synonymous.  Possible <tt class="docutils literal"><span class="pre">Spellings</span></tt>
+are: <tt class="docutils literal"><span class="pre">GNU</span></tt> (for use with GNU-style __attribute__ spellings), <tt class="docutils literal"><span class="pre">Declspec</span></tt>
+(for use with Microsoft Visual Studio-style __declspec spellings), <tt class="docutils literal"><span class="pre">CXX11`</span>
+<span class="pre">(for</span> <span class="pre">use</span> <span class="pre">with</span> <span class="pre">C++11-style</span> <span class="pre">[[foo]]</span> <span class="pre">and</span> <span class="pre">[[foo::bar]]</span> <span class="pre">spellings),</span> <span class="pre">and</span> <span class="pre">``Keyword</span></tt>
+(for use with attributes that are implemented as keywords, like C++11’s
+<tt class="docutils literal"><span class="pre">override</span></tt> or <tt class="docutils literal"><span class="pre">final</span></tt>). If you want to allow the <tt class="docutils literal"><span class="pre">[[]]</span></tt> C++11 syntax, you
+have to define a list of <tt class="docutils literal"><span class="pre">Namespaces</span></tt>, which will let users write
+<tt class="docutils literal"><span class="pre">[[namespace::spelling]]</span></tt>.  Using the empty string for a namespace will allow
+users to write just the spelling with no “<tt class="docutils literal"><span class="pre">::</span></tt>”.  Attributes which g++-4.8
+or later accepts should also have a <tt class="docutils literal"><span class="pre">CXX11<"gnu",</span> <span class="pre">"spelling"></span></tt> spelling.</p>
+<p><tt class="docutils literal"><span class="pre">Subjects</span></tt> restricts what kinds of AST node to which this attribute can
+appertain (roughly, attach).  The subjects are specified via a <tt class="docutils literal"><span class="pre">SubjectList</span></tt>,
+which specify the list of subjects. Additionally, subject-related diagnostics
+can be specified to be warnings or errors, with the default being a warning.
+The diagnostics displayed to the user are automatically determined based on
+the subjects in the list, but a custom diagnostic parameter can also be
+specified in the <tt class="docutils literal"><span class="pre">SubjectList</span></tt>.  The diagnostics generated for subject list
+violations are either <tt class="docutils literal"><span class="pre">diag::warn_attribute_wrong_decl_type</span></tt> or
+<tt class="docutils literal"><span class="pre">diag::err_attribute_wrong_decl_type</span></tt>, and the parameter enumeration is
+found in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?view=markup">include/clang/Sema/AttributeList.h</a>
+If you add new Decl nodes to the <tt class="docutils literal"><span class="pre">SubjectList</span></tt>, you may need to update the
+logic used to automatically determine the diagnostic parameter in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup">utils/TableGen/ClangAttrEmitter.cpp</a>.</p>
+<p>Diagnostic checking for attribute subject lists is automated except when
+<tt class="docutils literal"><span class="pre">HasCustomParsing</span></tt> is set to <tt class="docutils literal"><span class="pre">1</span></tt>.</p>
+<p>By default, all subjects in the SubjectList must either be a Decl node defined
+in <tt class="docutils literal"><span class="pre">DeclNodes.td</span></tt>, or a statement node defined in <tt class="docutils literal"><span class="pre">StmtNodes.td</span></tt>.  However,
+more complex subjects can be created by creating a <tt class="docutils literal"><span class="pre">SubsetSubject</span></tt> object.
+Each such object has a base subject which it appertains to (which must be a
+Decl or Stmt node, and not a SubsetSubject node), and some custom code which is
+called when determining whether an attribute appertains to the subject.  For
+instance, a <tt class="docutils literal"><span class="pre">NonBitField</span></tt> SubsetSubject appertains to a <tt class="docutils literal"><span class="pre">FieldDecl</span></tt>, and
+tests whether the given FieldDecl is a bit field.  When a SubsetSubject is
+specified in a SubjectList, a custom diagnostic parameter must also be provided.</p>
+<p><tt class="docutils literal"><span class="pre">Args</span></tt> names the arguments the attribute takes, in order.  If <tt class="docutils literal"><span class="pre">Args</span></tt> is
+<tt class="docutils literal"><span class="pre">[StringArgument<"Arg1">,</span> <span class="pre">IntArgument<"Arg2">]</span></tt> then
+<tt class="docutils literal"><span class="pre">__attribute__((myattribute("Hello",</span> <span class="pre">3)))</span></tt> will be a valid use.  Attribute
+arguments specify both the parsed form and the semantic form of the attribute.
+The previous example shows an attribute which requires two attributes while
+parsing, and the Attr subclass’ constructor for the attribute will require a
+string and integer argument.</p>
+<p>Diagnostic checking for argument counts is automated except when
+<tt class="docutils literal"><span class="pre">HasCustomParsing</span></tt> is set to <tt class="docutils literal"><span class="pre">1</span></tt>, or when the attribute uses an optional or
+variadic argument.  Diagnostic checking for argument semantics is not automated.</p>
+<p>If the parsed form of the attribute is more complex, or differs from the
+semantic form, the <tt class="docutils literal"><span class="pre">HasCustomParsing</span></tt> bit can be set to <tt class="docutils literal"><span class="pre">1</span></tt> for the class,
+and the parsing code in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?view=markup">Parser::ParseGNUAttributeArgs</a>
+can be updated for the special case.  Note that this only applies to arguments
+with a GNU spelling – attributes with a __declspec spelling currently ignore
+this flag and are handled by <tt class="docutils literal"><span class="pre">Parser::ParseMicrosoftDeclSpec</span></tt>.</p>
+<p>Custom accessors can be generated for an attribute based on the spelling list
+for that attribute.  For instance, if an attribute has two different spellings:
+‘Foo’ and ‘Bar’, accessors can be created:
+<tt class="docutils literal"><span class="pre">[Accessor<"isFoo",</span> <span class="pre">[GNU<"Foo">]>,</span> <span class="pre">Accessor<"isBar",</span> <span class="pre">[GNU<"Bar">]>]</span></tt>
+These accessors will be generated on the semantic form of the attribute,
+accepting no arguments and returning a Boolean.</p>
+<p>Attributes which do not require an AST node should set the <tt class="docutils literal"><span class="pre">ASTNode</span></tt> field to
+<tt class="docutils literal"><span class="pre">0</span></tt> to avoid polluting the AST.  Note that anything inheriting from
+<tt class="docutils literal"><span class="pre">TypeAttr</span></tt> or <tt class="docutils literal"><span class="pre">IgnoredAttr</span></tt> automatically do not generate an AST node.  All
+other attributes generate an AST node by default.  The AST node is the semantic
+representation of the attribute.</p>
+<p>Attributes which do not require custom semantic handling should set the
+<tt class="docutils literal"><span class="pre">SemaHandler</span></tt> field to <tt class="docutils literal"><span class="pre">0</span></tt>.  Note that anything inheriting from
+<tt class="docutils literal"><span class="pre">IgnoredAttr</span></tt> automatically do not get a semantic handler.  All other
+attributes are assumed to use a semantic handler by default.  Attributes
+without a semantic handler are not given a parsed attribute Kind enumeration.</p>
+<p>The <tt class="docutils literal"><span class="pre">LangOpts</span></tt> field can be used to specify a list of language options
+required by the attribute.  For instance, all of the CUDA-specific attributes
+specify <tt class="docutils literal"><span class="pre">[CUDA]</span></tt> for the <tt class="docutils literal"><span class="pre">LangOpts</span></tt> field, and when the CUDA language
+option is not enabled, an “attribute ignored” warning diagnostic is emitted.
+Since language options are not table generated nodes, new language options must
+be created manually and should specify the spelling used by <tt class="docutils literal"><span class="pre">LangOptions</span></tt> class.</p>
+<p>Target-specific attribute sometimes share a spelling with other attributes in
+different targets.  For instance, the ARM and MSP430 targets both have an
+attribute spelled <tt class="docutils literal"><span class="pre">GNU<"interrupt"></span></tt>, but with different parsing and semantic
+requirements.  To support this feature, an attribute inheriting from
+<tt class="docutils literal"><span class="pre">TargetSpecificAttribute</span></tt> make specify a <tt class="docutils literal"><span class="pre">ParseKind</span></tt> field.  This field
+should be the same value between all arguments sharing a spelling, and
+corresponds to the parsed attribute’s Kind enumeration.  This allows attributes
+to share a parsed attribute kind, but have distinct semantic attribute classes.
+For instance, <tt class="docutils literal"><span class="pre">AttributeList::AT_Interrupt</span></tt> is the shared parsed attribute
+kind, but ARMInterruptAttr and MSP430InterruptAttr are the semantic attributes
+generated.</p>
+<p>By default, when declarations are merging attributes, an attribute will not be
+duplicated. However, if an attribute can be duplicated during this merging
+stage, set <tt class="docutils literal"><span class="pre">DuplicatesAllowedWhileMerging</span></tt> to <tt class="docutils literal"><span class="pre">1</span></tt>, and the attribute will
+be merged.</p>
+<p>By default, attribute arguments are parsed in an evaluated context. If the
+arguments for an attribute should be parsed in an unevaluated context (akin to
+the way the argument to a <tt class="docutils literal"><span class="pre">sizeof</span></tt> expression is parsed), you can set
+<tt class="docutils literal"><span class="pre">ParseArgumentsAsUnevaluated</span></tt> to <tt class="docutils literal"><span class="pre">1</span></tt>.</p>
+<p>If additional functionality is desired for the semantic form of the attribute,
+the <tt class="docutils literal"><span class="pre">AdditionalMembers</span></tt> field specifies code to be copied verbatim into the
+semantic attribute class object.</p>
+<p>All attributes must have one or more form of documentation, which is provided
+in the <tt class="docutils literal"><span class="pre">Documentation</span></tt> list. Generally, the documentation for an attribute
+is a stand-alone definition in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup">include/clang/Basic/AttrDocs.td</a>
+that is named after the attribute being documented. Each documentation element
+is given a <tt class="docutils literal"><span class="pre">Category</span></tt> (variable, function, or type) and <tt class="docutils literal"><span class="pre">Content</span></tt>. A single
+attribute may contain multiple documentation elements for distinct categories.
+For instance, an attribute which can appertain to both function and types (such
+as a calling convention attribute), should contain two documentation elements.
+The <tt class="docutils literal"><span class="pre">Content</span></tt> for an attribute uses reStructuredText (RST) syntax.</p>
+<p>If an attribute is used internally by the compiler, but is not written by users
+(such as attributes with an empty spelling list), it can use the
+<tt class="docutils literal"><span class="pre">Undocumented</span></tt> documentation element.</p>
+</div>
+<div class="section" id="boilerplate">
+<h4><a class="toc-backref" href="#id46">Boilerplate</a><a class="headerlink" href="#boilerplate" title="Permalink to this headline">¶</a></h4>
+<p>All semantic processing of declaration attributes happens in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup">lib/Sema/SemaDeclAttr.cpp</a>,
+and generally starts in the <tt class="docutils literal"><span class="pre">ProcessDeclAttribute</span></tt> function.  If your
+attribute is a “simple” attribute – meaning that it requires no custom
+semantic processing aside from what is automatically  provided for you, you can
+add a call to <tt class="docutils literal"><span class="pre">handleSimpleAttribute<YourAttr>(S,</span> <span class="pre">D,</span> <span class="pre">Attr);</span></tt> to the switch
+statement. Otherwise, write a new <tt class="docutils literal"><span class="pre">handleYourAttr()</span></tt> function, and add that
+to the switch statement.</p>
+<p>If your attribute causes extra warnings to fire, define a <tt class="docutils literal"><span class="pre">DiagGroup</span></tt> in
+<a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup">include/clang/Basic/DiagnosticGroups.td</a>
+named after the attribute’s <tt class="docutils literal"><span class="pre">Spelling</span></tt> with “_”s replaced by “-“s.  If you’re
+only defining one diagnostic, you can skip <tt class="docutils literal"><span class="pre">DiagnosticGroups.td</span></tt> and use
+<tt class="docutils literal"><span class="pre">InGroup<DiagGroup<"your-attribute">></span></tt> directly in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup">DiagnosticSemaKinds.td</a></p>
+<p>All semantic diagnostics generated for your attribute, including automatically-
+generated ones (such as subjects and argument counts), should have a
+corresponding test case.</p>
+</div>
+<div class="section" id="the-meat-of-your-attribute">
+<h4><a class="toc-backref" href="#id47">The meat of your attribute</a><a class="headerlink" href="#the-meat-of-your-attribute" title="Permalink to this headline">¶</a></h4>
+<p>Find an appropriate place in Clang to do whatever your attribute needs to do.
+Check for the attribute’s presence using <tt class="docutils literal"><span class="pre">Decl::getAttr<YourAttr>()</span></tt>.</p>
+<p>Update the <a class="reference internal" href="LanguageExtensions.html"><em>Clang Language Extensions</em></a> document to describe your new attribute.</p>
+</div>
+</div>
+<div class="section" id="how-to-add-an-expression-or-statement">
+<h3><a class="toc-backref" href="#id48">How to add an expression or statement</a><a class="headerlink" href="#how-to-add-an-expression-or-statement" title="Permalink to this headline">¶</a></h3>
+<p>Expressions and statements are one of the most fundamental constructs within a
+compiler, because they interact with many different parts of the AST, semantic
+analysis, and IR generation.  Therefore, adding a new expression or statement
+kind into Clang requires some care.  The following list details the various
+places in Clang where an expression or statement needs to be introduced, along
+with patterns to follow to ensure that the new expression or statement works
+well across all of the C languages.  We focus on expressions, but statements
+are similar.</p>
+<ol class="arabic simple">
+<li>Introduce parsing actions into the parser.  Recursive-descent parsing is
+mostly self-explanatory, but there are a few things that are worth keeping
+in mind:<ul>
+<li>Keep as much source location information as possible! You’ll want it later
+to produce great diagnostics and support Clang’s various features that map
+between source code and the AST.</li>
+<li>Write tests for all of the “bad” parsing cases, to make sure your recovery
+is good.  If you have matched delimiters (e.g., parentheses, square
+brackets, etc.), use <tt class="docutils literal"><span class="pre">Parser::BalancedDelimiterTracker</span></tt> to give nice
+diagnostics when things go wrong.</li>
+</ul>
+</li>
+<li>Introduce semantic analysis actions into <tt class="docutils literal"><span class="pre">Sema</span></tt>.  Semantic analysis should
+always involve two functions: an <tt class="docutils literal"><span class="pre">ActOnXXX</span></tt> function that will be called
+directly from the parser, and a <tt class="docutils literal"><span class="pre">BuildXXX</span></tt> function that performs the
+actual semantic analysis and will (eventually!) build the AST node.  It’s
+fairly common for the <tt class="docutils literal"><span class="pre">ActOnCXX</span></tt> function to do very little (often just
+some minor translation from the parser’s representation to <tt class="docutils literal"><span class="pre">Sema</span></tt>‘s
+representation of the same thing), but the separation is still important:
+C++ template instantiation, for example, should always call the <tt class="docutils literal"><span class="pre">BuildXXX</span></tt>
+variant.  Several notes on semantic analysis before we get into construction
+of the AST:<ul>
+<li>Your expression probably involves some types and some subexpressions.
+Make sure to fully check that those types, and the types of those
+subexpressions, meet your expectations.  Add implicit conversions where
+necessary to make sure that all of the types line up exactly the way you
+want them.  Write extensive tests to check that you’re getting good
+diagnostics for mistakes and that you can use various forms of
+subexpressions with your expression.</li>
+<li>When type-checking a type or subexpression, make sure to first check
+whether the type is “dependent” (<tt class="docutils literal"><span class="pre">Type::isDependentType()</span></tt>) or whether a
+subexpression is type-dependent (<tt class="docutils literal"><span class="pre">Expr::isTypeDependent()</span></tt>).  If any of
+these return <tt class="docutils literal"><span class="pre">true</span></tt>, then you’re inside a template and you can’t do much
+type-checking now.  That’s normal, and your AST node (when you get there)
+will have to deal with this case.  At this point, you can write tests that
+use your expression within templates, but don’t try to instantiate the
+templates.</li>
+<li>For each subexpression, be sure to call <tt class="docutils literal"><span class="pre">Sema::CheckPlaceholderExpr()</span></tt>
+to deal with “weird” expressions that don’t behave well as subexpressions.
+Then, determine whether you need to perform lvalue-to-rvalue conversions
+(<tt class="docutils literal"><span class="pre">Sema::DefaultLvalueConversions</span></tt>) or the usual unary conversions
+(<tt class="docutils literal"><span class="pre">Sema::UsualUnaryConversions</span></tt>), for places where the subexpression is
+producing a value you intend to use.</li>
+<li>Your <tt class="docutils literal"><span class="pre">BuildXXX</span></tt> function will probably just return <tt class="docutils literal"><span class="pre">ExprError()</span></tt> at
+this point, since you don’t have an AST.  That’s perfectly fine, and
+shouldn’t impact your testing.</li>
+</ul>
+</li>
+<li>Introduce an AST node for your new expression.  This starts with declaring
+the node in <tt class="docutils literal"><span class="pre">include/Basic/StmtNodes.td</span></tt> and creating a new class for your
+expression in the appropriate <tt class="docutils literal"><span class="pre">include/AST/Expr*.h</span></tt> header.  It’s best to
+look at the class for a similar expression to get ideas, and there are some
+specific things to watch for:<ul>
+<li>If you need to allocate memory, use the <tt class="docutils literal"><span class="pre">ASTContext</span></tt> allocator to
+allocate memory.  Never use raw <tt class="docutils literal"><span class="pre">malloc</span></tt> or <tt class="docutils literal"><span class="pre">new</span></tt>, and never hold any
+resources in an AST node, because the destructor of an AST node is never
+called.</li>
+<li>Make sure that <tt class="docutils literal"><span class="pre">getSourceRange()</span></tt> covers the exact source range of your
+expression.  This is needed for diagnostics and for IDE support.</li>
+<li>Make sure that <tt class="docutils literal"><span class="pre">children()</span></tt> visits all of the subexpressions.  This is
+important for a number of features (e.g., IDE support, C++ variadic
+templates).  If you have sub-types, you’ll also need to visit those
+sub-types in <tt class="docutils literal"><span class="pre">RecursiveASTVisitor</span></tt> and <tt class="docutils literal"><span class="pre">DataRecursiveASTVisitor</span></tt>.</li>
+<li>Add printing support (<tt class="docutils literal"><span class="pre">StmtPrinter.cpp</span></tt>) for your expression.</li>
+<li>Add profiling support (<tt class="docutils literal"><span class="pre">StmtProfile.cpp</span></tt>) for your AST node, noting the
+distinguishing (non-source location) characteristics of an instance of
+your expression.  Omitting this step will lead to hard-to-diagnose
+failures regarding matching of template declarations.</li>
+<li>Add serialization support (<tt class="docutils literal"><span class="pre">ASTReaderStmt.cpp</span></tt>, <tt class="docutils literal"><span class="pre">ASTWriterStmt.cpp</span></tt>)
+for your AST node.</li>
+</ul>
+</li>
+<li>Teach semantic analysis to build your AST node.  At this point, you can wire
+up your <tt class="docutils literal"><span class="pre">Sema::BuildXXX</span></tt> function to actually create your AST.  A few
+things to check at this point:<ul>
+<li>If your expression can construct a new C++ class or return a new
+Objective-C object, be sure to update and then call
+<tt class="docutils literal"><span class="pre">Sema::MaybeBindToTemporary</span></tt> for your just-created AST node to be sure
+that the object gets properly destructed.  An easy way to test this is to
+return a C++ class with a private destructor: semantic analysis should
+flag an error here with the attempt to call the destructor.</li>
+<li>Inspect the generated AST by printing it using <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">-ast-print</span></tt>,
+to make sure you’re capturing all of the important information about how
+the AST was written.</li>
+<li>Inspect the generated AST under <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">-ast-dump</span></tt> to verify that
+all of the types in the generated AST line up the way you want them.
+Remember that clients of the AST should never have to “think” to
+understand what’s going on.  For example, all implicit conversions should
+show up explicitly in the AST.</li>
+<li>Write tests that use your expression as a subexpression of other,
+well-known expressions.  Can you call a function using your expression as
+an argument?  Can you use the ternary operator?</li>
+</ul>
+</li>
+<li>Teach code generation to create IR to your AST node.  This step is the first
+(and only) that requires knowledge of LLVM IR.  There are several things to
+keep in mind:<ul>
+<li>Code generation is separated into scalar/aggregate/complex and
+lvalue/rvalue paths, depending on what kind of result your expression
+produces.  On occasion, this requires some careful factoring of code to
+avoid duplication.</li>
+<li><tt class="docutils literal"><span class="pre">CodeGenFunction</span></tt> contains functions <tt class="docutils literal"><span class="pre">ConvertType</span></tt> and
+<tt class="docutils literal"><span class="pre">ConvertTypeForMem</span></tt> that convert Clang’s types (<tt class="docutils literal"><span class="pre">clang::Type*</span></tt> or
+<tt class="docutils literal"><span class="pre">clang::QualType</span></tt>) to LLVM types.  Use the former for values, and the
+later for memory locations: test with the C++ “<tt class="docutils literal"><span class="pre">bool</span></tt>” type to check
+this.  If you find that you are having to use LLVM bitcasts to make the
+subexpressions of your expression have the type that your expression
+expects, STOP!  Go fix semantic analysis and the AST so that you don’t
+need these bitcasts.</li>
+<li>The <tt class="docutils literal"><span class="pre">CodeGenFunction</span></tt> class has a number of helper functions to make
+certain operations easy, such as generating code to produce an lvalue or
+an rvalue, or to initialize a memory location with a given value.  Prefer
+to use these functions rather than directly writing loads and stores,
+because these functions take care of some of the tricky details for you
+(e.g., for exceptions).</li>
+<li>If your expression requires some special behavior in the event of an
+exception, look at the <tt class="docutils literal"><span class="pre">push*Cleanup</span></tt> functions in <tt class="docutils literal"><span class="pre">CodeGenFunction</span></tt>
+to introduce a cleanup.  You shouldn’t have to deal with
+exception-handling directly.</li>
+<li>Testing is extremely important in IR generation.  Use <tt class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span>
+<span class="pre">-emit-llvm</span></tt> and <a class="reference external" href="http://llvm.org/docs/CommandGuide/FileCheck.html">FileCheck</a> to verify that you’re
+generating the right IR.</li>
+</ul>
+</li>
+<li>Teach template instantiation how to cope with your AST node, which requires
+some fairly simple code:<ul>
+<li>Make sure that your expression’s constructor properly computes the flags
+for type dependence (i.e., the type your expression produces can change
+from one instantiation to the next), value dependence (i.e., the constant
+value your expression produces can change from one instantiation to the
+next), instantiation dependence (i.e., a template parameter occurs
+anywhere in your expression), and whether your expression contains a
+parameter pack (for variadic templates).  Often, computing these flags
+just means combining the results from the various types and
+subexpressions.</li>
+<li>Add <tt class="docutils literal"><span class="pre">TransformXXX</span></tt> and <tt class="docutils literal"><span class="pre">RebuildXXX</span></tt> functions to the <tt class="docutils literal"><span class="pre">TreeTransform</span></tt>
+class template in <tt class="docutils literal"><span class="pre">Sema</span></tt>.  <tt class="docutils literal"><span class="pre">TransformXXX</span></tt> should (recursively)
+transform all of the subexpressions and types within your expression,
+using <tt class="docutils literal"><span class="pre">getDerived().TransformYYY</span></tt>.  If all of the subexpressions and
+types transform without error, it will then call the <tt class="docutils literal"><span class="pre">RebuildXXX</span></tt>
+function, which will in turn call <tt class="docutils literal"><span class="pre">getSema().BuildXXX</span></tt> to perform
+semantic analysis and build your expression.</li>
+<li>To test template instantiation, take those tests you wrote to make sure
+that you were type checking with type-dependent expressions and dependent
+types (from step #2) and instantiate those templates with various types,
+some of which type-check and some that don’t, and test the error messages
+in each case.</li>
+</ul>
+</li>
+<li>There are some “extras” that make other features work better.  It’s worth
+handling these extras to give your expression complete integration into
+Clang:<ul>
+<li>Add code completion support for your expression in
+<tt class="docutils literal"><span class="pre">SemaCodeComplete.cpp</span></tt>.</li>
+<li>If your expression has types in it, or has any “interesting” features
+other than subexpressions, extend libclang’s <tt class="docutils literal"><span class="pre">CursorVisitor</span></tt> to provide
+proper visitation for your expression, enabling various IDE features such
+as syntax highlighting, cross-referencing, and so on.  The
+<tt class="docutils literal"><span class="pre">c-index-test</span></tt> helper program can be used to test these features.</li>
+</ul>
+</li>
+</ol>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DriverInternals.html">Driver Design & Internals</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/IntroductionToTheClangAST.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/IntroductionToTheClangAST.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/IntroductionToTheClangAST.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/IntroductionToTheClangAST.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,182 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Introduction to the Clang AST — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="LibTooling" href="LibTooling.html" />
+    <link rel="prev" title="External Clang Examples" href="ExternalClangExamples.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Introduction to the Clang AST</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="ExternalClangExamples.html">External Clang Examples</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibTooling.html">LibTooling</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="introduction-to-the-clang-ast">
+<h1>Introduction to the Clang AST<a class="headerlink" href="#introduction-to-the-clang-ast" title="Permalink to this headline">¶</a></h1>
+<p>This document gives a gentle introduction to the mysteries of the Clang
+AST. It is targeted at developers who either want to contribute to
+Clang, or use tools that work based on Clang’s AST, like the AST
+matchers.</p>
+<center><iframe width="560" height="315" src="http://www.youtube.com/embed/VqCkCDFLSsc?vq=hd720" frameborder="0" allowfullscreen></iframe></center><p><a class="reference external" href="http://llvm.org/devmtg/2013-04/klimek-slides.pdf">Slides</a></p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s AST is different from ASTs produced by some other compilers in
+that it closely resembles both the written C++ code and the C++
+standard. For example, parenthesis expressions and compile time
+constants are available in an unreduced form in the AST. This makes
+Clang’s AST a good fit for refactoring tools.</p>
+<p>Documentation for all Clang AST nodes is available via the generated
+<a class="reference external" href="http://clang.llvm.org/doxygen">Doxygen</a>. The doxygen online
+documentation is also indexed by your favorite search engine, which will
+make a search for clang and the AST node’s class name usually turn up
+the doxygen of the class you’re looking for (for example, search for:
+clang ParenExpr).</p>
+</div>
+<div class="section" id="examining-the-ast">
+<h2>Examining the AST<a class="headerlink" href="#examining-the-ast" title="Permalink to this headline">¶</a></h2>
+<p>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 mode,
+which can be enabled with the flag <tt class="docutils literal"><span class="pre">-ast-dump</span></tt>.</p>
+<p>Let’s look at a simple example AST:</p>
+<div class="highlight-python"><pre>$ cat test.cc
+int f(int x) {
+  int result = (x / 42);
+  return result;
+}
+
+# Clang by default is a frontend for many tools; -Xclang is used to pass
+# options directly to the C++ frontend.
+$ clang -Xclang -ast-dump -fsyntax-only test.cc
+TranslationUnitDecl 0x5aea0d0 <<invalid sloc>>
+... cutting out internal declarations of clang ...
+`-FunctionDecl 0x5aeab50 <test.cc:1:1, line:4:1> f 'int (int)'
+  |-ParmVarDecl 0x5aeaa90 <line:1:7, col:11> x 'int'
+  `-CompoundStmt 0x5aead88 <col:14, line:4:1>
+    |-DeclStmt 0x5aead10 <line:2:3, col:24>
+    | `-VarDecl 0x5aeac10 <col:3, col:23> result 'int'
+    |   `-ParenExpr 0x5aeacf0 <col:16, col:23> 'int'
+    |     `-BinaryOperator 0x5aeacc8 <col:17, col:21> 'int' '/'
+    |       |-ImplicitCastExpr 0x5aeacb0 <col:17> 'int' <LValueToRValue>
+    |       | `-DeclRefExpr 0x5aeac68 <col:17> 'int' lvalue ParmVar 0x5aeaa90 'x' 'int'
+    |       `-IntegerLiteral 0x5aeac90 <col:21> 'int' 42
+    `-ReturnStmt 0x5aead68 <line:3:3, col:10>
+      `-ImplicitCastExpr 0x5aead50 <col:10> 'int' <LValueToRValue>
+        `-DeclRefExpr 0x5aead28 <col:10> 'int' lvalue Var 0x5aeac10 'result' 'int'</pre>
+</div>
+<p>The toplevel declaration in
+a translation unit is always the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html">translation unit
+declaration</a>.
+In this example, our first user written declaration is the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">function
+declaration</a>
+of “<tt class="docutils literal"><span class="pre">f</span></tt>”. The body of “<tt class="docutils literal"><span class="pre">f</span></tt>” is a <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">compound
+statement</a>,
+whose child nodes are a <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">declaration
+statement</a>
+that declares our result variable, and the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">return
+statement</a>.</p>
+</div>
+<div class="section" id="ast-context">
+<h2>AST Context<a class="headerlink" href="#ast-context" title="Permalink to this headline">¶</a></h2>
+<p>All information about the AST for a translation unit is bundled up in
+the class
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html">ASTContext</a>.
+It allows traversal of the whole translation unit starting from
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#abd909fb01ef10cfd0244832a67b1dd64">getTranslationUnitDecl</a>,
+or to access Clang’s <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a4f95adb9958e22fbe55212ae6482feb4">table of
+identifiers</a>
+for the parsed translation unit.</p>
+</div>
+<div class="section" id="ast-nodes">
+<h2>AST Nodes<a class="headerlink" href="#ast-nodes" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s AST nodes are modeled on a class hierarchy that does not have a
+common ancestor. Instead, there are multiple larger hierarchies for
+basic node types like
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a> and
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>. Many
+important AST nodes derive from
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>,
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>,
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html">DeclContext</a>
+or <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>, with
+some classes deriving from both Decl and DeclContext.</p>
+<p>There are also a multitude of nodes in the AST that are not part of a
+larger hierarchy, and are only reachable from specific other nodes, like
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1CXXBaseSpecifier.html">CXXBaseSpecifier</a>.</p>
+<p>Thus, to traverse the full AST, one starts from the
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html">TranslationUnitDecl</a>
+and then recursively traverses everything that can be reached from that
+node - this information has to be encoded for each specific node type.
+This algorithm is encoded in the
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html">RecursiveASTVisitor</a>.
+See the <a class="reference external" href="http://clang.llvm.org/docs/RAVFrontendAction.html">RecursiveASTVisitor
+tutorial</a>.</p>
+<p>The two most basic nodes in the Clang AST are statements
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>) and
+declarations
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>). Note
+that expressions
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>) are
+also statements in Clang’s AST.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="ExternalClangExamples.html">External Clang Examples</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibTooling.html">LibTooling</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/JSONCompilationDatabase.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/JSONCompilationDatabase.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/JSONCompilationDatabase.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/JSONCompilationDatabase.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,153 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>JSON Compilation Database Format Specification — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Overview" href="ClangTools.html" />
+    <link rel="prev" title="How To Setup Clang Tooling For LLVM" href="HowToSetupToolingForLLVM.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>JSON Compilation Database Format Specification</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangTools.html">Overview</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="json-compilation-database-format-specification">
+<h1>JSON Compilation Database Format Specification<a class="headerlink" href="#json-compilation-database-format-specification" title="Permalink to this headline">¶</a></h1>
+<p>This document describes a format for specifying how to replay single
+compilations independently of the build system.</p>
+<div class="section" id="background">
+<h2>Background<a class="headerlink" href="#background" title="Permalink to this headline">¶</a></h2>
+<p>Tools based on the C++ Abstract Syntax Tree need full information how to
+parse a translation unit. Usually this information is implicitly
+available in the build system, but running tools as part of the build
+system is not necessarily the best solution:</p>
+<ul class="simple">
+<li>Build systems are inherently change driven, so running multiple tools
+over the same code base without changing the code does not fit into
+the architecture of many build systems.</li>
+<li>Figuring out whether things have changed is often an IO bound
+process; this makes it hard to build low latency end user tools based
+on the build system.</li>
+<li>Build systems are inherently sequential in the build graph, for
+example due to generated source code. While tools that run
+independently of the build still need the generated source code to
+exist, running tools multiple times over unchanging source does not
+require serialization of the runs according to the build dependency
+graph.</li>
+</ul>
+</div>
+<div class="section" id="supported-systems">
+<h2>Supported Systems<a class="headerlink" href="#supported-systems" title="Permalink to this headline">¶</a></h2>
+<p>Currently <a class="reference external" href="http://cmake.org">CMake</a> (since 2.8.5) supports generation
+of compilation databases for Unix Makefile builds (Ninja builds in the
+works) with the option <tt class="docutils literal"><span class="pre">CMAKE_EXPORT_COMPILE_COMMANDS</span></tt>.</p>
+<p>For projects on Linux, there is an alternative to intercept compiler
+calls with a tool called <a class="reference external" href="https://github.com/rizsotto/Bear">Bear</a>.</p>
+<p>Clang’s tooling interface supports reading compilation databases; see
+the <a class="reference internal" href="LibTooling.html"><em>LibTooling documentation</em></a>. libclang and its
+python bindings also support this (since clang 3.2); see
+<a class="reference external" href="/doxygen/group__COMPILATIONDB.html">CXCompilationDatabase.h</a>.</p>
+</div>
+<div class="section" id="format">
+<h2>Format<a class="headerlink" href="#format" title="Permalink to this headline">¶</a></h2>
+<p>A compilation database is a JSON file, which consist of an array of
+“command objects”, where each command object specifies one way a
+translation unit is compiled in the project.</p>
+<p>Each command object contains the translation unit’s main file, the
+working directory of the compile run and the actual compile command.</p>
+<p>Example:</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span>
+  <span class="p">{</span> <span class="s">"directory"</span><span class="p">:</span> <span class="s">"/home/user/llvm/build"</span><span class="p">,</span>
+    <span class="s">"command"</span><span class="p">:</span> <span class="s">"/usr/bin/clang++ -Irelative -DSOMEDEF=</span><span class="se">\"</span><span class="s">With spaces, quotes and </span><span class="se">\\</span><span class="s">-es.</span><span class="se">\"</span><span class="s"> -c -o file.o file.cc"</span><span class="p">,</span>
+    <span class="s">"file"</span><span class="p">:</span> <span class="s">"file.cc"</span> <span class="p">},</span>
+  <span class="o">...</span>
+<span class="p">]</span>
+</pre></div>
+</div>
+<p>The contracts for each field in the command object are:</p>
+<ul class="simple">
+<li><strong>directory:</strong> The working directory of the compilation. All paths
+specified in the <strong>command</strong> or <strong>file</strong> fields must be either
+absolute or relative to this directory.</li>
+<li><strong>file:</strong> The main translation unit source processed by this
+compilation step. This is used by tools as the key into the
+compilation database. There can be multiple command objects for the
+same file, for example if the same source file is compiled with
+different configurations.</li>
+<li><strong>command:</strong> The compile command executed. After JSON unescaping,
+this must be a valid command to rerun the exact compilation step for
+the translation unit in the environment the build system uses.
+Parameters use shell quoting and shell escaping of quotes, with ‘<tt class="docutils literal"><span class="pre">"</span></tt>‘
+and ‘<tt class="docutils literal"><span class="pre">\</span></tt>‘ being the only special characters. Shell expansion is not
+supported.</li>
+</ul>
+</div>
+<div class="section" id="build-system-integration">
+<h2>Build System Integration<a class="headerlink" href="#build-system-integration" title="Permalink to this headline">¶</a></h2>
+<p>The convention is to name the file compile_commands.json and put it at
+the top of the build directory. Clang tools are pointed to the top of
+the build directory to detect the file and use the compilation database
+to parse C++ code in the source tree.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangTools.html">Overview</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LanguageExtensions.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LanguageExtensions.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LanguageExtensions.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,1687 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Clang Language Extensions — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Objective-C Literals" href="ObjectiveCLiterals.html" />
+    <link rel="prev" title="Clang Compiler User’s Manual" href="UsersManual.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Clang Language Extensions</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="UsersManual.html">Clang Compiler User’s Manual</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ObjectiveCLiterals.html">Objective-C Literals</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-language-extensions">
+<h1>Clang Language Extensions<a class="headerlink" href="#clang-language-extensions" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#feature-checking-macros" id="id2">Feature Checking Macros</a></li>
+<li><a class="reference internal" href="#include-file-checking-macros" id="id3">Include File Checking Macros</a></li>
+<li><a class="reference internal" href="#builtin-macros" id="id4">Builtin Macros</a></li>
+<li><a class="reference internal" href="#vectors-and-extended-vectors" id="id5">Vectors and Extended Vectors</a></li>
+<li><a class="reference internal" href="#messages-on-deprecated-and-unavailable-attributes" id="id6">Messages on <tt class="docutils literal"><span class="pre">deprecated</span></tt> and <tt class="docutils literal"><span class="pre">unavailable</span></tt> Attributes</a></li>
+<li><a class="reference internal" href="#attributes-on-enumerators" id="id7">Attributes on Enumerators</a></li>
+<li><a class="reference internal" href="#user-specified-system-frameworks" id="id8">‘User-Specified’ System Frameworks</a></li>
+<li><a class="reference internal" href="#checks-for-standard-language-features" id="id9">Checks for Standard Language Features</a></li>
+<li><a class="reference internal" href="#checks-for-type-trait-primitives" id="id10">Checks for Type Trait Primitives</a></li>
+<li><a class="reference internal" href="#blocks" id="id11">Blocks</a></li>
+<li><a class="reference internal" href="#objective-c-features" id="id12">Objective-C Features</a></li>
+<li><a class="reference internal" href="#initializer-lists-for-complex-numbers-in-c" id="id13">Initializer lists for complex numbers in C</a></li>
+<li><a class="reference internal" href="#builtin-functions" id="id14">Builtin Functions</a></li>
+<li><a class="reference internal" href="#non-standard-c-11-attributes" id="id15">Non-standard C++11 Attributes</a></li>
+<li><a class="reference internal" href="#target-specific-extensions" id="id16">Target-Specific Extensions</a></li>
+<li><a class="reference internal" href="#extensions-for-static-analysis" id="id17">Extensions for Static Analysis</a></li>
+<li><a class="reference internal" href="#extensions-for-dynamic-analysis" id="id18">Extensions for Dynamic Analysis</a></li>
+<li><a class="reference internal" href="#extensions-for-selectively-disabling-optimization" id="id19">Extensions for selectively disabling optimization</a></li>
+<li><a class="reference internal" href="#extensions-for-loop-hint-optimizations" id="id20">Extensions for loop hint optimizations</a></li>
+</ul>
+</div>
+<div class="toctree-wrapper compound">
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document describes the language extensions provided by Clang.  In addition
+to the language extensions listed here, Clang aims to support a broad range of
+GCC extensions.  Please see the <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html">GCC manual</a> for more information on
+these extensions.</p>
+</div>
+<div class="section" id="feature-checking-macros">
+<span id="langext-feature-check"></span><h2><a class="toc-backref" href="#id2">Feature Checking Macros</a><a class="headerlink" href="#feature-checking-macros" title="Permalink to this headline">¶</a></h2>
+<p>Language extensions can be very useful, but only if you know you can depend on
+them.  In order to allow fine-grain features checks, we support three builtin
+function-like macros.  This allows you to directly test for a feature in your
+code without having to resort to something like autoconf or fragile “compiler
+version checks”.</p>
+<div class="section" id="has-builtin">
+<h3><tt class="docutils literal"><span class="pre">__has_builtin</span></tt><a class="headerlink" href="#has-builtin" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that is the name of
+a builtin function.  It evaluates to 1 if the builtin is supported or 0 if not.
+It can be used like this:</p>
+<div class="highlight-c++"><pre>#ifndef __has_builtin         // Optional of course.
+  #define __has_builtin(x) 0  // Compatibility with non-clang compilers.
+#endif
+
+...
+#if __has_builtin(__builtin_trap)
+  __builtin_trap();
+#else
+  abort();
+#endif
+...</pre>
+</div>
+</div>
+<div class="section" id="has-feature-and-has-extension">
+<span id="langext-has-feature-has-extension"></span><h3><tt class="docutils literal"><span class="pre">__has_feature</span></tt> and <tt class="docutils literal"><span class="pre">__has_extension</span></tt><a class="headerlink" href="#has-feature-and-has-extension" title="Permalink to this headline">¶</a></h3>
+<p>These function-like macros take a single identifier argument that is the name
+of a feature.  <tt class="docutils literal"><span class="pre">__has_feature</span></tt> evaluates to 1 if the feature is both
+supported by Clang and standardized in the current language standard or 0 if
+not (but see <a class="reference internal" href="#langext-has-feature-back-compat"><em>below</em></a>), while
+<tt class="docutils literal"><span class="pre">__has_extension</span></tt> evaluates to 1 if the feature is supported by Clang in the
+current language (either as a language extension or a standard language
+feature) or 0 if not.  They can be used like this:</p>
+<div class="highlight-c++"><pre>#ifndef __has_feature         // Optional of course.
+  #define __has_feature(x) 0  // Compatibility with non-clang compilers.
+#endif
+#ifndef __has_extension
+  #define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
+#endif
+
+...
+#if __has_feature(cxx_rvalue_references)
+// This code will only be compiled with the -std=c++11 and -std=gnu++11
+// options, because rvalue references are only standardized in C++11.
+#endif
+
+#if __has_extension(cxx_rvalue_references)
+// This code will be compiled with the -std=c++11, -std=gnu++11, -std=c++98
+// and -std=gnu++98 options, because rvalue references are supported as a
+// language extension in C++98.
+#endif</pre>
+</div>
+<p id="langext-has-feature-back-compat">For backward compatibility, <tt class="docutils literal"><span class="pre">__has_feature</span></tt> can also be used to test
+for support for non-standardized features, i.e. features not prefixed <tt class="docutils literal"><span class="pre">c_</span></tt>,
+<tt class="docutils literal"><span class="pre">cxx_</span></tt> or <tt class="docutils literal"><span class="pre">objc_</span></tt>.</p>
+<p>Another use of <tt class="docutils literal"><span class="pre">__has_feature</span></tt> is to check for compiler features not related
+to the language standard, such as e.g. <a class="reference internal" href="AddressSanitizer.html"><em>AddressSanitizer</em></a>.</p>
+<p>If the <tt class="docutils literal"><span class="pre">-pedantic-errors</span></tt> option is given, <tt class="docutils literal"><span class="pre">__has_extension</span></tt> is equivalent
+to <tt class="docutils literal"><span class="pre">__has_feature</span></tt>.</p>
+<p>The feature tag is described along with the language feature below.</p>
+<p>The feature name or extension name can also be specified with a preceding and
+following <tt class="docutils literal"><span class="pre">__</span></tt> (double underscore) to avoid interference from a macro with
+the same name.  For instance, <tt class="docutils literal"><span class="pre">__cxx_rvalue_references__</span></tt> can be used instead
+of <tt class="docutils literal"><span class="pre">cxx_rvalue_references</span></tt>.</p>
+</div>
+<div class="section" id="has-attribute">
+<h3><tt class="docutils literal"><span class="pre">__has_attribute</span></tt><a class="headerlink" href="#has-attribute" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that is the name of
+an attribute.  It evaluates to 1 if the attribute is supported by the current
+compilation target, or 0 if not.  It can be used like this:</p>
+<div class="highlight-c++"><pre>#ifndef __has_attribute         // Optional of course.
+  #define __has_attribute(x) 0  // Compatibility with non-clang compilers.
+#endif
+
+...
+#if __has_attribute(always_inline)
+#define ALWAYS_INLINE __attribute__((always_inline))
+#else
+#define ALWAYS_INLINE
+#endif
+...</pre>
+</div>
+<p>The attribute name can also be specified with a preceding and following <tt class="docutils literal"><span class="pre">__</span></tt>
+(double underscore) to avoid interference from a macro with the same name.  For
+instance, <tt class="docutils literal"><span class="pre">__always_inline__</span></tt> can be used instead of <tt class="docutils literal"><span class="pre">always_inline</span></tt>.</p>
+</div>
+<div class="section" id="is-identifier">
+<h3><tt class="docutils literal"><span class="pre">__is_identifier</span></tt><a class="headerlink" href="#is-identifier" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that might be either
+a reserved word or a regular identifier. It evaluates to 1 if the argument is just
+a regular identifier and not a reserved word, in the sense that it can then be
+used as the name of a user-defined function or variable. Otherwise it evaluates
+to 0.  It can be used like this:</p>
+<div class="highlight-c++"><pre>...
+#ifdef __is_identifier          // Compatibility with non-clang compilers.
+  #if __is_identifier(__wchar_t)
+    typedef wchar_t __wchar_t;
+  #endif
+#endif
+
+__wchar_t WideCharacter;
+...</pre>
+</div>
+</div>
+</div>
+<div class="section" id="include-file-checking-macros">
+<h2><a class="toc-backref" href="#id3">Include File Checking Macros</a><a class="headerlink" href="#include-file-checking-macros" title="Permalink to this headline">¶</a></h2>
+<p>Not all developments systems have the same include files.  The
+<a class="reference internal" href="#langext-has-include"><em>__has_include</em></a> and <a class="reference internal" href="#langext-has-include-next"><em>__has_include_next</em></a> macros allow
+you to check for the existence of an include file before doing a possibly
+failing <tt class="docutils literal"><span class="pre">#include</span></tt> directive.  Include file checking macros must be used
+as expressions in <tt class="docutils literal"><span class="pre">#if</span></tt> or <tt class="docutils literal"><span class="pre">#elif</span></tt> preprocessing directives.</p>
+<div class="section" id="has-include">
+<span id="langext-has-include"></span><h3><tt class="docutils literal"><span class="pre">__has_include</span></tt><a class="headerlink" href="#has-include" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single file name string argument that is the
+name of an include file.  It evaluates to 1 if the file can be found using the
+include paths, or 0 otherwise:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Note the two possible file name string formats.</span>
+<span class="cp">#if __has_include("myinclude.h") && __has_include(<stdint.h>)</span>
+<span class="cp"># include "myinclude.h"</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>To test for this feature, use <tt class="docutils literal"><span class="pre">#if</span> <span class="pre">defined(__has_include)</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// To avoid problem with non-clang compilers not having this macro.</span>
+<span class="cp">#if defined(__has_include)</span>
+<span class="cp">#if __has_include("myinclude.h")</span>
+<span class="cp"># include "myinclude.h"</span>
+<span class="cp">#endif</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="has-include-next">
+<span id="langext-has-include-next"></span><h3><tt class="docutils literal"><span class="pre">__has_include_next</span></tt><a class="headerlink" href="#has-include-next" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single file name string argument that is the
+name of an include file.  It is like <tt class="docutils literal"><span class="pre">__has_include</span></tt> except that it looks for
+the second instance of the given file found in the include paths.  It evaluates
+to 1 if the second instance of the file can be found using the include paths,
+or 0 otherwise:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Note the two possible file name string formats.</span>
+<span class="cp">#if __has_include_next("myinclude.h") && __has_include_next(<stdint.h>)</span>
+<span class="cp"># include_next "myinclude.h"</span>
+<span class="cp">#endif</span>
+
+<span class="c1">// To avoid problem with non-clang compilers not having this macro.</span>
+<span class="cp">#if defined(__has_include_next)</span>
+<span class="cp">#if __has_include_next("myinclude.h")</span>
+<span class="cp"># include_next "myinclude.h"</span>
+<span class="cp">#endif</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>Note that <tt class="docutils literal"><span class="pre">__has_include_next</span></tt>, like the GNU extension <tt class="docutils literal"><span class="pre">#include_next</span></tt>
+directive, is intended for use in headers only, and will issue a warning if
+used in the top-level compilation file.  A warning will also be issued if an
+absolute path is used in the file argument.</p>
+</div>
+<div class="section" id="has-warning">
+<h3><tt class="docutils literal"><span class="pre">__has_warning</span></tt><a class="headerlink" href="#has-warning" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a string literal that represents a command line
+option for a warning and returns true if that is a valid warning option.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#if __has_warning("-Wformat")</span>
+<span class="p">...</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="builtin-macros">
+<h2><a class="toc-backref" href="#id4">Builtin Macros</a><a class="headerlink" href="#builtin-macros" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">__BASE_FILE__</span></tt></dt>
+<dd>Defined to a string that contains the name of the main input file passed to
+Clang.</dd>
+<dt><tt class="docutils literal"><span class="pre">__COUNTER__</span></tt></dt>
+<dd>Defined to an integer value that starts at zero and is incremented each time
+the <tt class="docutils literal"><span class="pre">__COUNTER__</span></tt> macro is expanded.</dd>
+<dt><tt class="docutils literal"><span class="pre">__INCLUDE_LEVEL__</span></tt></dt>
+<dd>Defined to an integral value that is the include depth of the file currently
+being translated.  For the main file, this value is zero.</dd>
+<dt><tt class="docutils literal"><span class="pre">__TIMESTAMP__</span></tt></dt>
+<dd>Defined to the date and time of the last modification of the current source
+file.</dd>
+<dt><tt class="docutils literal"><span class="pre">__clang__</span></tt></dt>
+<dd>Defined when compiling with Clang</dd>
+<dt><tt class="docutils literal"><span class="pre">__clang_major__</span></tt></dt>
+<dd>Defined to the major marketing version number of Clang (e.g., the 2 in
+2.0.1).  Note that marketing version numbers should not be used to check for
+language features, as different vendors use different numbering schemes.
+Instead, use the <a class="reference internal" href="#langext-feature-check"><em>Feature Checking Macros</em></a>.</dd>
+<dt><tt class="docutils literal"><span class="pre">__clang_minor__</span></tt></dt>
+<dd>Defined to the minor version number of Clang (e.g., the 0 in 2.0.1).  Note
+that marketing version numbers should not be used to check for language
+features, as different vendors use different numbering schemes.  Instead, use
+the <a class="reference internal" href="#langext-feature-check"><em>Feature Checking Macros</em></a>.</dd>
+<dt><tt class="docutils literal"><span class="pre">__clang_patchlevel__</span></tt></dt>
+<dd>Defined to the marketing patch level of Clang (e.g., the 1 in 2.0.1).</dd>
+<dt><tt class="docutils literal"><span class="pre">__clang_version__</span></tt></dt>
+<dd>Defined to a string that captures the Clang marketing version, including the
+Subversion tag or revision number, e.g., “<tt class="docutils literal"><span class="pre">1.5</span> <span class="pre">(trunk</span> <span class="pre">102332)</span></tt>”.</dd>
+</dl>
+</div>
+<div class="section" id="vectors-and-extended-vectors">
+<span id="langext-vectors"></span><h2><a class="toc-backref" href="#id5">Vectors and Extended Vectors</a><a class="headerlink" href="#vectors-and-extended-vectors" title="Permalink to this headline">¶</a></h2>
+<p>Supports the GCC, OpenCL, AltiVec and NEON vector extensions.</p>
+<p>OpenCL vector types are created using <tt class="docutils literal"><span class="pre">ext_vector_type</span></tt> attribute.  It
+support for <tt class="docutils literal"><span class="pre">V.xyzw</span></tt> syntax and other tidbits as seen in OpenCL.  An example
+is:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="kt">float</span> <span class="n">float4</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">4</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float2</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">2</span><span class="p">)));</span>
+
+<span class="n">float4</span> <span class="nf">foo</span><span class="p">(</span><span class="n">float2</span> <span class="n">a</span><span class="p">,</span> <span class="n">float2</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">float4</span> <span class="n">c</span><span class="p">;</span>
+  <span class="n">c</span><span class="p">.</span><span class="n">xz</span> <span class="o">=</span> <span class="n">a</span><span class="p">;</span>
+  <span class="n">c</span><span class="p">.</span><span class="n">yw</span> <span class="o">=</span> <span class="n">b</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">c</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_extension(attribute_ext_vector_type)</span></tt>.</p>
+<p>Giving <tt class="docutils literal"><span class="pre">-faltivec</span></tt> option to clang enables support for AltiVec vector syntax
+and functions.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">vector</span> <span class="kt">float</span> <span class="nf">foo</span><span class="p">(</span><span class="n">vector</span> <span class="kt">int</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">vector</span> <span class="kt">int</span> <span class="n">b</span><span class="p">;</span>
+  <span class="n">b</span> <span class="o">=</span> <span class="n">vec_add</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span> <span class="o">+</span> <span class="n">a</span><span class="p">;</span>
+  <span class="k">return</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">float</span><span class="p">)</span><span class="n">b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>NEON vector types are created using <tt class="docutils literal"><span class="pre">neon_vector_type</span></tt> and
+<tt class="docutils literal"><span class="pre">neon_polyvector_type</span></tt> attributes.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">neon_vector_type</span><span class="p">(</span><span class="mi">8</span><span class="p">)))</span> <span class="kt">int8_t</span> <span class="kt">int8x8_t</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">neon_polyvector_type</span><span class="p">(</span><span class="mi">16</span><span class="p">)))</span> <span class="kt">poly8_t</span> <span class="kt">poly8x16_t</span><span class="p">;</span>
+
+<span class="kt">int8x8_t</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int8x8_t</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span>
+  <span class="kt">int8x8_t</span> <span class="n">v</span><span class="p">;</span>
+  <span class="n">v</span> <span class="o">=</span> <span class="n">a</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">v</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<div class="section" id="vector-literals">
+<h3>Vector Literals<a class="headerlink" href="#vector-literals" title="Permalink to this headline">¶</a></h3>
+<p>Vector literals can be used to create vectors from a set of scalars, or
+vectors.  Either parentheses or braces form can be used.  In the parentheses
+form the number of literal values specified must be one, i.e. referring to a
+scalar value, or must match the size of the vector type being created.  If a
+single scalar literal value is specified, the scalar literal value will be
+replicated to all the components of the vector type.  In the brackets form any
+number of literals can be specified.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="kt">int</span> <span class="n">v4si</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">16</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float4</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">4</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float2</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">2</span><span class="p">)));</span>
+
+<span class="n">v4si</span> <span class="n">vsi</span> <span class="o">=</span> <span class="p">(</span><span class="n">v4si</span><span class="p">){</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">};</span>
+<span class="n">float4</span> <span class="n">vf</span> <span class="o">=</span> <span class="p">(</span><span class="n">float4</span><span class="p">)(</span><span class="mf">1.0f</span><span class="p">,</span> <span class="mf">2.0f</span><span class="p">,</span> <span class="mf">3.0f</span><span class="p">,</span> <span class="mf">4.0f</span><span class="p">);</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi1</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">);</span>    <span class="c1">// vi1 will be (1, 1, 1, 1).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi2</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">){</span><span class="mi">1</span><span class="p">};</span>    <span class="c1">// vi2 will be (1, 0, 0, 0).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi3</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> <span class="c1">// error</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi4</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">){</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">};</span> <span class="c1">// vi4 will be (1, 2, 0, 0).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi5</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">);</span>
+<span class="n">float4</span> <span class="n">vf</span> <span class="o">=</span> <span class="p">(</span><span class="n">float4</span><span class="p">)((</span><span class="n">float2</span><span class="p">)(</span><span class="mf">1.0f</span><span class="p">,</span> <span class="mf">2.0f</span><span class="p">),</span> <span class="p">(</span><span class="n">float2</span><span class="p">)(</span><span class="mf">3.0f</span><span class="p">,</span> <span class="mf">4.0f</span><span class="p">));</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="vector-operations">
+<h3>Vector Operations<a class="headerlink" href="#vector-operations" title="Permalink to this headline">¶</a></h3>
+<p>The table below shows the support for each operation by vector extension.  A
+dash indicates that an operation is not accepted according to a corresponding
+specification.</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="60%" />
+<col width="12%" />
+<col width="14%" />
+<col width="6%" />
+<col width="8%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Opeator</th>
+<th class="head">OpenCL</th>
+<th class="head">AltiVec</th>
+<th class="head">GCC</th>
+<th class="head">NEON</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>[]</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>unary operators +, –</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>++, – –</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>+,–,*,/,%</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>bitwise operators &,|,^,~</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>>>,<<</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>!, &&, ||</td>
+<td>no</td>
+<td>–</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>==, !=, >, <, >=, <=</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>=</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr class="row-odd"><td>:?</td>
+<td>yes</td>
+<td>–</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>sizeof</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+</tbody>
+</table>
+<p>See also <a class="reference internal" href="#langext-builtin-shufflevector"><em>__builtin_shufflevector</em></a>.</p>
+</div>
+</div>
+<div class="section" id="messages-on-deprecated-and-unavailable-attributes">
+<h2><a class="toc-backref" href="#id6">Messages on <tt class="docutils literal"><span class="pre">deprecated</span></tt> and <tt class="docutils literal"><span class="pre">unavailable</span></tt> Attributes</a><a class="headerlink" href="#messages-on-deprecated-and-unavailable-attributes" title="Permalink to this headline">¶</a></h2>
+<p>An optional string message can be added to the <tt class="docutils literal"><span class="pre">deprecated</span></tt> and
+<tt class="docutils literal"><span class="pre">unavailable</span></tt> attributes.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">explode</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">(</span><span class="s">"extremely unsafe, use 'combust' instead!!!"</span><span class="p">)));</span>
+</pre></div>
+</div>
+<p>If the deprecated or unavailable declaration is used, the message will be
+incorporated into the appropriate diagnostic:</p>
+<div class="highlight-c++"><pre>harmless.c:4:3: warning: 'explode' is deprecated: extremely unsafe, use 'combust' instead!!!
+      [-Wdeprecated-declarations]
+  explode();
+  ^</pre>
+</div>
+<p>Query for this feature with
+<tt class="docutils literal"><span class="pre">__has_extension(attribute_deprecated_with_message)</span></tt> and
+<tt class="docutils literal"><span class="pre">__has_extension(attribute_unavailable_with_message)</span></tt>.</p>
+</div>
+<div class="section" id="attributes-on-enumerators">
+<h2><a class="toc-backref" href="#id7">Attributes on Enumerators</a><a class="headerlink" href="#attributes-on-enumerators" title="Permalink to this headline">¶</a></h2>
+<p>Clang allows attributes to be written on individual enumerators.  This allows
+enumerators to be deprecated, made unavailable, etc.  The attribute must appear
+after the enumerator name and before any initializer, like so:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">enum</span> <span class="n">OperationMode</span> <span class="p">{</span>
+  <span class="n">OM_Invalid</span><span class="p">,</span>
+  <span class="n">OM_Normal</span><span class="p">,</span>
+  <span class="n">OM_Terrified</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">)),</span>
+  <span class="n">OM_AbortOnError</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">))</span> <span class="o">=</span> <span class="mi">4</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Attributes on the <tt class="docutils literal"><span class="pre">enum</span></tt> declaration do not apply to individual enumerators.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_extension(enumerator_attributes)</span></tt>.</p>
+</div>
+<div class="section" id="user-specified-system-frameworks">
+<h2><a class="toc-backref" href="#id8">‘User-Specified’ System Frameworks</a><a class="headerlink" href="#user-specified-system-frameworks" title="Permalink to this headline">¶</a></h2>
+<p>Clang provides a mechanism by which frameworks can be built in such a way that
+they will always be treated as being “system frameworks”, even if they are not
+present in a system framework directory.  This can be useful to system
+framework developers who want to be able to test building other applications
+with development builds of their framework, including the manner in which the
+compiler changes warning behavior for system headers.</p>
+<p>Framework developers can opt-in to this mechanism by creating a
+“<tt class="docutils literal"><span class="pre">.system_framework</span></tt>” file at the top-level of their framework.  That is, the
+framework should have contents like:</p>
+<div class="highlight-none"><div class="highlight"><pre>.../TestFramework.framework
+.../TestFramework.framework/.system_framework
+.../TestFramework.framework/Headers
+.../TestFramework.framework/Headers/TestFramework.h
+...
+</pre></div>
+</div>
+<p>Clang will treat the presence of this file as an indicator that the framework
+should be treated as a system framework, regardless of how it was found in the
+framework search path.  For consistency, we recommend that such files never be
+included in installed versions of the framework.</p>
+</div>
+<div class="section" id="checks-for-standard-language-features">
+<h2><a class="toc-backref" href="#id9">Checks for Standard Language Features</a><a class="headerlink" href="#checks-for-standard-language-features" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">__has_feature</span></tt> macro can be used to query if certain standard language
+features are enabled.  The <tt class="docutils literal"><span class="pre">__has_extension</span></tt> macro can be used to query if
+language features are available as an extension when compiling for a standard
+which does not provide them.  The features which can be tested are listed here.</p>
+<div class="section" id="c-98">
+<h3>C++98<a class="headerlink" href="#c-98" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C++98 standard.  These features are
+enabled by default when compiling C++ code.</p>
+<div class="section" id="c-exceptions">
+<h4>C++ exceptions<a class="headerlink" href="#c-exceptions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_exceptions)</span></tt> to determine if C++ exceptions have been
+enabled.  For example, compiling code with <tt class="docutils literal"><span class="pre">-fno-exceptions</span></tt> disables C++
+exceptions.</p>
+</div>
+<div class="section" id="c-rtti">
+<h4>C++ RTTI<a class="headerlink" href="#c-rtti" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_rtti)</span></tt> to determine if C++ RTTI has been enabled.  For
+example, compiling code with <tt class="docutils literal"><span class="pre">-fno-rtti</span></tt> disables the use of RTTI.</p>
+</div>
+</div>
+<div class="section" id="c-11">
+<h3>C++11<a class="headerlink" href="#c-11" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C++11 standard.  As a result, all
+these features are enabled with the <tt class="docutils literal"><span class="pre">-std=c++11</span></tt> or <tt class="docutils literal"><span class="pre">-std=gnu++11</span></tt> option
+when compiling C++ code.</p>
+<div class="section" id="c-11-sfinae-includes-access-control">
+<h4>C++11 SFINAE includes access control<a class="headerlink" href="#c-11-sfinae-includes-access-control" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_access_control_sfinae)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_access_control_sfinae)</span></tt> to determine whether
+access-control errors (e.g., calling a private constructor) are considered to
+be template argument deduction errors (aka SFINAE errors), per <a class="reference external" href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170">C++ DR1170</a>.</p>
+</div>
+<div class="section" id="c-11-alias-templates">
+<h4>C++11 alias templates<a class="headerlink" href="#c-11-alias-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_alias_templates)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_alias_templates)</span></tt> to determine if support for C++11’s
+alias declarations and alias templates is enabled.</p>
+</div>
+<div class="section" id="c-11-alignment-specifiers">
+<h4>C++11 alignment specifiers<a class="headerlink" href="#c-11-alignment-specifiers" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_alignas)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_alignas)</span></tt> to
+determine if support for alignment specifiers using <tt class="docutils literal"><span class="pre">alignas</span></tt> is enabled.</p>
+</div>
+<div class="section" id="c-11-attributes">
+<h4>C++11 attributes<a class="headerlink" href="#c-11-attributes" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_attributes)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_attributes)</span></tt> to
+determine if support for attribute parsing with C++11’s square bracket notation
+is enabled.</p>
+</div>
+<div class="section" id="c-11-generalized-constant-expressions">
+<h4>C++11 generalized constant expressions<a class="headerlink" href="#c-11-generalized-constant-expressions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_constexpr)</span></tt> to determine if support for generalized
+constant expressions (e.g., <tt class="docutils literal"><span class="pre">constexpr</span></tt>) is enabled.</p>
+</div>
+<div class="section" id="c-11-decltype">
+<h4>C++11 <tt class="docutils literal"><span class="pre">decltype()</span></tt><a class="headerlink" href="#c-11-decltype" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_decltype)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_decltype)</span></tt> to
+determine if support for the <tt class="docutils literal"><span class="pre">decltype()</span></tt> specifier is enabled.  C++11’s
+<tt class="docutils literal"><span class="pre">decltype</span></tt> does not require type-completeness of a function call expression.
+Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_decltype_incomplete_return_types)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_decltype_incomplete_return_types)</span></tt> to determine if
+support for this feature is enabled.</p>
+</div>
+<div class="section" id="c-11-default-template-arguments-in-function-templates">
+<h4>C++11 default template arguments in function templates<a class="headerlink" href="#c-11-default-template-arguments-in-function-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_default_function_template_args)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_default_function_template_args)</span></tt> to determine if support
+for default template arguments in function templates is enabled.</p>
+</div>
+<div class="section" id="c-11-defaulted-functions">
+<h4>C++11 <tt class="docutils literal"><span class="pre">default</span></tt>ed functions<a class="headerlink" href="#c-11-defaulted-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_defaulted_functions)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_defaulted_functions)</span></tt> to determine if support for
+defaulted function definitions (with <tt class="docutils literal"><span class="pre">=</span> <span class="pre">default</span></tt>) is enabled.</p>
+</div>
+<div class="section" id="c-11-delegating-constructors">
+<h4>C++11 delegating constructors<a class="headerlink" href="#c-11-delegating-constructors" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_delegating_constructors)</span></tt> to determine if support for
+delegating constructors is enabled.</p>
+</div>
+<div class="section" id="c-11-deleted-functions">
+<h4>C++11 <tt class="docutils literal"><span class="pre">deleted</span></tt> functions<a class="headerlink" href="#c-11-deleted-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_deleted_functions)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_deleted_functions)</span></tt> to determine if support for deleted
+function definitions (with <tt class="docutils literal"><span class="pre">=</span> <span class="pre">delete</span></tt>) is enabled.</p>
+</div>
+<div class="section" id="c-11-explicit-conversion-functions">
+<h4>C++11 explicit conversion functions<a class="headerlink" href="#c-11-explicit-conversion-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_explicit_conversions)</span></tt> to determine if support for
+<tt class="docutils literal"><span class="pre">explicit</span></tt> conversion functions is enabled.</p>
+</div>
+<div class="section" id="c-11-generalized-initializers">
+<h4>C++11 generalized initializers<a class="headerlink" href="#c-11-generalized-initializers" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_generalized_initializers)</span></tt> to determine if support for
+generalized initializers (using braced lists and <tt class="docutils literal"><span class="pre">std::initializer_list</span></tt>) is
+enabled.</p>
+</div>
+<div class="section" id="c-11-implicit-move-constructors-assignment-operators">
+<h4>C++11 implicit move constructors/assignment operators<a class="headerlink" href="#c-11-implicit-move-constructors-assignment-operators" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_implicit_moves)</span></tt> to determine if Clang will implicitly
+generate move constructors and move assignment operators where needed.</p>
+</div>
+<div class="section" id="c-11-inheriting-constructors">
+<h4>C++11 inheriting constructors<a class="headerlink" href="#c-11-inheriting-constructors" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_inheriting_constructors)</span></tt> to determine if support for
+inheriting constructors is enabled.</p>
+</div>
+<div class="section" id="c-11-inline-namespaces">
+<h4>C++11 inline namespaces<a class="headerlink" href="#c-11-inline-namespaces" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_inline_namespaces)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_inline_namespaces)</span></tt> to determine if support for inline
+namespaces is enabled.</p>
+</div>
+<div class="section" id="c-11-lambdas">
+<h4>C++11 lambdas<a class="headerlink" href="#c-11-lambdas" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_lambdas)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_lambdas)</span></tt> to
+determine if support for lambdas is enabled.</p>
+</div>
+<div class="section" id="c-11-local-and-unnamed-types-as-template-arguments">
+<h4>C++11 local and unnamed types as template arguments<a class="headerlink" href="#c-11-local-and-unnamed-types-as-template-arguments" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_local_type_template_args)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_local_type_template_args)</span></tt> to determine if support for
+local and unnamed types as template arguments is enabled.</p>
+</div>
+<div class="section" id="c-11-noexcept">
+<h4>C++11 noexcept<a class="headerlink" href="#c-11-noexcept" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_noexcept)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_noexcept)</span></tt> to
+determine if support for noexcept exception specifications is enabled.</p>
+</div>
+<div class="section" id="c-11-in-class-non-static-data-member-initialization">
+<h4>C++11 in-class non-static data member initialization<a class="headerlink" href="#c-11-in-class-non-static-data-member-initialization" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_nonstatic_member_init)</span></tt> to determine whether in-class
+initialization of non-static data members is enabled.</p>
+</div>
+<div class="section" id="c-11-nullptr">
+<h4>C++11 <tt class="docutils literal"><span class="pre">nullptr</span></tt><a class="headerlink" href="#c-11-nullptr" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_nullptr)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_nullptr)</span></tt> to
+determine if support for <tt class="docutils literal"><span class="pre">nullptr</span></tt> is enabled.</p>
+</div>
+<div class="section" id="c-11-override-control">
+<h4>C++11 <tt class="docutils literal"><span class="pre">override</span> <span class="pre">control</span></tt><a class="headerlink" href="#c-11-override-control" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_override_control)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_override_control)</span></tt> to determine if support for the
+override control keywords is enabled.</p>
+</div>
+<div class="section" id="c-11-reference-qualified-functions">
+<h4>C++11 reference-qualified functions<a class="headerlink" href="#c-11-reference-qualified-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_reference_qualified_functions)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_reference_qualified_functions)</span></tt> to determine if support
+for reference-qualified functions (e.g., member functions with <tt class="docutils literal"><span class="pre">&</span></tt> or <tt class="docutils literal"><span class="pre">&&</span></tt>
+applied to <tt class="docutils literal"><span class="pre">*this</span></tt>) is enabled.</p>
+</div>
+<div class="section" id="c-11-range-based-for-loop">
+<h4>C++11 range-based <tt class="docutils literal"><span class="pre">for</span></tt> loop<a class="headerlink" href="#c-11-range-based-for-loop" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_range_for)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_range_for)</span></tt> to
+determine if support for the range-based for loop is enabled.</p>
+</div>
+<div class="section" id="c-11-raw-string-literals">
+<h4>C++11 raw string literals<a class="headerlink" href="#c-11-raw-string-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_raw_string_literals)</span></tt> to determine if support for raw
+string literals (e.g., <tt class="docutils literal"><span class="pre">R"x(foo\bar)x"</span></tt>) is enabled.</p>
+</div>
+<div class="section" id="c-11-rvalue-references">
+<h4>C++11 rvalue references<a class="headerlink" href="#c-11-rvalue-references" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_rvalue_references)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_rvalue_references)</span></tt> to determine if support for rvalue
+references is enabled.</p>
+</div>
+<div class="section" id="c-11-static-assert">
+<h4>C++11 <tt class="docutils literal"><span class="pre">static_assert()</span></tt><a class="headerlink" href="#c-11-static-assert" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_static_assert)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_static_assert)</span></tt> to determine if support for compile-time
+assertions using <tt class="docutils literal"><span class="pre">static_assert</span></tt> is enabled.</p>
+</div>
+<div class="section" id="c-11-thread-local">
+<h4>C++11 <tt class="docutils literal"><span class="pre">thread_local</span></tt><a class="headerlink" href="#c-11-thread-local" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_thread_local)</span></tt> to determine if support for
+<tt class="docutils literal"><span class="pre">thread_local</span></tt> variables is enabled.</p>
+</div>
+<div class="section" id="c-11-type-inference">
+<h4>C++11 type inference<a class="headerlink" href="#c-11-type-inference" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_auto_type)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(cxx_auto_type)</span></tt> to
+determine C++11 type inference is supported using the <tt class="docutils literal"><span class="pre">auto</span></tt> specifier.  If
+this is disabled, <tt class="docutils literal"><span class="pre">auto</span></tt> will instead be a storage class specifier, as in C
+or C++98.</p>
+</div>
+<div class="section" id="c-11-strongly-typed-enumerations">
+<h4>C++11 strongly typed enumerations<a class="headerlink" href="#c-11-strongly-typed-enumerations" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_strong_enums)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_strong_enums)</span></tt> to determine if support for strongly
+typed, scoped enumerations is enabled.</p>
+</div>
+<div class="section" id="c-11-trailing-return-type">
+<h4>C++11 trailing return type<a class="headerlink" href="#c-11-trailing-return-type" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_trailing_return)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_trailing_return)</span></tt> to determine if support for the
+alternate function declaration syntax with trailing return type is enabled.</p>
+</div>
+<div class="section" id="c-11-unicode-string-literals">
+<h4>C++11 Unicode string literals<a class="headerlink" href="#c-11-unicode-string-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_unicode_literals)</span></tt> to determine if support for Unicode
+string literals is enabled.</p>
+</div>
+<div class="section" id="c-11-unrestricted-unions">
+<h4>C++11 unrestricted unions<a class="headerlink" href="#c-11-unrestricted-unions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_unrestricted_unions)</span></tt> to determine if support for
+unrestricted unions is enabled.</p>
+</div>
+<div class="section" id="c-11-user-defined-literals">
+<h4>C++11 user-defined literals<a class="headerlink" href="#c-11-user-defined-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_user_literals)</span></tt> to determine if support for
+user-defined literals is enabled.</p>
+</div>
+<div class="section" id="c-11-variadic-templates">
+<h4>C++11 variadic templates<a class="headerlink" href="#c-11-variadic-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_variadic_templates)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_variadic_templates)</span></tt> to determine if support for
+variadic templates is enabled.</p>
+</div>
+</div>
+<div class="section" id="c-1y">
+<h3>C++1y<a class="headerlink" href="#c-1y" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the committee draft for the C++1y
+standard.  As a result, all these features are enabled with the <tt class="docutils literal"><span class="pre">-std=c++1y</span></tt>
+or <tt class="docutils literal"><span class="pre">-std=gnu++1y</span></tt> option when compiling C++ code.</p>
+<div class="section" id="c-1y-binary-literals">
+<h4>C++1y binary literals<a class="headerlink" href="#c-1y-binary-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_binary_literals)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_binary_literals)</span></tt> to determine whether
+binary literals (for instance, <tt class="docutils literal"><span class="pre">0b10010</span></tt>) are recognized. Clang supports this
+feature as an extension in all language modes.</p>
+</div>
+<div class="section" id="c-1y-contextual-conversions">
+<h4>C++1y contextual conversions<a class="headerlink" href="#c-1y-contextual-conversions" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_contextual_conversions)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_contextual_conversions)</span></tt> to determine if the C++1y rules
+are used when performing an implicit conversion for an array bound in a
+<em>new-expression</em>, the operand of a <em>delete-expression</em>, an integral constant
+expression, or a condition in a <tt class="docutils literal"><span class="pre">switch</span></tt> statement.</p>
+</div>
+<div class="section" id="c-1y-decltype-auto">
+<h4>C++1y decltype(auto)<a class="headerlink" href="#c-1y-decltype-auto" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_decltype_auto)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_decltype_auto)</span></tt> to determine if support
+for the <tt class="docutils literal"><span class="pre">decltype(auto)</span></tt> placeholder type is enabled.</p>
+</div>
+<div class="section" id="c-1y-default-initializers-for-aggregates">
+<h4>C++1y default initializers for aggregates<a class="headerlink" href="#c-1y-default-initializers-for-aggregates" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_aggregate_nsdmi)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_aggregate_nsdmi)</span></tt> to determine if support
+for default initializers in aggregate members is enabled.</p>
+</div>
+<div class="section" id="c-1y-generalized-lambda-capture">
+<h4>C++1y generalized lambda capture<a class="headerlink" href="#c-1y-generalized-lambda-capture" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_init_captures)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_init_captures)</span></tt> to determine if support for
+lambda captures with explicit initializers is enabled
+(for instance, <tt class="docutils literal"><span class="pre">[n(0)]</span> <span class="pre">{</span> <span class="pre">return</span> <span class="pre">++n;</span> <span class="pre">}</span></tt>).</p>
+</div>
+<div class="section" id="c-1y-generic-lambdas">
+<h4>C++1y generic lambdas<a class="headerlink" href="#c-1y-generic-lambdas" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_generic_lambdas)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_generic_lambdas)</span></tt> to determine if support for generic
+(polymorphic) lambdas is enabled
+(for instance, <tt class="docutils literal"><span class="pre">[]</span> <span class="pre">(auto</span> <span class="pre">x)</span> <span class="pre">{</span> <span class="pre">return</span> <span class="pre">x</span> <span class="pre">+</span> <span class="pre">1;</span> <span class="pre">}</span></tt>).</p>
+</div>
+<div class="section" id="c-1y-relaxed-constexpr">
+<h4>C++1y relaxed constexpr<a class="headerlink" href="#c-1y-relaxed-constexpr" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_relaxed_constexpr)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_relaxed_constexpr)</span></tt> to determine if variable
+declarations, local variable modification, and control flow constructs
+are permitted in <tt class="docutils literal"><span class="pre">constexpr</span></tt> functions.</p>
+</div>
+<div class="section" id="c-1y-return-type-deduction">
+<h4>C++1y return type deduction<a class="headerlink" href="#c-1y-return-type-deduction" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_return_type_deduction)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_return_type_deduction)</span></tt> to determine if support
+for return type deduction for functions (using <tt class="docutils literal"><span class="pre">auto</span></tt> as a return type)
+is enabled.</p>
+</div>
+<div class="section" id="c-1y-runtime-sized-arrays">
+<h4>C++1y runtime-sized arrays<a class="headerlink" href="#c-1y-runtime-sized-arrays" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_runtime_array)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_runtime_array)</span></tt> to determine if support
+for arrays of runtime bound (a restricted form of variable-length arrays)
+is enabled.
+Clang’s implementation of this feature is incomplete.</p>
+</div>
+<div class="section" id="c-1y-variable-templates">
+<h4>C++1y variable templates<a class="headerlink" href="#c-1y-variable-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(cxx_variable_templates)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(cxx_variable_templates)</span></tt> to determine if support for
+templated variable declarations is enabled.</p>
+</div>
+</div>
+<div class="section" id="c11">
+<h3>C11<a class="headerlink" href="#c11" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C11 standard.  As a result, all these
+features are enabled with the <tt class="docutils literal"><span class="pre">-std=c11</span></tt> or <tt class="docutils literal"><span class="pre">-std=gnu11</span></tt> option when
+compiling C code.  Additionally, because these features are all
+backward-compatible, they are available as extensions in all language modes.</p>
+<div class="section" id="c11-alignment-specifiers">
+<h4>C11 alignment specifiers<a class="headerlink" href="#c11-alignment-specifiers" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(c_alignas)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(c_alignas)</span></tt> to determine
+if support for alignment specifiers using <tt class="docutils literal"><span class="pre">_Alignas</span></tt> is enabled.</p>
+</div>
+<div class="section" id="c11-atomic-operations">
+<h4>C11 atomic operations<a class="headerlink" href="#c11-atomic-operations" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(c_atomic)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(c_atomic)</span></tt> to determine
+if support for atomic types using <tt class="docutils literal"><span class="pre">_Atomic</span></tt> is enabled.  Clang also provides
+<a class="reference internal" href="#langext-c11-atomic"><em>a set of builtins</em></a> which can be used to implement
+the <tt class="docutils literal"><span class="pre"><stdatomic.h></span></tt> operations on <tt class="docutils literal"><span class="pre">_Atomic</span></tt> types.</p>
+</div>
+<div class="section" id="c11-generic-selections">
+<h4>C11 generic selections<a class="headerlink" href="#c11-generic-selections" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(c_generic_selections)</span></tt> or
+<tt class="docutils literal"><span class="pre">__has_extension(c_generic_selections)</span></tt> to determine if support for generic
+selections is enabled.</p>
+<p>As an extension, the C11 generic selection expression is available in all
+languages supported by Clang.  The syntax is the same as that given in the C11
+standard.</p>
+<p>In C, type compatibility is decided according to the rules given in the
+appropriate standard, but in C++, which lacks the type compatibility rules used
+in C, types are considered compatible only if they are equivalent.</p>
+</div>
+<div class="section" id="c11-static-assert">
+<h4>C11 <tt class="docutils literal"><span class="pre">_Static_assert()</span></tt><a class="headerlink" href="#c11-static-assert" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(c_static_assert)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(c_static_assert)</span></tt>
+to determine if support for compile-time assertions using <tt class="docutils literal"><span class="pre">_Static_assert</span></tt> is
+enabled.</p>
+</div>
+<div class="section" id="c11-thread-local">
+<h4>C11 <tt class="docutils literal"><span class="pre">_Thread_local</span></tt><a class="headerlink" href="#c11-thread-local" title="Permalink to this headline">¶</a></h4>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(c_thread_local)</span></tt> or <tt class="docutils literal"><span class="pre">__has_extension(c_thread_local)</span></tt>
+to determine if support for <tt class="docutils literal"><span class="pre">_Thread_local</span></tt> variables is enabled.</p>
+</div>
+</div>
+</div>
+<div class="section" id="checks-for-type-trait-primitives">
+<h2><a class="toc-backref" href="#id10">Checks for Type Trait Primitives</a><a class="headerlink" href="#checks-for-type-trait-primitives" title="Permalink to this headline">¶</a></h2>
+<p>Type trait primitives are special builtin constant expressions that can be used
+by the standard C++ library to facilitate or simplify the implementation of
+user-facing type traits in the <type_traits> header.</p>
+<p>They are not intended to be used directly by user code because they are
+implementation-defined and subject to change – as such they’re tied closely to
+the supported set of system headers, currently:</p>
+<ul class="simple">
+<li>LLVM’s own libc++</li>
+<li>GNU libstdc++</li>
+<li>The Microsoft standard C++ library</li>
+</ul>
+<p>Clang supports the <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html">GNU C++ type traits</a> and a subset of the
+<a class="reference external" href="http://msdn.microsoft.com/en-us/library/ms177194(v=VS.100).aspx">Microsoft Visual C++ Type traits</a>.</p>
+<p>Feature detection is supported only for some of the primitives at present. User
+code should not use these checks because they bear no direct relation to the
+actual set of type traits supported by the C++ standard library.</p>
+<p>For type trait <tt class="docutils literal"><span class="pre">__X</span></tt>, <tt class="docutils literal"><span class="pre">__has_extension(X)</span></tt> indicates the presence of the
+type trait primitive in the compiler. A simplistic usage example as might be
+seen in standard C++ headers follows:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#if __has_extension(is_convertible_to)</span>
+<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">From</span><span class="p">,</span> <span class="k">typename</span> <span class="n">To</span><span class="o">></span>
+<span class="k">struct</span> <span class="n">is_convertible_to</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="k">const</span> <span class="kt">bool</span> <span class="n">value</span> <span class="o">=</span> <span class="n">__is_convertible_to</span><span class="p">(</span><span class="n">From</span><span class="p">,</span> <span class="n">To</span><span class="p">);</span>
+<span class="p">};</span>
+<span class="cp">#else</span>
+<span class="c1">// Emulate type trait for compatibility with other compilers.</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>The following type trait primitives are supported by Clang:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">__has_nothrow_assign</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_nothrow_copy</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_nothrow_constructor</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_trivial_assign</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_trivial_copy</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_trivial_constructor</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_trivial_destructor</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__has_virtual_destructor</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_abstract</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_base_of</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_class</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_convertible_to</span></tt> (Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_empty</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_enum</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_interface_class</span></tt> (Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_pod</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_polymorphic</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_union</span></tt> (GNU, Microsoft)</li>
+<li><tt class="docutils literal"><span class="pre">__is_literal(type)</span></tt>: Determines whether the given type is a literal type</li>
+<li><tt class="docutils literal"><span class="pre">__is_final</span></tt>: Determines whether the given type is declared with a
+<tt class="docutils literal"><span class="pre">final</span></tt> class-virt-specifier.</li>
+<li><tt class="docutils literal"><span class="pre">__underlying_type(type)</span></tt>: Retrieves the underlying type for a given
+<tt class="docutils literal"><span class="pre">enum</span></tt> type.  This trait is required to implement the C++11 standard
+library.</li>
+<li><tt class="docutils literal"><span class="pre">__is_trivially_assignable(totype,</span> <span class="pre">fromtype)</span></tt>: Determines whether a value
+of type <tt class="docutils literal"><span class="pre">totype</span></tt> can be assigned to from a value of type <tt class="docutils literal"><span class="pre">fromtype</span></tt> such
+that no non-trivial functions are called as part of that assignment.  This
+trait is required to implement the C++11 standard library.</li>
+<li><tt class="docutils literal"><span class="pre">__is_trivially_constructible(type,</span> <span class="pre">argtypes...)</span></tt>: Determines whether a
+value of type <tt class="docutils literal"><span class="pre">type</span></tt> can be direct-initialized with arguments of types
+<tt class="docutils literal"><span class="pre">argtypes...</span></tt> such that no non-trivial functions are called as part of
+that initialization.  This trait is required to implement the C++11 standard
+library.</li>
+<li><tt class="docutils literal"><span class="pre">__is_destructible</span></tt> (MSVC 2013): partially implemented</li>
+<li><tt class="docutils literal"><span class="pre">__is_nothrow_destructible</span></tt> (MSVC 2013): partially implemented</li>
+<li><tt class="docutils literal"><span class="pre">__is_nothrow_assignable</span></tt> (MSVC 2013, clang)</li>
+<li><tt class="docutils literal"><span class="pre">__is_constructible</span></tt> (MSVC 2013, clang)</li>
+<li><tt class="docutils literal"><span class="pre">__is_nothrow_constructible</span></tt> (MSVC 2013, clang)</li>
+</ul>
+</div>
+<div class="section" id="blocks">
+<h2><a class="toc-backref" href="#id11">Blocks</a><a class="headerlink" href="#blocks" title="Permalink to this headline">¶</a></h2>
+<p>The syntax and high level language feature description is in
+<a class="reference internal" href="BlockLanguageSpec.html"><em>BlockLanguageSpec</em></a>. Implementation and ABI details for
+the clang implementation are in <a class="reference internal" href="Block-ABI-Apple.html"><em>Block-ABI-Apple</em></a>.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_extension(blocks)</span></tt>.</p>
+</div>
+<div class="section" id="objective-c-features">
+<h2><a class="toc-backref" href="#id12">Objective-C Features</a><a class="headerlink" href="#objective-c-features" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="related-result-types">
+<h3>Related result types<a class="headerlink" href="#related-result-types" title="Permalink to this headline">¶</a></h3>
+<p>According to Cocoa conventions, Objective-C methods with certain names
+(“<tt class="docutils literal"><span class="pre">init</span></tt>”, “<tt class="docutils literal"><span class="pre">alloc</span></tt>”, etc.) always return objects that are an instance of
+the receiving class’s type.  Such methods are said to have a “related result
+type”, meaning that a message send to one of these methods will have the same
+static type as an instance of the receiver class.  For example, given the
+following classes:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="k">@interface</span> <span class="nc">NSObject</span>
+<span class="k">+</span> <span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nf">alloc</span><span class="p">;</span>
+<span class="k">-</span> <span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nf">init</span><span class="p">;</span>
+<span class="k">@end</span>
+
+<span class="k">@interface</span> <span class="nc">NSArray</span> : <span class="nc">NSObject</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>and this common initialization pattern</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="n">NSArray</span> <span class="o">*</span><span class="n">array</span> <span class="o">=</span> <span class="p">[[</span><span class="n">NSArray</span> <span class="n">alloc</span><span class="p">]</span> <span class="n">init</span><span class="p">];</span>
+</pre></div>
+</div>
+<p>the type of the expression <tt class="docutils literal"><span class="pre">[NSArray</span> <span class="pre">alloc]</span></tt> is <tt class="docutils literal"><span class="pre">NSArray*</span></tt> because
+<tt class="docutils literal"><span class="pre">alloc</span></tt> implicitly has a related result type.  Similarly, the type of the
+expression <tt class="docutils literal"><span class="pre">[[NSArray</span> <span class="pre">alloc]</span> <span class="pre">init]</span></tt> is <tt class="docutils literal"><span class="pre">NSArray*</span></tt>, since <tt class="docutils literal"><span class="pre">init</span></tt> has a
+related result type and its receiver is known to have the type <tt class="docutils literal"><span class="pre">NSArray</span> <span class="pre">*</span></tt>.
+If neither <tt class="docutils literal"><span class="pre">alloc</span></tt> nor <tt class="docutils literal"><span class="pre">init</span></tt> had a related result type, the expressions
+would have had type <tt class="docutils literal"><span class="pre">id</span></tt>, as declared in the method signature.</p>
+<p>A method with a related result type can be declared by using the type
+<tt class="docutils literal"><span class="pre">instancetype</span></tt> as its result type.  <tt class="docutils literal"><span class="pre">instancetype</span></tt> is a contextual keyword
+that is only permitted in the result type of an Objective-C method, e.g.</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="k">@interface</span> <span class="nc">A</span>
+<span class="k">+</span> <span class="p">(</span><span class="n">instancetype</span><span class="p">)</span><span class="nf">constructAnA</span><span class="p">;</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>The related result type can also be inferred for some methods.  To determine
+whether a method has an inferred related result type, the first word in the
+camel-case selector (e.g., “<tt class="docutils literal"><span class="pre">init</span></tt>” in “<tt class="docutils literal"><span class="pre">initWithObjects</span></tt>”) is considered,
+and the method will have a related result type if its return type is compatible
+with the type of its class and if:</p>
+<ul class="simple">
+<li>the first word is “<tt class="docutils literal"><span class="pre">alloc</span></tt>” or “<tt class="docutils literal"><span class="pre">new</span></tt>”, and the method is a class method,
+or</li>
+<li>the first word is “<tt class="docutils literal"><span class="pre">autorelease</span></tt>”, “<tt class="docutils literal"><span class="pre">init</span></tt>”, “<tt class="docutils literal"><span class="pre">retain</span></tt>”, or “<tt class="docutils literal"><span class="pre">self</span></tt>”,
+and the method is an instance method.</li>
+</ul>
+<p>If a method with a related result type is overridden by a subclass method, the
+subclass method must also return a type that is compatible with the subclass
+type.  For example:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="k">@interface</span> <span class="nc">NSString</span> : <span class="nc">NSObject</span>
+<span class="k">-</span> <span class="p">(</span><span class="n">NSUnrelated</span> <span class="o">*</span><span class="p">)</span><span class="nf">init</span><span class="p">;</span> <span class="c1">// incorrect usage: NSUnrelated is not NSString or a superclass of NSString</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>Related result types only affect the type of a message send or property access
+via the given method.  In all other respects, a method with a related result
+type is treated the same way as method that returns <tt class="docutils literal"><span class="pre">id</span></tt>.</p>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(objc_instancetype)</span></tt> to determine whether the
+<tt class="docutils literal"><span class="pre">instancetype</span></tt> contextual keyword is available.</p>
+</div>
+<div class="section" id="automatic-reference-counting">
+<h3>Automatic reference counting<a class="headerlink" href="#automatic-reference-counting" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for <a class="reference internal" href="AutomaticReferenceCounting.html"><em>automated reference counting</em></a> in Objective-C, which eliminates the need
+for manual <tt class="docutils literal"><span class="pre">retain</span></tt>/<tt class="docutils literal"><span class="pre">release</span></tt>/<tt class="docutils literal"><span class="pre">autorelease</span></tt> message sends.  There are two
+feature macros associated with automatic reference counting:
+<tt class="docutils literal"><span class="pre">__has_feature(objc_arc)</span></tt> indicates the availability of automated reference
+counting in general, while <tt class="docutils literal"><span class="pre">__has_feature(objc_arc_weak)</span></tt> indicates that
+automated reference counting also includes support for <tt class="docutils literal"><span class="pre">__weak</span></tt> pointers to
+Objective-C objects.</p>
+</div>
+<div class="section" id="enumerations-with-a-fixed-underlying-type">
+<span id="objc-fixed-enum"></span><h3>Enumerations with a fixed underlying type<a class="headerlink" href="#enumerations-with-a-fixed-underlying-type" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for C++11 enumerations with a fixed underlying type
+within Objective-C.  For example, one can write an enumeration type as:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="k">enum</span> <span class="o">:</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="p">{</span> <span class="n">Red</span><span class="p">,</span> <span class="n">Green</span><span class="p">,</span> <span class="n">Blue</span> <span class="p">}</span> <span class="n">Color</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This specifies that the underlying type, which is used to store the enumeration
+value, is <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span></tt>.</p>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(objc_fixed_enum)</span></tt> to determine whether support for fixed
+underlying types is available in Objective-C.</p>
+</div>
+<div class="section" id="interoperability-with-c-11-lambdas">
+<h3>Interoperability with C++11 lambdas<a class="headerlink" href="#interoperability-with-c-11-lambdas" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides interoperability between C++11 lambdas and blocks-based APIs, by
+permitting a lambda to be implicitly converted to a block pointer with the
+corresponding signature.  For example, consider an API such as <tt class="docutils literal"><span class="pre">NSArray</span></tt>‘s
+array-sorting method:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="k">-</span> <span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="nf">sortedArrayUsingComparator:</span><span class="p">(</span><span class="n">NSComparator</span><span class="p">)</span><span class="nv">cmptr</span><span class="p">;</span>
+</pre></div>
+</div>
+<p><tt class="docutils literal"><span class="pre">NSComparator</span></tt> is simply a typedef for the block pointer <tt class="docutils literal"><span class="pre">NSComparisonResult</span>
+<span class="pre">(^)(id,</span> <span class="pre">id)</span></tt>, and parameters of this type are generally provided with block
+literals as arguments.  However, one can also use a C++11 lambda so long as it
+provides the same signature (in this case, accepting two parameters of type
+<tt class="docutils literal"><span class="pre">id</span></tt> and returning an <tt class="docutils literal"><span class="pre">NSComparisonResult</span></tt>):</p>
+<div class="highlight-objc"><pre>NSArray *array = @[@"string 1", @"string 21", @"string 12", @"String 11",
+                   @"String 02"];
+const NSStringCompareOptions comparisonOptions
+  = NSCaseInsensitiveSearch | NSNumericSearch |
+    NSWidthInsensitiveSearch | NSForcedOrderingSearch;
+NSLocale *currentLocale = [NSLocale currentLocale];
+NSArray *sorted
+  = [array sortedArrayUsingComparator:[=](id s1, id s2) -> NSComparisonResult {
+             NSRange string1Range = NSMakeRange(0, [s1 length]);
+             return [s1 compare:s2 options:comparisonOptions
+             range:string1Range locale:currentLocale];
+     }];
+NSLog(@"sorted: %@", sorted);</pre>
+</div>
+<p>This code relies on an implicit conversion from the type of the lambda
+expression (an unnamed, local class type called the <em>closure type</em>) to the
+corresponding block pointer type.  The conversion itself is expressed by a
+conversion operator in that closure type that produces a block pointer with the
+same signature as the lambda itself, e.g.,</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="n">operator</span> <span class="n">NSComparisonResult</span> <span class="p">(</span><span class="o">^</span><span class="p">)(</span><span class="kt">id</span><span class="p">,</span> <span class="kt">id</span><span class="p">)()</span> <span class="k">const</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This conversion function returns a new block that simply forwards the two
+parameters to the lambda object (which it captures by copy), then returns the
+result.  The returned block is first copied (with <tt class="docutils literal"><span class="pre">Block_copy</span></tt>) and then
+autoreleased.  As an optimization, if a lambda expression is immediately
+converted to a block pointer (as in the first example, above), then the block
+is not copied and autoreleased: rather, it is given the same lifetime as a
+block literal written at that point in the program, which avoids the overhead
+of copying a block to the heap in the common case.</p>
+<p>The conversion from a lambda to a block pointer is only available in
+Objective-C++, and not in C++ with blocks, due to its use of Objective-C memory
+management (autorelease).</p>
+</div>
+<div class="section" id="object-literals-and-subscripting">
+<h3>Object Literals and Subscripting<a class="headerlink" href="#object-literals-and-subscripting" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for <a class="reference internal" href="ObjectiveCLiterals.html"><em>Object Literals and Subscripting</em></a> in Objective-C, which simplifies common Objective-C
+programming patterns, makes programs more concise, and improves the safety of
+container creation.  There are several feature macros associated with object
+literals and subscripting: <tt class="docutils literal"><span class="pre">__has_feature(objc_array_literals)</span></tt> tests the
+availability of array literals; <tt class="docutils literal"><span class="pre">__has_feature(objc_dictionary_literals)</span></tt>
+tests the availability of dictionary literals;
+<tt class="docutils literal"><span class="pre">__has_feature(objc_subscripting)</span></tt> tests the availability of object
+subscripting.</p>
+</div>
+<div class="section" id="objective-c-autosynthesis-of-properties">
+<h3>Objective-C Autosynthesis of Properties<a class="headerlink" href="#objective-c-autosynthesis-of-properties" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for autosynthesis of declared properties.  Using this
+feature, clang provides default synthesis of those properties not declared
+@dynamic and not having user provided backing getter and setter methods.
+<tt class="docutils literal"><span class="pre">__has_feature(objc_default_synthesize_properties)</span></tt> checks for availability
+of this feature in version of clang being used.</p>
+</div>
+<div class="section" id="objective-c-retaining-behavior-attributes">
+<span id="langext-objc-retain-release"></span><h3>Objective-C retaining behavior attributes<a class="headerlink" href="#objective-c-retaining-behavior-attributes" title="Permalink to this headline">¶</a></h3>
+<p>In Objective-C, functions and methods are generally assumed to follow the
+<a class="reference external" href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html">Cocoa Memory Management</a>
+conventions for ownership of object arguments and
+return values. However, there are exceptions, and so Clang provides attributes
+to allow these exceptions to be documented. This are used by ARC and the
+<a class="reference external" href="http://clang-analyzer.llvm.org">static analyzer</a> Some exceptions may be
+better described using the <tt class="docutils literal"><span class="pre">objc_method_family</span></tt> attribute instead.</p>
+<p><strong>Usage</strong>: The <tt class="docutils literal"><span class="pre">ns_returns_retained</span></tt>, <tt class="docutils literal"><span class="pre">ns_returns_not_retained</span></tt>,
+<tt class="docutils literal"><span class="pre">ns_returns_autoreleased</span></tt>, <tt class="docutils literal"><span class="pre">cf_returns_retained</span></tt>, and
+<tt class="docutils literal"><span class="pre">cf_returns_not_retained</span></tt> attributes can be placed on methods and functions
+that return Objective-C or CoreFoundation objects. They are commonly placed at
+the end of a function prototype or method declaration:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="kt">id</span> <span class="nf">foo</span><span class="p">()</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_returns_retained</span><span class="p">));</span>
+
+<span class="k">-</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">bar:</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="nv">x</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_returns_retained</span><span class="p">));</span>
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">*_returns_retained</span></tt> attributes specify that the returned object has a +1
+retain count.  The <tt class="docutils literal"><span class="pre">*_returns_not_retained</span></tt> attributes specify that the return
+object has a +0 retain count, even if the normal convention for its selector
+would be +1.  <tt class="docutils literal"><span class="pre">ns_returns_autoreleased</span></tt> specifies that the returned object is
++0, but is guaranteed to live at least as long as the next flush of an
+autorelease pool.</p>
+<p><strong>Usage</strong>: The <tt class="docutils literal"><span class="pre">ns_consumed</span></tt> and <tt class="docutils literal"><span class="pre">cf_consumed</span></tt> attributes can be placed on
+an parameter declaration; they specify that the argument is expected to have a
++1 retain count, which will be balanced in some way by the function or method.
+The <tt class="docutils literal"><span class="pre">ns_consumes_self</span></tt> attribute can only be placed on an Objective-C
+method; it specifies that the method expects its <tt class="docutils literal"><span class="pre">self</span></tt> parameter to have a
++1 retain count, which it will balance in some way.</p>
+<div class="highlight-objc"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">foo</span><span class="p">(</span><span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_consumed</span><span class="p">))</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">string</span><span class="p">);</span>
+
+<span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="nf">bar</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_consumes_self</span><span class="p">));</span>
+<span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="nf">baz:</span><span class="p">(</span><span class="kt">id</span><span class="p">)</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_consumed</span><span class="p">))</span> <span class="n">x</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>Further examples of these attributes are available in the static analyzer’s <a class="reference external" href="http://clang-analyzer.llvm.org/annotations.html#cocoa_mem">list of annotations for analysis</a>.</p>
+<p>Query for these features with <tt class="docutils literal"><span class="pre">__has_attribute(ns_consumed)</span></tt>,
+<tt class="docutils literal"><span class="pre">__has_attribute(ns_returns_retained)</span></tt>, etc.</p>
+</div>
+<div class="section" id="objective-c-abi-protocol-qualifier-mangling-of-parameters">
+<h3>Objective-C++ ABI: protocol-qualifier mangling of parameters<a class="headerlink" href="#objective-c-abi-protocol-qualifier-mangling-of-parameters" title="Permalink to this headline">¶</a></h3>
+<p>Starting with LLVM 3.4, Clang produces a new mangling for parameters whose
+type is a qualified-<tt class="docutils literal"><span class="pre">id</span></tt> (e.g., <tt class="docutils literal"><span class="pre">id<Foo></span></tt>).  This mangling allows such
+parameters to be differentiated from those with the regular unqualified <tt class="docutils literal"><span class="pre">id</span></tt>
+type.</p>
+<p>This was a non-backward compatible mangling change to the ABI.  This change
+allows proper overloading, and also prevents mangling conflicts with template
+parameters of protocol-qualified type.</p>
+<p>Query the presence of this new mangling with
+<tt class="docutils literal"><span class="pre">__has_feature(objc_protocol_qualifier_mangling)</span></tt>.</p>
+</div>
+</div>
+<div class="section" id="initializer-lists-for-complex-numbers-in-c">
+<span id="langext-overloading"></span><h2><a class="toc-backref" href="#id13">Initializer lists for complex numbers in C</a><a class="headerlink" href="#initializer-lists-for-complex-numbers-in-c" title="Permalink to this headline">¶</a></h2>
+<p>clang supports an extension which allows the following in C:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include <math.h></span>
+<span class="cp">#include <complex.h></span>
+<span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span> <span class="o">=</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="n">INFINITY</span> <span class="p">};</span> <span class="c1">// Init to (1, Inf)</span>
+</pre></div>
+</div>
+<p>This construct is useful because there is no way to separately initialize the
+real and imaginary parts of a complex variable in standard C, given that clang
+does not support <tt class="docutils literal"><span class="pre">_Imaginary</span></tt>.  (Clang also supports the <tt class="docutils literal"><span class="pre">__real__</span></tt> and
+<tt class="docutils literal"><span class="pre">__imag__</span></tt> extensions from gcc, which help in some cases, but are not usable
+in static initializers.)</p>
+<p>Note that this extension does not allow eliding the braces; the meaning of the
+following two lines is different:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="mf">1.0f</span> <span class="p">}</span> <span class="p">};</span> <span class="c1">// [0] = (1, 1)</span>
+<span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="mf">1.0f</span> <span class="p">};</span> <span class="c1">// [0] = (1, 0), [1] = (1, 0)</span>
+</pre></div>
+</div>
+<p>This extension also works in C++ mode, as far as that goes, but does not apply
+to the C++ <tt class="docutils literal"><span class="pre">std::complex</span></tt>.  (In C++11, list initialization allows the same
+syntax to be used with <tt class="docutils literal"><span class="pre">std::complex</span></tt> with the same meaning.)</p>
+</div>
+<div class="section" id="builtin-functions">
+<h2><a class="toc-backref" href="#id14">Builtin Functions</a><a class="headerlink" href="#builtin-functions" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports a number of builtin library functions with the same syntax as
+GCC, including things like <tt class="docutils literal"><span class="pre">__builtin_nan</span></tt>, <tt class="docutils literal"><span class="pre">__builtin_constant_p</span></tt>,
+<tt class="docutils literal"><span class="pre">__builtin_choose_expr</span></tt>, <tt class="docutils literal"><span class="pre">__builtin_types_compatible_p</span></tt>,
+<tt class="docutils literal"><span class="pre">__sync_fetch_and_add</span></tt>, etc.  In addition to the GCC builtins, Clang supports
+a number of builtins that GCC does not, which are listed here.</p>
+<p>Please note that Clang does not and will not support all of the GCC builtins
+for vector operations.  Instead of using builtins, you should use the functions
+defined in target-specific header files like <tt class="docutils literal"><span class="pre"><xmmintrin.h></span></tt>, which define
+portable wrappers for these.  Many of the Clang versions of these functions are
+implemented directly in terms of <a class="reference internal" href="#langext-vectors"><em>extended vector support</em></a> instead of builtins, in order to reduce the number of
+builtins that we need to implement.</p>
+<div class="section" id="builtin-readcyclecounter">
+<h3><tt class="docutils literal"><span class="pre">__builtin_readcyclecounter</span></tt><a class="headerlink" href="#builtin-readcyclecounter" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_readcyclecounter</span></tt> is used to access the cycle counter register (or
+a similar low-latency, high-accuracy clock) on those targets that support it.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">__builtin_readcyclecounter</span><span class="p">()</span>
+</pre></div>
+</div>
+<p><strong>Example of Use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">t0</span> <span class="o">=</span> <span class="n">__builtin_readcyclecounter</span><span class="p">();</span>
+<span class="n">do_something</span><span class="p">();</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">t1</span> <span class="o">=</span> <span class="n">__builtin_readcyclecounter</span><span class="p">();</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">cycles_to_do_something</span> <span class="o">=</span> <span class="n">t1</span> <span class="o">-</span> <span class="n">t0</span><span class="p">;</span> <span class="c1">// assuming no overflow</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <tt class="docutils literal"><span class="pre">__builtin_readcyclecounter()</span></tt> builtin returns the cycle counter value,
+which may be either global or process/thread-specific depending on the target.
+As the backing counters often overflow quickly (on the order of seconds) this
+should only be used for timing small intervals.  When not supported by the
+target, the return value is always zero.  This builtin takes no arguments and
+produces an unsigned long long result.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_builtin(__builtin_readcyclecounter)</span></tt>. Note
+that even if present, its use may depend on run-time privilege or other OS
+controlled state.</p>
+</div>
+<div class="section" id="builtin-shufflevector">
+<span id="langext-builtin-shufflevector"></span><h3><tt class="docutils literal"><span class="pre">__builtin_shufflevector</span></tt><a class="headerlink" href="#builtin-shufflevector" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_shufflevector</span></tt> is used to express generic vector
+permutation/shuffle/swizzle operations.  This builtin is also very important
+for the implementation of various target-specific header files like
+<tt class="docutils literal"><span class="pre"><xmmintrin.h></span></tt>.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">vec1</span><span class="p">,</span> <span class="n">vec2</span><span class="p">,</span> <span class="n">index1</span><span class="p">,</span> <span class="n">index2</span><span class="p">,</span> <span class="p">...)</span>
+</pre></div>
+</div>
+<p><strong>Examples</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// identity operation - return 4-element vector v1.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">v1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
+
+<span class="c1">// "Splat" element 0 of V1 into a 4-element result.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+
+<span class="c1">// Reverse 4-element vector V1.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+
+<span class="c1">// Concatenate every other element of 4-element vectors V1 and V2.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
+
+<span class="c1">// Concatenate every other element of 8-element vectors V1 and V2.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">14</span><span class="p">)</span>
+
+<span class="c1">// Shuffle v1 with some elements being undefined</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">v1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The first two arguments to <tt class="docutils literal"><span class="pre">__builtin_shufflevector</span></tt> are vectors that have
+the same element type.  The remaining arguments are a list of integers that
+specify the elements indices of the first two vectors that should be extracted
+and returned in a new vector.  These element indices are numbered sequentially
+starting with the first vector, continuing into the second vector.  Thus, if
+<tt class="docutils literal"><span class="pre">vec1</span></tt> is a 4-element vector, index 5 would refer to the second element of
+<tt class="docutils literal"><span class="pre">vec2</span></tt>. An index of -1 can be used to indicate that the corresponding element
+in the returned vector is a don’t care and can be optimized by the backend.</p>
+<p>The result of <tt class="docutils literal"><span class="pre">__builtin_shufflevector</span></tt> is a vector with the same element
+type as <tt class="docutils literal"><span class="pre">vec1</span></tt>/<tt class="docutils literal"><span class="pre">vec2</span></tt> but that has an element count equal to the number of
+indices specified.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_builtin(__builtin_shufflevector)</span></tt>.</p>
+</div>
+<div class="section" id="builtin-convertvector">
+<h3><tt class="docutils literal"><span class="pre">__builtin_convertvector</span></tt><a class="headerlink" href="#builtin-convertvector" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_convertvector</span></tt> is used to express generic vector
+type-conversion operations. The input vector and the output vector
+type must have the same number of elements.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">src_vec</span><span class="p">,</span> <span class="n">dst_vec_type</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Examples</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="kt">double</span> <span class="n">vector4double</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">32</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span>  <span class="n">vector4float</span>  <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">16</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">short</span>  <span class="n">vector4short</span>  <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">8</span><span class="p">)));</span>
+<span class="n">vector4float</span> <span class="n">vf</span><span class="p">;</span> <span class="n">vector4short</span> <span class="n">vs</span><span class="p">;</span>
+
+<span class="c1">// convert from a vector of 4 floats to a vector of 4 doubles.</span>
+<span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">vf</span><span class="p">,</span> <span class="n">vector4double</span><span class="p">)</span>
+<span class="c1">// equivalent to:</span>
+<span class="p">(</span><span class="n">vector4double</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">}</span>
+
+<span class="c1">// convert from a vector of 4 shorts to a vector of 4 floats.</span>
+<span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="n">vector4float</span><span class="p">)</span>
+<span class="c1">// equivalent to:</span>
+<span class="p">(</span><span class="n">vector4float</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The first argument to <tt class="docutils literal"><span class="pre">__builtin_convertvector</span></tt> is a vector, and the second
+argument is a vector type with the same number of elements as the first
+argument.</p>
+<p>The result of <tt class="docutils literal"><span class="pre">__builtin_convertvector</span></tt> is a vector with the same element
+type as the second argument, with a value defined in terms of the action of a
+C-style cast applied to each element of the first argument.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_builtin(__builtin_convertvector)</span></tt>.</p>
+</div>
+<div class="section" id="builtin-unreachable">
+<h3><tt class="docutils literal"><span class="pre">__builtin_unreachable</span></tt><a class="headerlink" href="#builtin-unreachable" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_unreachable</span></tt> is used to indicate that a specific point in the
+program cannot be reached, even if the compiler might otherwise think it can.
+This is useful to improve optimization and eliminates certain warnings.  For
+example, without the <tt class="docutils literal"><span class="pre">__builtin_unreachable</span></tt> in the example below, the
+compiler assumes that the inline asm can fall through and prints a “function
+declared ‘<tt class="docutils literal"><span class="pre">noreturn</span></tt>‘ should not return” warning.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">__builtin_unreachable</span><span class="p">()</span>
+</pre></div>
+</div>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">myabort</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">noreturn</span><span class="p">));</span>
+<span class="kt">void</span> <span class="nf">myabort</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">asm</span><span class="p">(</span><span class="s">"int3"</span><span class="p">);</span>
+  <span class="n">__builtin_unreachable</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <tt class="docutils literal"><span class="pre">__builtin_unreachable()</span></tt> builtin has completely undefined behavior.
+Since it has undefined behavior, it is a statement that it is never reached and
+the optimizer can take advantage of this to produce better code.  This builtin
+takes no arguments and produces a void result.</p>
+<p>Query for this feature with <tt class="docutils literal"><span class="pre">__has_builtin(__builtin_unreachable)</span></tt>.</p>
+</div>
+<div class="section" id="sync-swap">
+<h3><tt class="docutils literal"><span class="pre">__sync_swap</span></tt><a class="headerlink" href="#sync-swap" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__sync_swap</span></tt> is used to atomically swap integers or pointers in memory.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">type</span> <span class="n">__sync_swap</span><span class="p">(</span><span class="n">type</span> <span class="o">*</span><span class="n">ptr</span><span class="p">,</span> <span class="n">type</span> <span class="n">value</span><span class="p">,</span> <span class="p">...)</span>
+</pre></div>
+</div>
+<p><strong>Example of Use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">int</span> <span class="n">old_value</span> <span class="o">=</span> <span class="n">__sync_swap</span><span class="p">(</span><span class="o">&</span><span class="n">value</span><span class="p">,</span> <span class="n">new_value</span><span class="p">);</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <tt class="docutils literal"><span class="pre">__sync_swap()</span></tt> builtin extends the existing <tt class="docutils literal"><span class="pre">__sync_*()</span></tt> family of
+atomic intrinsics to allow code to atomically swap the current value with the
+new value.  More importantly, it helps developers write more efficient and
+correct code by avoiding expensive loops around
+<tt class="docutils literal"><span class="pre">__sync_bool_compare_and_swap()</span></tt> or relying on the platform specific
+implementation details of <tt class="docutils literal"><span class="pre">__sync_lock_test_and_set()</span></tt>.  The
+<tt class="docutils literal"><span class="pre">__sync_swap()</span></tt> builtin is a full barrier.</p>
+</div>
+<div class="section" id="builtin-addressof">
+<h3><tt class="docutils literal"><span class="pre">__builtin_addressof</span></tt><a class="headerlink" href="#builtin-addressof" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_addressof</span></tt> performs the functionality of the built-in <tt class="docutils literal"><span class="pre">&</span></tt>
+operator, ignoring any <tt class="docutils literal"><span class="pre">operator&</span></tt> overload.  This is useful in constant
+expressions in C++11, where there is no other way to take the address of an
+object that overloads <tt class="docutils literal"><span class="pre">operator&</span></tt>.</p>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="n">constexpr</span> <span class="n">T</span> <span class="o">*</span><span class="n">addressof</span><span class="p">(</span><span class="n">T</span> <span class="o">&</span><span class="n">value</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">__builtin_addressof</span><span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="builtin-operator-new-and-builtin-operator-delete">
+<h3><tt class="docutils literal"><span class="pre">__builtin_operator_new</span></tt> and <tt class="docutils literal"><span class="pre">__builtin_operator_delete</span></tt><a class="headerlink" href="#builtin-operator-new-and-builtin-operator-delete" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">__builtin_operator_new</span></tt> allocates memory just like a non-placement non-class
+<em>new-expression</em>. This is exactly like directly calling the normal
+non-placement <tt class="docutils literal"><span class="pre">::operator</span> <span class="pre">new</span></tt>, except that it allows certain optimizations
+that the C++ standard does not permit for a direct function call to
+<tt class="docutils literal"><span class="pre">::operator</span> <span class="pre">new</span></tt> (in particular, removing <tt class="docutils literal"><span class="pre">new</span></tt> / <tt class="docutils literal"><span class="pre">delete</span></tt> pairs and
+merging allocations).</p>
+<p>Likewise, <tt class="docutils literal"><span class="pre">__builtin_operator_delete</span></tt> deallocates memory just like a
+non-class <em>delete-expression</em>, and is exactly like directly calling the normal
+<tt class="docutils literal"><span class="pre">::operator</span> <span class="pre">delete</span></tt>, except that it permits optimizations. Only the unsized
+form of <tt class="docutils literal"><span class="pre">__builtin_operator_delete</span></tt> is currently available.</p>
+<p>These builtins are intended for use in the implementation of <tt class="docutils literal"><span class="pre">std::allocator</span></tt>
+and other similar allocation libraries, and are only available in C++.</p>
+</div>
+<div class="section" id="multiprecision-arithmetic-builtins">
+<h3>Multiprecision Arithmetic Builtins<a class="headerlink" href="#multiprecision-arithmetic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins which expose multiprecision arithmetic in a
+manner amenable to C. They all have the following form:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="kt">unsigned</span> <span class="n">x</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">y</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">carryin</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="kt">unsigned</span> <span class="n">sum</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Thus one can form a multiprecision addition chain in the following manner:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="kt">unsigned</span> <span class="o">*</span><span class="n">x</span><span class="p">,</span> <span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="o">*</span><span class="n">z</span><span class="p">,</span> <span class="n">carryin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The complete list of builtins are:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="kt">unsigned</span> <span class="kt">char</span>      <span class="nf">__builtin_addcb</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">short</span>     <span class="nf">__builtin_addcs</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span>           <span class="nf">__builtin_addc</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span>      <span class="nf">__builtin_addcl</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="nf">__builtin_addcll</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">char</span>      <span class="nf">__builtin_subcb</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">short</span>     <span class="nf">__builtin_subcs</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span>           <span class="nf">__builtin_subc</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span>      <span class="nf">__builtin_subcl</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="nf">__builtin_subcll</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="checked-arithmetic-builtins">
+<h3>Checked Arithmetic Builtins<a class="headerlink" href="#checked-arithmetic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins that implement checked arithmetic for security
+critical applications in a manner that is fast and easily expressable in C. As
+an example of their usage:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="kt">errorcode_t</span> <span class="nf">security_critical_application</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">result</span><span class="p">;</span>
+  <span class="p">...</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">__builtin_umul_overflow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="o">&</span><span class="n">result</span><span class="p">))</span>
+    <span class="k">return</span> <span class="n">kErrorCodeHackers</span><span class="p">;</span>
+  <span class="p">...</span>
+  <span class="n">use_multiply</span><span class="p">(</span><span class="n">result</span><span class="p">);</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>A complete enumeration of the builtins are:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="kt">bool</span> <span class="nf">__builtin_uadd_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_uaddl_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_uaddll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usub_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usubl_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usubll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umul_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umull_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umulll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_sadd_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_saddl_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_saddll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssub_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssubl_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssubll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smul_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smull_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smulll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="c11-atomic-builtins">
+<span id="langext-c11-atomic"></span><h3>__c11_atomic builtins<a class="headerlink" href="#c11-atomic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins which are intended to be used to implement
+C11’s <tt class="docutils literal"><span class="pre"><stdatomic.h></span></tt> header.  These builtins provide the semantics of the
+<tt class="docutils literal"><span class="pre">_explicit</span></tt> form of the corresponding C11 operation, and are named with a
+<tt class="docutils literal"><span class="pre">__c11_</span></tt> prefix.  The supported operations are:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_init</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_thread_fence</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_signal_fence</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_is_lock_free</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_store</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_load</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_exchange</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_compare_exchange_strong</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_compare_exchange_weak</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_fetch_add</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_fetch_sub</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_fetch_and</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_fetch_or</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">__c11_atomic_fetch_xor</span></tt></li>
+</ul>
+</div>
+<div class="section" id="low-level-arm-exclusive-memory-builtins">
+<h3>Low-level ARM exclusive memory builtins<a class="headerlink" href="#low-level-arm-exclusive-memory-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides overloaded builtins giving direct access to the three key ARM
+instructions for implementing atomic operations.</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="n">T</span> <span class="nf">__builtin_arm_ldrex</span><span class="p">(</span><span class="k">const</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="n">T</span> <span class="nf">__builtin_arm_ldaex</span><span class="p">(</span><span class="k">const</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">int</span> <span class="nf">__builtin_arm_strex</span><span class="p">(</span><span class="n">T</span> <span class="n">val</span><span class="p">,</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">int</span> <span class="nf">__builtin_arm_stlex</span><span class="p">(</span><span class="n">T</span> <span class="n">val</span><span class="p">,</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">void</span> <span class="nf">__builtin_arm_clrex</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The types <tt class="docutils literal"><span class="pre">T</span></tt> currently supported are:
+* Integer types with width at most 64 bits (or 128 bits on AArch64).
+* Floating-point types
+* Pointer types.</p>
+<p>Note that the compiler does not guarantee it will not insert stores which clear
+the exclusive monitor in between an <tt class="docutils literal"><span class="pre">ldrex</span></tt> type operation and its paired
+<tt class="docutils literal"><span class="pre">strex</span></tt>. In practice this is only usually a risk when the extra store is on
+the same cache line as the variable being modified and Clang will only insert
+stack stores on its own, so it is best not to use these operations on variables
+with automatic storage duration.</p>
+<p>Also, loads and stores may be implicit in code written between the <tt class="docutils literal"><span class="pre">ldrex</span></tt> and
+<tt class="docutils literal"><span class="pre">strex</span></tt>. Clang will not necessarily mitigate the effects of these either, so
+care should be exercised.</p>
+<p>For these reasons the higher level atomic primitives should be preferred where
+possible.</p>
+</div>
+</div>
+<div class="section" id="non-standard-c-11-attributes">
+<h2><a class="toc-backref" href="#id15">Non-standard C++11 Attributes</a><a class="headerlink" href="#non-standard-c-11-attributes" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s non-standard C++11 attributes live in the <tt class="docutils literal"><span class="pre">clang</span></tt> attribute
+namespace.</p>
+<p>Clang supports GCC’s <tt class="docutils literal"><span class="pre">gnu</span></tt> attribute namespace. All GCC attributes which
+are accepted with the <tt class="docutils literal"><span class="pre">__attribute__((foo))</span></tt> syntax are also accepted as
+<tt class="docutils literal"><span class="pre">[[gnu::foo]]</span></tt>. This only extends to attributes which are specified by GCC
+(see the list of <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html">GCC function attributes</a>, <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html">GCC variable
+attributes</a>, and
+<a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html">GCC type attributes</a>). As with the GCC
+implementation, these attributes must appertain to the <em>declarator-id</em> in a
+declaration, which means they must go either at the start of the declaration or
+immediately after the name being declared.</p>
+<p>For example, this applies the GNU <tt class="docutils literal"><span class="pre">unused</span></tt> attribute to <tt class="docutils literal"><span class="pre">a</span></tt> and <tt class="docutils literal"><span class="pre">f</span></tt>, and
+also applies the GNU <tt class="docutils literal"><span class="pre">noreturn</span></tt> attribute to <tt class="docutils literal"><span class="pre">f</span></tt>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">unused</span><span class="p">]]</span> <span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="n">f</span> <span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">noreturn</span><span class="p">]]</span> <span class="p">();</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="target-specific-extensions">
+<h2><a class="toc-backref" href="#id16">Target-Specific Extensions</a><a class="headerlink" href="#target-specific-extensions" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports some language features conditionally on some targets.</p>
+<div class="section" id="arm-aarch64-language-extensions">
+<h3>ARM/AArch64 Language Extensions<a class="headerlink" href="#arm-aarch64-language-extensions" title="Permalink to this headline">¶</a></h3>
+<div class="section" id="memory-barrier-intrinsics">
+<h4>Memory Barrier Intrinsics<a class="headerlink" href="#memory-barrier-intrinsics" title="Permalink to this headline">¶</a></h4>
+<p>Clang implements the <tt class="docutils literal"><span class="pre">__dmb</span></tt>, <tt class="docutils literal"><span class="pre">__dsb</span></tt> and <tt class="docutils literal"><span class="pre">__isb</span></tt> intrinsics as defined
+in the <a class="reference external" href="http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf">ARM C Language Extensions Release 2.0</a>.
+Note that these intrinsics are implemented as motion barriers that block
+reordering of memory accesses and side effect instructions. Other instructions
+like simple arithmatic may be reordered around the intrinsic. If you expect to
+have no reordering at all, use inline assembly instead.</p>
+</div>
+</div>
+<div class="section" id="x86-x86-64-language-extensions">
+<h3>X86/X86-64 Language Extensions<a class="headerlink" href="#x86-x86-64-language-extensions" title="Permalink to this headline">¶</a></h3>
+<p>The X86 backend has these language extensions:</p>
+<div class="section" id="memory-references-off-the-gs-segment">
+<h4>Memory references off the GS segment<a class="headerlink" href="#memory-references-off-the-gs-segment" title="Permalink to this headline">¶</a></h4>
+<p>Annotating a pointer with address space #256 causes it to be code generated
+relative to the X86 GS segment register, and address space #257 causes it to be
+relative to the X86 FS segment.  Note that this is a very very low-level
+feature that should only be used if you know what you’re doing (for example in
+an OS kernel).</p>
+<p>Here is an example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#define GS_RELATIVE __attribute__((address_space(256)))</span>
+<span class="kt">int</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int</span> <span class="n">GS_RELATIVE</span> <span class="o">*</span><span class="n">P</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="o">*</span><span class="n">P</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Which compiles to (on X86-32):</p>
+<div class="highlight-gas"><div class="highlight"><pre><span class="nl">_foo:</span>
+        <span class="nf">movl</span>    <span class="mi">4</span><span class="p">(</span><span class="nv">%esp</span><span class="p">),</span> <span class="nv">%eax</span>
+        <span class="nf">movl</span>    <span class="nv">%gs</span><span class="p">:(</span><span class="nv">%eax</span><span class="p">),</span> <span class="nv">%eax</span>
+        <span class="nf">ret</span>
+</pre></div>
+</div>
+</div>
+</div>
+</div>
+<div class="section" id="extensions-for-static-analysis">
+<h2><a class="toc-backref" href="#id17">Extensions for Static Analysis</a><a class="headerlink" href="#extensions-for-static-analysis" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports additional attributes that are useful for documenting program
+invariants and rules for static analysis tools, such as the <a class="reference external" href="http://clang-analyzer.llvm.org/">Clang Static
+Analyzer</a>. These attributes are documented
+in the analyzer’s <a class="reference external" href="http://clang-analyzer.llvm.org/annotations.html">list of source-level annotations</a>.</p>
+</div>
+<div class="section" id="extensions-for-dynamic-analysis">
+<h2><a class="toc-backref" href="#id18">Extensions for Dynamic Analysis</a><a class="headerlink" href="#extensions-for-dynamic-analysis" title="Permalink to this headline">¶</a></h2>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(address_sanitizer)</span></tt> to check if the code is being built
+with <a class="reference internal" href="AddressSanitizer.html"><em>AddressSanitizer</em></a>.</p>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(thread_sanitizer)</span></tt> to check if the code is being built
+with <a class="reference internal" href="ThreadSanitizer.html"><em>ThreadSanitizer</em></a>.</p>
+<p>Use <tt class="docutils literal"><span class="pre">__has_feature(memory_sanitizer)</span></tt> to check if the code is being built
+with <a class="reference internal" href="MemorySanitizer.html"><em>MemorySanitizer</em></a>.</p>
+</div>
+<div class="section" id="extensions-for-selectively-disabling-optimization">
+<h2><a class="toc-backref" href="#id19">Extensions for selectively disabling optimization</a><a class="headerlink" href="#extensions-for-selectively-disabling-optimization" title="Permalink to this headline">¶</a></h2>
+<p>Clang provides a mechanism for selectively disabling optimizations in functions
+and methods.</p>
+<p>To disable optimizations in a single function definition, the GNU-style or C++11
+non-standard attribute <tt class="docutils literal"><span class="pre">optnone</span></tt> can be used.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// The following functions will not be optimized.</span>
+<span class="c1">// GNU-style attribute</span>
+<span class="n">__attribute__</span><span class="p">((</span><span class="n">optnone</span><span class="p">))</span> <span class="kt">int</span> <span class="n">foo</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+<span class="c1">// C++11 attribute</span>
+<span class="p">[[</span><span class="n">clang</span><span class="o">::</span><span class="n">optnone</span><span class="p">]]</span> <span class="kt">int</span> <span class="n">bar</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>To facilitate disabling optimization for a range of function definitions, a
+range-based pragma is provided. Its syntax is <tt class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">optimize</span></tt>
+followed by <tt class="docutils literal"><span class="pre">off</span></tt> or <tt class="docutils literal"><span class="pre">on</span></tt>.</p>
+<p>All function definitions in the region between an <tt class="docutils literal"><span class="pre">off</span></tt> and the following
+<tt class="docutils literal"><span class="pre">on</span></tt> will be decorated with the <tt class="docutils literal"><span class="pre">optnone</span></tt> attribute unless doing so would
+conflict with explicit attributes already present on the function (e.g. the
+ones that control inlining).</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#pragma clang optimize off</span>
+<span class="c1">// This function will be decorated with optnone.</span>
+<span class="kt">int</span> <span class="nf">foo</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+
+<span class="c1">// optnone conflicts with always_inline, so bar() will not be decorated.</span>
+<span class="n">__attribute__</span><span class="p">((</span><span class="n">always_inline</span><span class="p">))</span> <span class="kt">int</span> <span class="n">bar</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+<span class="cp">#pragma clang optimize on</span>
+</pre></div>
+</div>
+<p>If no <tt class="docutils literal"><span class="pre">on</span></tt> is found to close an <tt class="docutils literal"><span class="pre">off</span></tt> region, the end of the region is the
+end of the compilation unit.</p>
+<p>Note that a stray <tt class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">optimize</span> <span class="pre">on</span></tt> does not selectively enable
+additional optimizations when compiling at low optimization levels. This feature
+can only be used to selectively disable optimizations.</p>
+<p>The pragma has an effect on functions only at the point of their definition; for
+function templates, this means that the state of the pragma at the point of an
+instantiation is not necessarily relevant. Consider the following example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="n">T</span> <span class="n">twice</span><span class="p">(</span><span class="n">T</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">t</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cp">#pragma clang optimize off</span>
+<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="n">T</span> <span class="n">thrice</span><span class="p">(</span><span class="n">T</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="mi">3</span> <span class="o">*</span> <span class="n">t</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="n">container</span><span class="p">(</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">twice</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="o">+</span> <span class="n">thrice</span><span class="p">(</span><span class="n">b</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="cp">#pragma clang optimize on</span>
+</pre></div>
+</div>
+<p>In this example, the definition of the template function <tt class="docutils literal"><span class="pre">twice</span></tt> is outside
+the pragma region, whereas the definition of <tt class="docutils literal"><span class="pre">thrice</span></tt> is inside the region.
+The <tt class="docutils literal"><span class="pre">container</span></tt> function is also in the region and will not be optimized, but
+it causes the instantiation of <tt class="docutils literal"><span class="pre">twice</span></tt> and <tt class="docutils literal"><span class="pre">thrice</span></tt> with an <tt class="docutils literal"><span class="pre">int</span></tt> type; of
+these two instantiations, <tt class="docutils literal"><span class="pre">twice</span></tt> will be optimized (because its definition
+was outside the region) and <tt class="docutils literal"><span class="pre">thrice</span></tt> will not be optimized.</p>
+</div>
+<div class="section" id="extensions-for-loop-hint-optimizations">
+<span id="langext-pragma-loop"></span><h2><a class="toc-backref" href="#id20">Extensions for loop hint optimizations</a><a class="headerlink" href="#extensions-for-loop-hint-optimizations" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">loop</span></tt> directive is used to specify hints for optimizing the
+subsequent for, while, do-while, or c++11 range-based for loop. The directive
+provides options for vectorization and interleaving. Loop hints can be specified
+before any loop and will be ignored if the optimization is not safe to apply.</p>
+<p>A vectorized loop performs multiple iterations of the original loop
+in parallel using vector instructions. The instruction set of the target
+processor determines which vector instructions are available and their vector
+widths. This restricts the types of loops that can be vectorized. The vectorizer
+automatically determines if the loop is safe and profitable to vectorize. A
+vector instruction cost model is used to select the vector width.</p>
+<p>Interleaving multiple loop iterations allows modern processors to further
+improve instruction-level parallelism (ILP) using advanced hardware features,
+such as multiple execution units and out-of-order execution. The vectorizer uses
+a cost model that depends on the register pressure and generated code size to
+select the interleaving count.</p>
+<p>Vectorization is enabled by <tt class="docutils literal"><span class="pre">vectorize(enable)</span></tt> and interleaving is enabled
+by <tt class="docutils literal"><span class="pre">interleave(enable)</span></tt>. This is useful when compiling with <tt class="docutils literal"><span class="pre">-Os</span></tt> to
+manually enable vectorization or interleaving.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#pragma clang loop vectorize(enable)</span>
+<span class="cp">#pragma clang loop interleave(enable)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The vector width is specified by <tt class="docutils literal"><span class="pre">vectorize_width(_value_)</span></tt> and the interleave
+count is specified by <tt class="docutils literal"><span class="pre">interleave_count(_value_)</span></tt>, where
+_value_ is a positive integer. This is useful for specifying the optimal
+width/count of the set of target architectures supported by your application.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#pragma clang loop vectorize_width(2)</span>
+<span class="cp">#pragma clang loop interleave_count(2)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Specifying a width/count of 1 disables the optimization, and is equivalent to
+<tt class="docutils literal"><span class="pre">vectorize(disable)</span></tt> or <tt class="docutils literal"><span class="pre">interleave(disable)</span></tt>.</p>
+<p>For convenience multiple loop hints can be specified on a single line.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#pragma clang loop vectorize_width(4) interleave_count(8)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If an optimization cannot be applied any hints that apply to it will be ignored.
+For example, the hint <tt class="docutils literal"><span class="pre">vectorize_width(4)</span></tt> is ignored if the loop is not
+proven safe to vectorize. To identify and diagnose optimization issues use
+<cite>-Rpass</cite>, <cite>-Rpass-missed</cite>, and <cite>-Rpass-analysis</cite> command line options. See the
+user guide for details.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="UsersManual.html">Clang Compiler User’s Manual</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ObjectiveCLiterals.html">Objective-C Literals</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LeakSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LeakSanitizer.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LeakSanitizer.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LeakSanitizer.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,103 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>LeakSanitizer — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Sanitizer special case list" href="SanitizerSpecialCaseList.html" />
+    <link rel="prev" title="DataFlowSanitizer Design Document" href="DataFlowSanitizerDesign.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>LeakSanitizer</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SanitizerSpecialCaseList.html">Sanitizer special case list</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="leaksanitizer">
+<h1>LeakSanitizer<a class="headerlink" href="#leaksanitizer" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#current-status" id="id2">Current status</a></li>
+<li><a class="reference internal" href="#more-information" id="id3">More Information</a></li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>LeakSanitizer is a run-time memory leak detector. It can be combined with
+<a class="reference internal" href="AddressSanitizer.html"><em>AddressSanitizer</em></a> to get both memory error and leak detection.
+LeakSanitizer does not introduce any additional slowdown when used in this mode.
+The LeakSanitizer runtime can also be linked in separately to get leak detection
+only, at a minimal performance cost.</p>
+</div>
+<div class="section" id="current-status">
+<h2><a class="toc-backref" href="#id2">Current status</a><a class="headerlink" href="#current-status" title="Permalink to this headline">¶</a></h2>
+<p>LeakSanitizer is experimental and supported only on x86_64 Linux.</p>
+<p>The combined mode has been tested on fairly large software projects. The
+stand-alone mode has received much less testing.</p>
+<p>There are plans to support LeakSanitizer in <a class="reference internal" href="MemorySanitizer.html"><em>MemorySanitizer</em></a> builds.</p>
+</div>
+<div class="section" id="more-information">
+<h2><a class="toc-backref" href="#id3">More Information</a><a class="headerlink" href="#more-information" title="Permalink to this headline">¶</a></h2>
+<p><a class="reference external" href="https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer">https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer</a></p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SanitizerSpecialCaseList.html">Sanitizer special case list</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchers.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchers.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchers.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchers.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,171 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Matching the Clang AST — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="How To Setup Clang Tooling For LLVM" href="HowToSetupToolingForLLVM.html" />
+    <link rel="prev" title="Tutorial for building tools using LibTooling and LibASTMatchers" href="LibASTMatchersTutorial.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Matching the Clang AST</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="LibASTMatchersTutorial.html">Tutorial for building tools using LibTooling and LibASTMatchers</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="matching-the-clang-ast">
+<h1>Matching the Clang AST<a class="headerlink" href="#matching-the-clang-ast" title="Permalink to this headline">¶</a></h1>
+<p>This document explains how to use Clang’s LibASTMatchers to match interesting
+nodes of the AST and execute code that uses the matched nodes.  Combined with
+<a class="reference internal" href="LibTooling.html"><em>LibTooling</em></a>, LibASTMatchers helps to write code-to-code transformation
+tools or query tools.</p>
+<p>We assume basic knowledge about the Clang AST.  See the <a class="reference internal" href="IntroductionToTheClangAST.html"><em>Introduction
+to the Clang AST</em></a> if you want to learn more
+about how the AST is structured.</p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>LibASTMatchers provides a domain specific language to create predicates on
+Clang’s AST.  This DSL is written in and can be used from C++, allowing users
+to write a single program to both match AST nodes and access the node’s C++
+interface to extract attributes, source locations, or any other information
+provided on the AST level.</p>
+<p>AST matchers are predicates on nodes in the AST.  Matchers are created by
+calling creator functions that allow building up a tree of matchers, where
+inner matchers are used to make the match more specific.</p>
+<p>For example, to create a matcher that matches all class or union declarations
+in the AST of a translation unit, you can call <a class="reference external" href="LibASTMatchersReference.html#recordDecl0Anchor">recordDecl()</a>.  To narrow the match down,
+for example to find all class or union declarations with the name “<tt class="docutils literal"><span class="pre">Foo</span></tt>”,
+insert a <a class="reference external" href="LibASTMatchersReference.html#hasName0Anchor">hasName</a> matcher: the
+call <tt class="docutils literal"><span class="pre">recordDecl(hasName("Foo"))</span></tt> returns a matcher that matches classes or
+unions that are named “<tt class="docutils literal"><span class="pre">Foo</span></tt>”, in any namespace.  By default, matchers that
+accept multiple inner matchers use an implicit <a class="reference external" href="LibASTMatchersReference.html#allOf0Anchor">allOf()</a>.  This allows further narrowing
+down the match, for example to match all classes that are derived from
+“<tt class="docutils literal"><span class="pre">Bar</span></tt>”: <tt class="docutils literal"><span class="pre">recordDecl(hasName("Foo"),</span> <span class="pre">isDerivedFrom("Bar"))</span></tt>.</p>
+</div>
+<div class="section" id="how-to-create-a-matcher">
+<h2>How to create a matcher<a class="headerlink" href="#how-to-create-a-matcher" title="Permalink to this headline">¶</a></h2>
+<p>With more than a thousand classes in the Clang AST, one can quickly get lost
+when trying to figure out how to create a matcher for a specific pattern.  This
+section will teach you how to use a rigorous step-by-step pattern to build the
+matcher you are interested in.  Note that there will always be matchers missing
+for some part of the AST.  See the section about <a class="reference internal" href="#astmatchers-writing"><em>how to write your own
+AST matchers</em></a> later in this document.</p>
+<p>The precondition to using the matchers is to understand how the AST for what you
+want to match looks like.  The
+<a class="reference internal" href="IntroductionToTheClangAST.html"><em>Introduction to the Clang AST</em></a> teaches you
+how to dump a translation unit’s AST into a human readable format.</p>
+<p>In general, the strategy to create the right matchers is:</p>
+<ol class="arabic simple">
+<li>Find the outermost class in Clang’s AST you want to match.</li>
+<li>Look at the <a class="reference external" href="LibASTMatchersReference.html">AST Matcher Reference</a> for
+matchers that either match the node you’re interested in or narrow down
+attributes on the node.</li>
+<li>Create your outer match expression.  Verify that it works as expected.</li>
+<li>Examine the matchers for what the next inner node you want to match is.</li>
+<li>Repeat until the matcher is finished.</li>
+</ol>
+</div>
+<div class="section" id="binding-nodes-in-match-expressions">
+<span id="astmatchers-bind"></span><h2>Binding nodes in match expressions<a class="headerlink" href="#binding-nodes-in-match-expressions" title="Permalink to this headline">¶</a></h2>
+<p>Matcher expressions allow you to specify which parts of the AST are interesting
+for a certain task.  Often you will want to then do something with the nodes
+that were matched, like building source code transformations.</p>
+<p>To that end, matchers that match specific AST nodes (so called node matchers)
+are bindable; for example, <tt class="docutils literal"><span class="pre">recordDecl(hasName("MyClass")).bind("id")</span></tt> will
+bind the matched <tt class="docutils literal"><span class="pre">recordDecl</span></tt> node to the string “<tt class="docutils literal"><span class="pre">id</span></tt>”, to be later
+retrieved in the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder_1_1MatchCallback.html">match callback</a>.</p>
+</div>
+<div class="section" id="writing-your-own-matchers">
+<h2>Writing your own matchers<a class="headerlink" href="#writing-your-own-matchers" title="Permalink to this headline">¶</a></h2>
+<p>There are multiple different ways to define a matcher, depending on its type
+and flexibility.</p>
+<div class="section" id="variadicdyncastallofmatcher-base-derived">
+<h3><tt class="docutils literal"><span class="pre">VariadicDynCastAllOfMatcher<Base,</span> <span class="pre">Derived></span></tt><a class="headerlink" href="#variadicdyncastallofmatcher-base-derived" title="Permalink to this headline">¶</a></h3>
+<p>Those match all nodes of type <em>Base</em> if they can be dynamically casted to
+<em>Derived</em>.  The names of those matchers are nouns, which closely resemble
+<em>Derived</em>.  <tt class="docutils literal"><span class="pre">VariadicDynCastAllOfMatchers</span></tt> are the backbone of the matcher
+hierarchy.  Most often, your match expression will start with one of them, and
+you can <a class="reference internal" href="#astmatchers-bind"><em>bind</em></a> the node they represent to ids for later
+processing.</p>
+<p><tt class="docutils literal"><span class="pre">VariadicDynCastAllOfMatchers</span></tt> are callable classes that model variadic
+template functions in C++03.  They take an aribtrary number of
+<tt class="docutils literal"><span class="pre">Matcher<Derived></span></tt> and return a <tt class="docutils literal"><span class="pre">Matcher<Base></span></tt>.</p>
+</div>
+<div class="section" id="ast-matcher-p-type-name-paramtype-param">
+<h3><tt class="docutils literal"><span class="pre">AST_MATCHER_P(Type,</span> <span class="pre">Name,</span> <span class="pre">ParamType,</span> <span class="pre">Param)</span></tt><a class="headerlink" href="#ast-matcher-p-type-name-paramtype-param" title="Permalink to this headline">¶</a></h3>
+<p>Most matcher definitions use the matcher creation macros.  Those define both
+the matcher of type <tt class="docutils literal"><span class="pre">Matcher<Type></span></tt> itself, and a matcher-creation function
+named <em>Name</em> that takes a parameter of type <em>ParamType</em> and returns the
+corresponding matcher.</p>
+<p>There are multiple matcher definition macros that deal with polymorphic return
+values and different parameter counts.  See <a class="reference external" href="http://clang.llvm.org/doxygen/ASTMatchersMacros_8h.html">ASTMatchersMacros.h</a>.</p>
+</div>
+<div class="section" id="matcher-creation-functions">
+<span id="astmatchers-writing"></span><h3>Matcher creation functions<a class="headerlink" href="#matcher-creation-functions" title="Permalink to this headline">¶</a></h3>
+<p>Matchers are generated by nesting calls to matcher creation functions.  Most of
+the time those functions are either created by using
+<tt class="docutils literal"><span class="pre">VariadicDynCastAllOfMatcher</span></tt> or the matcher creation macros (see below).
+The free-standing functions are an indication that this matcher is just a
+combination of other matchers, as is for example the case with <a class="reference external" href="LibASTMatchersReference.html#callee1Anchor">callee</a>.</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="LibASTMatchersTutorial.html">Tutorial for building tools using LibTooling and LibASTMatchers</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersReference.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersReference.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersReference.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersReference.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,3863 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>AST Matcher Reference</title>
+<link type="text/css" rel="stylesheet" href="../menu.css" />
+<link type="text/css" rel="stylesheet" href="../content.css" />
+<style type="text/css">
+td {
+  padding: .33em;
+}
+td.doc {
+  display: none;
+  border-bottom: 1px solid black;
+}
+td.name:hover {
+  color: blue;
+  cursor: pointer;
+}
+</style>
+<script type="text/javascript">
+function toggle(id) {
+  if (!id) return;
+  row = document.getElementById(id);
+  if (row.style.display != 'table-cell')
+    row.style.display = 'table-cell';
+  else
+    row.style.display = 'none';
+}
+</script>
+</head>
+<body onLoad="toggle(location.hash.substring(1, location.hash.length - 6))">
+
+<!--#include virtual="../menu.html.incl"-->
+
+<div id="content">
+
+<h1>AST Matcher Reference</h1>
+
+<p>This document shows all currently implemented matchers. The matchers are grouped
+by category and node type they match. You can click on matcher names to show the
+matcher's source documentation.</p>
+
+<p>There are three different basic categories of matchers:
+<ul>
+<li><a href="#decl-matchers">Node Matchers:</a> Matchers that match a specific type of AST node.</li>
+<li><a href="#narrowing-matchers">Narrowing Matchers:</a> Matchers that match attributes on AST nodes.</li>
+<li><a href="#traversal-matchers">Traversal Matchers:</a> Matchers that allow traversal between AST nodes.</li>
+</ul>
+</p>
+
+<p>Within each category the matchers are ordered by node type they match on.
+Note that if a matcher can match multiple node types, it will it will appear
+multiple times. This means that by searching for Matcher<Stmt> you can
+find all matchers that can be used to match on Stmt nodes.</p>
+
+<p>The exception to that rule are matchers that can match on any node. Those
+are marked with a * and are listed in the beginning of each category.</p>
+
+<p>Note that the categorization of matchers is a great help when you combine
+them into matcher expressions. You will usually want to form matcher expressions
+that read like english sentences by alternating between node matchers and
+narrowing or traversal matchers, like this:
+<pre>
+recordDecl(hasDescendant(
+    ifStmt(hasTrueExpression(
+        expr(hasDescendant(
+            ifStmt()))))))
+</pre>
+</p>
+
+<!-- ======================================================================= -->
+<h2 id="decl-matchers">Node Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Node matchers are at the core of matcher expressions - they specify the type
+of node that is expected. Every match expression starts with a node matcher,
+which can then be further refined with a narrowing or traversal matcher. All
+traversal matchers take node matchers as their arguments.</p>
+
+<p>For convenience, all node matchers take an arbitrary number of arguments
+and implicitly act as allOf matchers.</p>
+
+<p>Node matchers are the only matchers that support the bind("id") call to
+bind the matched node to the given string, to be later retrieved from the
+match callback.</p>
+
+<p>It is important to remember that the arguments to node matchers are
+predicates on the same node, just with additional information about the type.
+This is often useful to make matcher expression more readable by inlining bind
+calls into redundant node matchers inside another node matcher:
+<pre>
+// This binds the CXXRecordDecl to "id", as the decl() matcher will stay on
+// the same node.
+recordDecl(decl().bind("id"), hasName("::MyClass"))
+</pre>
+</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_DECL_MATCHERS -->
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('ctorInitializer0')"><a name="ctorInitializer0Anchor">ctorInitializer</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="ctorInitializer0"><pre>Matches constructor initializers.
+
+Examples matches i(42).
+  class C {
+    C() : i(42) {}
+    int i;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('accessSpecDecl0')"><a name="accessSpecDecl0Anchor">accessSpecDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AccessSpecDecl.html">AccessSpecDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="accessSpecDecl0"><pre>Matches C++ access specifier declarations.
+
+Given
+  class C {
+  public:
+    int a;
+  };
+accessSpecDecl()
+  matches 'public:'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateDecl0')"><a name="classTemplateDecl0Anchor">classTemplateDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateDecl.html">ClassTemplateDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="classTemplateDecl0"><pre>Matches C++ class template declarations.
+
+Example matches Z
+  template<class T> class Z {};
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateSpecializationDecl0')"><a name="classTemplateSpecializationDecl0Anchor">classTemplateSpecializationDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="classTemplateSpecializationDecl0"><pre>Matches C++ class template specializations.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+classTemplateSpecializationDecl()
+  matches the specializations A<int> and A<double>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('constructorDecl0')"><a name="constructorDecl0Anchor">constructorDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="constructorDecl0"><pre>Matches C++ constructor declarations.
+
+Example matches Foo::Foo() and Foo::Foo(int)
+  class Foo {
+   public:
+    Foo();
+    Foo(int);
+    int DoSomething();
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('decl0')"><a name="decl0Anchor">decl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="decl0"><pre>Matches declarations.
+
+Examples matches X, C, and the friend declaration inside C;
+  void X();
+  class C {
+    friend X;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('declaratorDecl0')"><a name="declaratorDecl0Anchor">declaratorDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclaratorDecl.html">DeclaratorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declaratorDecl0"><pre>Matches declarator declarations (field, variable, function
+and non-type template parameter declarations).
+
+Given
+  class X { int y; };
+declaratorDecl()
+  matches int y.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('destructorDecl0')"><a name="destructorDecl0Anchor">destructorDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="destructorDecl0"><pre>Matches explicit C++ destructor declarations.
+
+Example matches Foo::~Foo()
+  class Foo {
+   public:
+    virtual ~Foo();
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumConstantDecl0')"><a name="enumConstantDecl0Anchor">enumConstantDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumConstantDecl.html">EnumConstantDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="enumConstantDecl0"><pre>Matches enum constants.
+
+Example matches A, B, C
+  enum X {
+    A, B, C
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumDecl0')"><a name="enumDecl0Anchor">enumDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumDecl.html">EnumDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="enumDecl0"><pre>Matches enum declarations.
+
+Example matches X
+  enum X {
+    A, B, C
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('fieldDecl0')"><a name="fieldDecl0Anchor">fieldDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="fieldDecl0"><pre>Matches field declarations.
+
+Given
+  class X { int m; };
+fieldDecl()
+  matches 'm'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('friendDecl0')"><a name="friendDecl0Anchor">friendDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FriendDecl.html">FriendDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="friendDecl0"><pre>Matches friend declarations.
+
+Given
+  class X { friend void foo(); };
+friendDecl()
+  matches 'friend void foo()'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionDecl0')"><a name="functionDecl0Anchor">functionDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionDecl0"><pre>Matches function declarations.
+
+Example matches f
+  void f();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionTemplateDecl0')"><a name="functionTemplateDecl0Anchor">functionTemplateDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionTemplateDecl.html">FunctionTemplateDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionTemplateDecl0"><pre>Matches C++ function template declarations.
+
+Example matches f
+  template<class T> void f(T t) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('methodDecl0')"><a name="methodDecl0Anchor">methodDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="methodDecl0"><pre>Matches method declarations.
+
+Example matches y
+  class X { void y(); };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namedDecl0')"><a name="namedDecl0Anchor">namedDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="namedDecl0"><pre>Matches a declaration of anything that could have a name.
+
+Example matches X, S, the anonymous union type, i, and U;
+  typedef int X;
+  struct S {
+    union {
+      int i;
+    } U;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namespaceDecl0')"><a name="namespaceDecl0Anchor">namespaceDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceDecl.html">NamespaceDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="namespaceDecl0"><pre>Matches a declaration of a namespace.
+
+Given
+  namespace {}
+  namespace test {}
+namespaceDecl()
+  matches "namespace {}" and "namespace test {}"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('parmVarDecl0')"><a name="parmVarDecl0Anchor">parmVarDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parmVarDecl0"><pre>Matches parameter variable declarations.
+
+Given
+  void f(int x);
+parmVarDecl()
+  matches int x.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('recordDecl0')"><a name="recordDecl0Anchor">recordDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="recordDecl0"><pre>Matches C++ class declarations.
+
+Example matches X, Z
+  class X;
+  template<class T> class Z {};
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('unresolvedUsingValueDecl0')"><a name="unresolvedUsingValueDecl0Anchor">unresolvedUsingValueDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingValueDecl.html">UnresolvedUsingValueDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unresolvedUsingValueDecl0"><pre>Matches unresolved using value declarations.
+
+Given
+  template<typename X>
+  class C : private X {
+    using X::x;
+  };
+unresolvedUsingValueDecl()
+  matches using X::x </pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('usingDecl0')"><a name="usingDecl0Anchor">usingDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingDecl.html">UsingDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="usingDecl0"><pre>Matches using declarations.
+
+Given
+  namespace X { int x; }
+  using X::x;
+usingDecl()
+  matches using X::x </pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('varDecl0')"><a name="varDecl0Anchor">varDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="varDecl0"><pre>Matches variable declarations.
+
+Note: this does not match declarations of member variables, which are
+"field" declarations in Clang parlance.
+
+Example matches a
+  int a;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>></td><td class="name" onclick="toggle('nestedNameSpecifierLoc0')"><a name="nestedNameSpecifierLoc0Anchor">nestedNameSpecifierLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nestedNameSpecifierLoc0"><pre>Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>></td><td class="name" onclick="toggle('nestedNameSpecifier0')"><a name="nestedNameSpecifier0Anchor">nestedNameSpecifier</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nestedNameSpecifier0"><pre>Matches nested name specifiers.
+
+Given
+  namespace ns {
+    struct A { static void f(); };
+    void A::f() {}
+    void g() { A::f(); }
+  }
+  ns::A a;
+nestedNameSpecifier()
+  matches "ns::" and both "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('qualType0')"><a name="qualType0Anchor">qualType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="qualType0"><pre>Matches QualTypes in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('arraySubscriptExpr0')"><a name="arraySubscriptExpr0Anchor">arraySubscriptExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="arraySubscriptExpr0"><pre>Matches array subscript expressions.
+
+Given
+  int i = a[1];
+arraySubscriptExpr()
+  matches "a[1]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('asmStmt0')"><a name="asmStmt0Anchor">asmStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AsmStmt.html">AsmStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="asmStmt0"><pre>Matches asm statements.
+
+ int i = 100;
+  __asm("mov al, 2");
+asmStmt()
+  matches '__asm("mov al, 2")'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('binaryOperator0')"><a name="binaryOperator0Anchor">binaryOperator</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="binaryOperator0"><pre>Matches binary operator expressions.
+
+Example matches a || b
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('bindTemporaryExpr0')"><a name="bindTemporaryExpr0Anchor">bindTemporaryExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="bindTemporaryExpr0"><pre>Matches nodes where temporaries are created.
+
+Example matches FunctionTakesString(GetStringByValue())
+    (matcher = bindTemporaryExpr())
+  FunctionTakesString(GetStringByValue());
+  FunctionTakesStringByPointer(GetStringPointer());
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('boolLiteral0')"><a name="boolLiteral0Anchor">boolLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="boolLiteral0"><pre>Matches bool literals.
+
+Example matches true
+  true
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('breakStmt0')"><a name="breakStmt0Anchor">breakStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BreakStmt.html">BreakStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="breakStmt0"><pre>Matches break statements.
+
+Given
+  while (true) { break; }
+breakStmt()
+  matches 'break'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cStyleCastExpr0')"><a name="cStyleCastExpr0Anchor">cStyleCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CStyleCastExpr.html">CStyleCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cStyleCastExpr0"><pre>Matches a C-style cast expression.
+
+Example: Matches (int*) 2.2f in
+  int i = (int) 2.2f;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('callExpr0')"><a name="callExpr0Anchor">callExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="callExpr0"><pre>Matches call expressions.
+
+Example matches x.y() and y()
+  X x;
+  x.y();
+  y();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('caseStmt0')"><a name="caseStmt0Anchor">caseStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="caseStmt0"><pre>Matches case statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+caseStmt()
+  matches 'case 42: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('castExpr0')"><a name="castExpr0Anchor">castExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="castExpr0"><pre>Matches any cast nodes of Clang's AST.
+
+Example: castExpr() matches each of the following:
+  (int) 3;
+  const_cast<Expr *>(SubExpr);
+  char c = 0;
+but does not match
+  int i = (0);
+  int k = 0;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('catchStmt0')"><a name="catchStmt0Anchor">catchStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="catchStmt0"><pre>Matches catch statements.
+
+  try {} catch(int i) {}
+catchStmt()
+  matches 'catch(int i)'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('characterLiteral0')"><a name="characterLiteral0Anchor">characterLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="characterLiteral0"><pre>Matches character literals (also matches wchar_t).
+
+Not matching Hex-encoded chars (e.g. 0x1234, which is a IntegerLiteral),
+though.
+
+Example matches 'a', L'a'
+  char ch = 'a'; wchar_t chw = L'a';
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('compoundLiteralExpr0')"><a name="compoundLiteralExpr0Anchor">compoundLiteralExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundLiteralExpr.html">CompoundLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="compoundLiteralExpr0"><pre>Matches compound (i.e. non-scalar) literals
+
+Example match: {1}, (1, 2)
+  int array[4] = {1}; vector int myvec = (vector int)(1, 2);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('compoundStmt0')"><a name="compoundStmt0Anchor">compoundStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="compoundStmt0"><pre>Matches compound statements.
+
+Example matches '{}' and '{{}}'in 'for (;;) {{}}'
+  for (;;) {{}}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('conditionalOperator0')"><a name="conditionalOperator0Anchor">conditionalOperator</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConditionalOperator.html">ConditionalOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="conditionalOperator0"><pre>Matches conditional operator expressions.
+
+Example matches a ? b : c
+  (a ? b : c) + 42
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('constCastExpr0')"><a name="constCastExpr0Anchor">constCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="constCastExpr0"><pre>Matches a const_cast expression.
+
+Example: Matches const_cast<int*>(&r) in
+  int n = 42;
+  const int &r(n);
+  int* p = const_cast<int*>(&r);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('constructExpr0')"><a name="constructExpr0Anchor">constructExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="constructExpr0"><pre>Matches constructor call expressions (including implicit ones).
+
+Example matches string(ptr, n) and ptr within arguments of f
+    (matcher = constructExpr())
+  void f(const string &a, const string &b);
+  char *ptr;
+  int n;
+  f(string(ptr, n), ptr);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('continueStmt0')"><a name="continueStmt0Anchor">continueStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ContinueStmt.html">ContinueStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="continueStmt0"><pre>Matches continue statements.
+
+Given
+  while (true) { continue; }
+continueStmt()
+  matches 'continue'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declRefExpr0')"><a name="declRefExpr0Anchor">declRefExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declRefExpr0"><pre>Matches expressions that refer to declarations.
+
+Example matches x in if (x)
+  bool x;
+  if (x) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declStmt0')"><a name="declStmt0Anchor">declStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declStmt0"><pre>Matches declaration statements.
+
+Given
+  int a;
+declStmt()
+  matches 'int a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultArgExpr0')"><a name="defaultArgExpr0Anchor">defaultArgExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="defaultArgExpr0"><pre>Matches the value of a default argument at the call site.
+
+Example matches the CXXDefaultArgExpr placeholder inserted for the
+    default value of the second parameter in the call expression f(42)
+    (matcher = defaultArgExpr())
+  void f(int x, int y = 0);
+  f(42);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultStmt0')"><a name="defaultStmt0Anchor">defaultStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DefaultStmt.html">DefaultStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="defaultStmt0"><pre>Matches default statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+defaultStmt()
+  matches 'default: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('deleteExpr0')"><a name="deleteExpr0Anchor">deleteExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDeleteExpr.html">CXXDeleteExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="deleteExpr0"><pre>Matches delete expressions.
+
+Given
+  delete X;
+deleteExpr()
+  matches 'delete X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('doStmt0')"><a name="doStmt0Anchor">doStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="doStmt0"><pre>Matches do statements.
+
+Given
+  do {} while (true);
+doStmt()
+  matches 'do {} while(true)'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('dynamicCastExpr0')"><a name="dynamicCastExpr0Anchor">dynamicCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="dynamicCastExpr0"><pre>Matches a dynamic_cast expression.
+
+Example:
+  dynamicCastExpr()
+matches
+  dynamic_cast<D*>(&b);
+in
+  struct B { virtual ~B() {} }; struct D : B {};
+  B b;
+  D* p = dynamic_cast<D*>(&b);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('explicitCastExpr0')"><a name="explicitCastExpr0Anchor">explicitCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="explicitCastExpr0"><pre>Matches explicit cast expressions.
+
+Matches any cast expression written in user code, whether it be a
+C-style cast, a functional-style cast, or a keyword cast.
+
+Does not match implicit conversions.
+
+Note: the name "explicitCast" is chosen to match Clang's terminology, as
+Clang uses the term "cast" to apply to implicit conversions as well as to
+actual cast expressions.
+
+hasDestinationType.
+
+Example: matches all five of the casts in
+  int((int)(reinterpret_cast<int>(static_cast<int>(const_cast<int>(42)))))
+but does not match the implicit conversion in
+  long ell = 42;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('expr0')"><a name="expr0Anchor">expr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="expr0"><pre>Matches expressions.
+
+Example matches x()
+  void f() { x(); }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('exprWithCleanups0')"><a name="exprWithCleanups0Anchor">exprWithCleanups</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ExprWithCleanups.html">ExprWithCleanups</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="exprWithCleanups0"><pre>Matches expressions that introduce cleanups to be run at the end
+of the sub-expression's evaluation.
+
+Example matches std::string()
+  const std::string str = std::string();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('floatLiteral0')"><a name="floatLiteral0Anchor">floatLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="floatLiteral0"><pre>Matches float literals of all sizes encodings, e.g.
+1.0, 1.0f, 1.0L and 1e10.
+
+Does not match implicit conversions such as
+  float a = 10;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forRangeStmt0')"><a name="forRangeStmt0Anchor">forRangeStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="forRangeStmt0"><pre>Matches range-based for statements.
+
+forRangeStmt() matches 'for (auto a : i)'
+  int i[] =  {1, 2, 3}; for (auto a : i);
+  for(int j = 0; j < 5; ++j);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forStmt0')"><a name="forStmt0Anchor">forStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="forStmt0"><pre>Matches for statements.
+
+Example matches 'for (;;) {}'
+  for (;;) {}
+  int i[] =  {1, 2, 3}; for (auto a : i);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('functionalCastExpr0')"><a name="functionalCastExpr0Anchor">functionalCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionalCastExpr0"><pre>Matches functional cast expressions
+
+Example: Matches Foo(bar);
+  Foo f = bar;
+  Foo g = (Foo) bar;
+  Foo h = Foo(bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('gotoStmt0')"><a name="gotoStmt0Anchor">gotoStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1GotoStmt.html">GotoStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="gotoStmt0"><pre>Matches goto statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+gotoStmt()
+  matches 'goto FOO'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('ifStmt0')"><a name="ifStmt0Anchor">ifStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="ifStmt0"><pre>Matches if statements.
+
+Example matches 'if (x) {}'
+  if (x) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('implicitCastExpr0')"><a name="implicitCastExpr0Anchor">implicitCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitCastExpr.html">ImplicitCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="implicitCastExpr0"><pre>Matches the implicit cast nodes of Clang's AST.
+
+This matches many different places, including function call return value
+eliding, as well as any type conversions.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('initListExpr0')"><a name="initListExpr0Anchor">initListExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="initListExpr0"><pre>Matches init list expressions.
+
+Given
+  int a[] = { 1, 2 };
+  struct B { int x, y; };
+  B b = { 5, 6 };
+initList()
+  matches "{ 1, 2 }" and "{ 5, 6 }"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('integerLiteral0')"><a name="integerLiteral0Anchor">integerLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="integerLiteral0"><pre>Matches integer literals of all sizes encodings, e.g.
+1, 1L, 0x1 and 1U.
+
+Does not match character-encoded integers such as L'a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('labelStmt0')"><a name="labelStmt0Anchor">labelStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="labelStmt0"><pre>Matches label statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+labelStmt()
+  matches 'FOO:'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('lambdaExpr0')"><a name="lambdaExpr0Anchor">lambdaExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LambdaExpr.html">LambdaExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="lambdaExpr0"><pre>Matches lambda expressions.
+
+Example matches [&](){return 5;}
+  [&](){return 5;}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('materializeTemporaryExpr0')"><a name="materializeTemporaryExpr0Anchor">materializeTemporaryExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MaterializeTemporaryExpr.html">MaterializeTemporaryExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="materializeTemporaryExpr0"><pre>Matches nodes where temporaries are materialized.
+
+Example: Given
+  struct T {void func()};
+  T f();
+  void g(T);
+materializeTemporaryExpr() matches 'f()' in these statements
+  T u(f());
+  g(f());
+but does not match
+  f();
+  f().func();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberCallExpr0')"><a name="memberCallExpr0Anchor">memberCallExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="memberCallExpr0"><pre>Matches member call expressions.
+
+Example matches x.y()
+  X x;
+  x.y();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberExpr0')"><a name="memberExpr0Anchor">memberExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="memberExpr0"><pre>Matches member expressions.
+
+Given
+  class Y {
+    void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; }
+    int a; static int b;
+  };
+memberExpr()
+  matches this->x, x, y.x, a, this->b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('newExpr0')"><a name="newExpr0Anchor">newExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="newExpr0"><pre>Matches new expressions.
+
+Given
+  new X;
+newExpr()
+  matches 'new X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('nullPtrLiteralExpr0')"><a name="nullPtrLiteralExpr0Anchor">nullPtrLiteralExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNullPtrLiteralExpr.html">CXXNullPtrLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nullPtrLiteralExpr0"><pre>Matches nullptr literal.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('nullStmt0')"><a name="nullStmt0Anchor">nullStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NullStmt.html">NullStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nullStmt0"><pre>Matches null statements.
+
+  foo();;
+nullStmt()
+  matches the second ';'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('operatorCallExpr0')"><a name="operatorCallExpr0Anchor">operatorCallExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="operatorCallExpr0"><pre>Matches overloaded operator calls.
+
+Note that if an operator isn't overloaded, it won't match. Instead, use
+binaryOperator matcher.
+Currently it does not match operators such as new delete.
+FIXME: figure out why these do not match?
+
+Example matches both operator<<((o << b), c) and operator<<(o, b)
+    (matcher = operatorCallExpr())
+  ostream &operator<< (ostream &out, int i) { };
+  ostream &o; int b = 1, c = 1;
+  o << b << c;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('reinterpretCastExpr0')"><a name="reinterpretCastExpr0Anchor">reinterpretCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="reinterpretCastExpr0"><pre>Matches a reinterpret_cast expression.
+
+Either the source expression or the destination type can be matched
+using has(), but hasDestinationType() is more specific and can be
+more readable.
+
+Example matches reinterpret_cast<char*>(&p) in
+  void* p = reinterpret_cast<char*>(&p);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('returnStmt0')"><a name="returnStmt0Anchor">returnStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">ReturnStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="returnStmt0"><pre>Matches return statements.
+
+Given
+  return 1;
+returnStmt()
+  matches 'return 1'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('staticCastExpr0')"><a name="staticCastExpr0Anchor">staticCastExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="staticCastExpr0"><pre>Matches a C++ static_cast expression.
+
+hasDestinationType
+reinterpretCast
+
+Example:
+  staticCastExpr()
+matches
+  static_cast<long>(8)
+in
+  long eight(static_cast<long>(8));
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmt0')"><a name="stmt0Anchor">stmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stmt0"><pre>Matches statements.
+
+Given
+  { ++a; }
+stmt()
+  matches both the compound statement '{ ++a; }' and '++a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stringLiteral0')"><a name="stringLiteral0Anchor">stringLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1StringLiteral.html">StringLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stringLiteral0"><pre>Matches string literals (also matches wide string literals).
+
+Example matches "abcd", L"abcd"
+  char *s = "abcd"; wchar_t *ws = L"abcd"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('switchCase0')"><a name="switchCase0Anchor">switchCase</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchCase.html">SwitchCase</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="switchCase0"><pre>Matches case and default statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+switchCase()
+  matches 'case 42: break;' and 'default: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('switchStmt0')"><a name="switchStmt0Anchor">switchStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchStmt.html">SwitchStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="switchStmt0"><pre>Matches switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+switchStmt()
+  matches 'switch(a)'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('temporaryObjectExpr0')"><a name="temporaryObjectExpr0Anchor">temporaryObjectExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTemporaryObjectExpr.html">CXXTemporaryObjectExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="temporaryObjectExpr0"><pre>Matches functional cast expressions having N != 1 arguments
+
+Example: Matches Foo(bar, bar)
+  Foo h = Foo(bar, bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('thisExpr0')"><a name="thisExpr0Anchor">thisExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThisExpr.html">CXXThisExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="thisExpr0"><pre>Matches implicit and explicit this expressions.
+
+Example matches the implicit this expression in "return i".
+    (matcher = thisExpr())
+struct foo {
+  int i;
+  int f() { return i; }
+};
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('throwExpr0')"><a name="throwExpr0Anchor">throwExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThrowExpr.html">CXXThrowExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="throwExpr0"><pre>Matches throw expressions.
+
+  try { throw 5; } catch(int i) {}
+throwExpr()
+  matches 'throw 5'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('tryStmt0')"><a name="tryStmt0Anchor">tryStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTryStmt.html">CXXTryStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="tryStmt0"><pre>Matches try statements.
+
+  try {} catch(int i) {}
+tryStmt()
+  matches 'try {}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unaryExprOrTypeTraitExpr0')"><a name="unaryExprOrTypeTraitExpr0Anchor">unaryExprOrTypeTraitExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryExprOrTypeTraitExpr0"><pre>Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
+
+Given
+  Foo x = bar;
+  int y = sizeof(x) + alignof(x);
+unaryExprOrTypeTraitExpr()
+  matches sizeof(x) and alignof(x)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unaryOperator0')"><a name="unaryOperator0Anchor">unaryOperator</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryOperator0"><pre>Matches unary operator expressions.
+
+Example matches !a
+  !a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unresolvedConstructExpr0')"><a name="unresolvedConstructExpr0Anchor">unresolvedConstructExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXUnresolvedConstructExpr.html">CXXUnresolvedConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unresolvedConstructExpr0"><pre>Matches unresolved constructor call expressions.
+
+Example matches T(t) in return statement of f
+    (matcher = unresolvedConstructExpr())
+  template <typename T>
+  void f(const T& t) { return T(t); }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('userDefinedLiteral0')"><a name="userDefinedLiteral0Anchor">userDefinedLiteral</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UserDefinedLiteral.html">UserDefinedLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="userDefinedLiteral0"><pre>Matches user defined literal operator call.
+
+Example match: "foo"_suffix
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('whileStmt0')"><a name="whileStmt0Anchor">whileStmt</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="whileStmt0"><pre>Matches while statements.
+
+Given
+  while (true) {}
+whileStmt()
+  matches 'while (true) {}'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('typeLoc0')"><a name="typeLoc0Anchor">typeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typeLoc0"><pre>Matches TypeLocs in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('arrayType0')"><a name="arrayType0Anchor">arrayType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="arrayType0"><pre>Matches all kinds of arrays.
+
+Given
+  int a[] = { 2, 3 };
+  int b[4];
+  void f() { int c[a[0]]; }
+arrayType()
+  matches "int a[]", "int b[4]" and "int c[a[0]]";
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('atomicType0')"><a name="atomicType0Anchor">atomicType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="atomicType0"><pre>Matches atomic types.
+
+Given
+  _Atomic(int) i;
+atomicType()
+  matches "_Atomic(int) i"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('autoType0')"><a name="autoType0Anchor">autoType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="autoType0"><pre>Matches types nodes representing C++11 auto types.
+
+Given:
+  auto n = 4;
+  int v[] = { 2, 3 }
+  for (auto i : v) { }
+autoType()
+  matches "auto n" and "auto i"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('blockPointerType0')"><a name="blockPointerType0Anchor">blockPointerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="blockPointerType0"><pre>Matches block pointer types, i.e. types syntactically represented as
+"void (^)(int)".
+
+The pointee is always required to be a FunctionType.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('builtinType0')"><a name="builtinType0Anchor">builtinType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BuiltinType.html">BuiltinType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="builtinType0"><pre>Matches builtin Types.
+
+Given
+  struct A {};
+  A a;
+  int b;
+  float c;
+  bool d;
+builtinType()
+  matches "int b", "float c" and "bool d"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('complexType0')"><a name="complexType0Anchor">complexType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="complexType0"><pre>Matches C99 complex types.
+
+Given
+  _Complex float f;
+complexType()
+  matches "_Complex float f"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('constantArrayType0')"><a name="constantArrayType0Anchor">constantArrayType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConstantArrayType.html">ConstantArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="constantArrayType0"><pre>Matches C arrays with a specified constant size.
+
+Given
+  void() {
+    int a[2];
+    int b[] = { 2, 3 };
+    int c[b[0]];
+  }
+constantArrayType()
+  matches "int a[2]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('dependentSizedArrayType0')"><a name="dependentSizedArrayType0Anchor">dependentSizedArrayType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DependentSizedArrayType.html">DependentSizedArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="dependentSizedArrayType0"><pre>Matches C++ arrays whose size is a value-dependent expression.
+
+Given
+  template<typename T, int Size>
+  class array {
+    T data[Size];
+  };
+dependentSizedArrayType
+  matches "T data[Size]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('elaboratedType0')"><a name="elaboratedType0Anchor">elaboratedType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ElaboratedType.html">ElaboratedType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="elaboratedType0"><pre>Matches types specified with an elaborated type keyword or with a
+qualified name.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+  class C {};
+
+  class C c;
+  N::M::D d;
+
+elaboratedType() matches the type of the variable declarations of both
+c and d.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('functionType0')"><a name="functionType0Anchor">functionType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html">FunctionType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionType0"><pre>Matches FunctionType nodes.
+
+Given
+  int (*f)(int);
+  void g();
+functionType()
+  matches "int (*f)(int)" and the type of "g".
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('incompleteArrayType0')"><a name="incompleteArrayType0Anchor">incompleteArrayType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IncompleteArrayType.html">IncompleteArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="incompleteArrayType0"><pre>Matches C arrays with unspecified size.
+
+Given
+  int a[] = { 2, 3 };
+  int b[42];
+  void f(int c[]) { int d[a[0]]; };
+incompleteArrayType()
+  matches "int a[]" and "int c[]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('lValueReferenceType0')"><a name="lValueReferenceType0Anchor">lValueReferenceType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LValueReferenceType.html">LValueReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="lValueReferenceType0"><pre>Matches lvalue reference types.
+
+Given:
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+lValueReferenceType() matches the types of b, d, and e. e is
+matched since the type is deduced as int& by reference collapsing rules.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('memberPointerType0')"><a name="memberPointerType0Anchor">memberPointerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="memberPointerType0"><pre>Matches member pointer types.
+Given
+  struct A { int i; }
+  A::* ptr = A::i;
+memberPointerType()
+  matches "A::* ptr"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('parenType0')"><a name="parenType0Anchor">parenType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenType.html">ParenType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parenType0"><pre>Matches ParenType nodes.
+
+Given
+  int (*ptr_to_array)[4];
+  int *array_of_ptrs[4];
+
+varDecl(hasType(pointsTo(parenType()))) matches ptr_to_array but not
+array_of_ptrs.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('pointerType0')"><a name="pointerType0Anchor">pointerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="pointerType0"><pre>Matches pointer types.
+
+Given
+  int *a;
+  int &b = *a;
+  int c = 5;
+pointerType()
+  matches "int *a"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('rValueReferenceType0')"><a name="rValueReferenceType0Anchor">rValueReferenceType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RValueReferenceType.html">RValueReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="rValueReferenceType0"><pre>Matches rvalue reference types.
+
+Given:
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+rValueReferenceType() matches the types of c and f. e is not
+matched as it is deduced to int& by reference collapsing rules.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('recordType0')"><a name="recordType0Anchor">recordType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="recordType0"><pre>Matches record types (e.g. structs, classes).
+
+Given
+  class C {};
+  struct S {};
+
+  C c;
+  S s;
+
+recordType() matches the type of the variable declarations of both c
+and s.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('referenceType0')"><a name="referenceType0Anchor">referenceType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="referenceType0"><pre>Matches both lvalue and rvalue reference types.
+
+Given
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+referenceType() matches the types of b, c, d, e, and f.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('templateSpecializationType0')"><a name="templateSpecializationType0Anchor">templateSpecializationType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateSpecializationType0"><pre>Matches template specialization types.
+
+Given
+  template <typename T>
+  class C { };
+
+  template class C<int>;  A
+  C<char> var;            B
+
+templateSpecializationType() matches the type of the explicit
+instantiation in A and the type of the variable declaration in B.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('type0')"><a name="type0Anchor">type</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="type0"><pre>Matches Types in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('typedefType0')"><a name="typedefType0Anchor">typedefType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typedefType0"><pre>Matches typedef types.
+
+Given
+  typedef int X;
+typedefType()
+  matches "typedef int X"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('unaryTransformType0')"><a name="unaryTransformType0Anchor">unaryTransformType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryTransformType.html">UnaryTransformType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryTransformType0"><pre>Matches types nodes representing unary type transformations.
+
+Given:
+  typedef __underlying_type(T) type;
+unaryTransformType()
+  matches "__underlying_type(T)"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('variableArrayType0')"><a name="variableArrayType0Anchor">variableArrayType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VariableArrayType.html">VariableArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="variableArrayType0"><pre>Matches C arrays with a specified size that is not an
+integer-constant-expression.
+
+Given
+  void f() {
+    int a[] = { 2, 3 }
+    int b[42];
+    int c[a[0]];
+variableArrayType()
+  matches "int c[a[0]]"
+</pre></td></tr>
+
+<!--END_DECL_MATCHERS -->
+</table>
+
+<!-- ======================================================================= -->
+<h2 id="narrowing-matchers">Narrowing Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Narrowing matchers match certain attributes on the current node, thus
+narrowing down the set of nodes of the current type to match on.</p>
+
+<p>There are special logical narrowing matchers (allOf, anyOf, anything and unless)
+which allow users to create more powerful match expressions.</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_NARROWING_MATCHERS -->
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('allOf0')"><a name="allOf0Anchor">allOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="allOf0"><pre>Matches if all given matchers match.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('anyOf0')"><a name="anyOf0Anchor">anyOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="anyOf0"><pre>Matches if any of the given matchers matches.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('anything0')"><a name="anything0Anchor">anything</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="anything0"><pre>Matches any node.
+
+Useful when another matcher requires a child matcher, but there's no
+additional constraint. This will often be used with an explicit conversion
+to an internal::Matcher<> type such as TypeMatcher.
+
+Example: DeclarationMatcher(anything()) matches all declarations, e.g.,
+"int* p" and "void f()" in
+  int* p;
+  void f();
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('unless0')"><a name="unless0Anchor">unless</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="unless0"><pre>Matches if the provided matcher does not match.
+
+Example matches Y (matcher = recordDecl(unless(hasName("X"))))
+  class X {};
+  class Y {};
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasOperatorName0')"><a name="hasOperatorName0Anchor">hasOperatorName</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOperatorName0"><pre>Matches the operator Name of operator expressions (binary or
+unary).
+
+Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher<CXXBoolLiteral></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value.
+
+Example matches true (matcher = boolLiteral(equals(true)))
+  true
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+           Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('argumentCountIs1')"><a name="argumentCountIs1Anchor">argumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="argumentCountIs1"><pre>Checks that a call expression or a constructor call expression has
+a specific number of arguments (including absent default arguments).
+
+Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
+  void f(int x, int y);
+  f(0, 0);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('isListInitialization0')"><a name="isListInitialization0Anchor">isListInitialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isListInitialization0"><pre>Matches a constructor call expression which uses list initialization.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('isWritten0')"><a name="isWritten0Anchor">isWritten</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isWritten0"><pre>Matches a constructor initializer if it is explicitly written in
+code (as opposed to implicitly added by the compiler).
+
+Given
+  struct Foo {
+    Foo() { }
+    Foo(int) : foo_("A") { }
+    string foo_;
+  };
+constructorDecl(hasAnyConstructorInitializer(isWritten()))
+  will match Foo(int), but not Foo()
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('hasOverloadedOperatorName0')"><a name="hasOverloadedOperatorName0Anchor">hasOverloadedOperatorName</a></td><td>StringRef Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOverloadedOperatorName0"><pre>Matches overloaded operator names.
+
+Matches overloaded operator names specified in strings without the
+"operator" prefix: e.g. "<<".
+
+Given:
+  class A { int operator*(); };
+  const A &operator<<(const A &a, const A &b);
+  A a;
+  a << a;   <-- This matches
+
+operatorCallExpr(hasOverloadedOperatorName("<<"))) matches the specified
+line and recordDecl(hasMethod(hasOverloadedOperatorName("*"))) matches
+the declaration of A.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isConst0')"><a name="isConst0Anchor">isConst</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConst0"><pre>Matches if the given method declaration is const.
+
+Given
+struct A {
+  void foo() const;
+  void bar();
+};
+
+methodDecl(isConst()) matches A::foo() but not A::bar()
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isOverride0')"><a name="isOverride0Anchor">isOverride</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isOverride0"><pre>Matches if the given method declaration overrides another method.
+
+Given
+  class A {
+   public:
+    virtual void x();
+  };
+  class B : public A {
+   public:
+    virtual void x();
+  };
+  matches B::x
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isPure0')"><a name="isPure0Anchor">isPure</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPure0"><pre>Matches if the given method declaration is pure.
+
+Given
+  class A {
+   public:
+    virtual void x() = 0;
+  };
+  matches A::x
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isVirtual0')"><a name="isVirtual0Anchor">isVirtual</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isVirtual0"><pre>Matches if the given method declaration is virtual.
+
+Given
+  class A {
+   public:
+    virtual void x();
+  };
+  matches A::x
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>></td><td class="name" onclick="toggle('hasOverloadedOperatorName1')"><a name="hasOverloadedOperatorName1Anchor">hasOverloadedOperatorName</a></td><td>StringRef Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOverloadedOperatorName1"><pre>Matches overloaded operator names.
+
+Matches overloaded operator names specified in strings without the
+"operator" prefix: e.g. "<<".
+
+Given:
+  class A { int operator*(); };
+  const A &operator<<(const A &a, const A &b);
+  A a;
+  a << a;   <-- This matches
+
+operatorCallExpr(hasOverloadedOperatorName("<<"))) matches the specified
+line and recordDecl(hasMethod(hasOverloadedOperatorName("*"))) matches
+the declaration of A.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isDerivedFrom1')"><a name="isDerivedFrom1Anchor">isDerivedFrom</a></td><td>StringRef BaseName</td></tr>
+<tr><td colspan="4" class="doc" id="isDerivedFrom1"><pre>Overloaded method as shortcut for isDerivedFrom(hasName(...)).
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization2')"><a name="isExplicitTemplateSpecialization2Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization2"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isSameOrDerivedFrom1')"><a name="isSameOrDerivedFrom1Anchor">isSameOrDerivedFrom</a></td><td>StringRef BaseName</td></tr>
+<tr><td colspan="4" class="doc" id="isSameOrDerivedFrom1"><pre>Overloaded method as shortcut for
+isSameOrDerivedFrom(hasName(...)).
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation2')"><a name="isTemplateInstantiation2Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation2"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('argumentCountIs0')"><a name="argumentCountIs0Anchor">argumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="argumentCountIs0"><pre>Checks that a call expression or a constructor call expression has
+a specific number of arguments (including absent default arguments).
+
+Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
+  void f(int x, int y);
+  f(0, 0);
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals3')"><a name="equals3Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value.
+
+Example matches true (matcher = boolLiteral(equals(true)))
+  true
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+           Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>></td><td class="name" onclick="toggle('statementCountIs0')"><a name="statementCountIs0Anchor">statementCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="statementCountIs0"><pre>Checks that a compound statement contains a specific number of
+child statements.
+
+Example: Given
+  { for (;;) {} }
+compoundStmt(statementCountIs(0)))
+  matches '{}'
+  but does not match the outer compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConstantArrayType.html">ConstantArrayType</a>></td><td class="name" onclick="toggle('hasSize0')"><a name="hasSize0Anchor">hasSize</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="hasSize0"><pre>Matches ConstantArrayType nodes that have the specified size.
+
+Given
+  int a[42];
+  int b[2 * 21];
+  int c[41], d[43];
+constantArrayType(hasSize(42))
+  matches "int a[42]" and "int b[2 * 21]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>></td><td class="name" onclick="toggle('declCountIs0')"><a name="declCountIs0Anchor">declCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="declCountIs0"><pre>Matches declaration statements that contain a specific number of
+declarations.
+
+Example: Given
+  int a, b;
+  int c;
+  int d = 2, e;
+declCountIs(2)
+  matches 'int a, b;' and 'int d = 2, e;', but not 'int c;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('equalsBoundNode1')"><a name="equalsBoundNode1Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode1"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+recordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('equalsNode0')"><a name="equalsNode0Anchor">equalsNode</a></td><td>Decl *Node</td></tr>
+<tr><td colspan="4" class="doc" id="equalsNode0"><pre>Matches if a node equals another node.
+
+Decl has pointer identity in the AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isImplicit0')"><a name="isImplicit0Anchor">isImplicit</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isImplicit0"><pre>Matches a declaration that has been implicitly added
+by the compiler (eg. implicit defaultcopy constructors).
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isPrivate0')"><a name="isPrivate0Anchor">isPrivate</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPrivate0"><pre>Matches private C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isPrivate())
+  matches 'int c;' 
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isProtected0')"><a name="isProtected0Anchor">isProtected</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isProtected0"><pre>Matches protected C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isProtected())
+  matches 'int b;' 
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isPublic0')"><a name="isPublic0Anchor">isPublic</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPublic0"><pre>Matches public C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isPublic())
+  matches 'int a;' 
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals1')"><a name="equals1Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value.
+
+Example matches true (matcher = boolLiteral(equals(true)))
+  true
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+           Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isDefinition2')"><a name="isDefinition2Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition2"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization0')"><a name="isExplicitTemplateSpecialization0Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization0"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExternC0')"><a name="isExternC0Anchor">isExternC</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function declarations.
+
+Given:
+  extern "C" void f() {}
+  extern "C" { void g() {} }
+  void h() {}
+functionDecl(isExternC())
+  matches the declaration of f and g, but not the declaration h
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation0')"><a name="isTemplateInstantiation0Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation0"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('parameterCountIs0')"><a name="parameterCountIs0Anchor">parameterCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="parameterCountIs0"><pre>Matches FunctionDecls that have a specific parameter count.
+
+Given
+  void f(int i) {}
+  void g(int i, int j) {}
+functionDecl(parameterCountIs(2))
+  matches g(int i, int j) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals0')"><a name="equals0Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value.
+
+Example matches true (matcher = boolLiteral(equals(true)))
+  true
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+           Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('isArrow0')"><a name="isArrow0Anchor">isArrow</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isArrow0"><pre>Matches member expressions that are called with '->' as opposed
+to '.'.
+
+Member calls on the implicit this pointer match as called with '->'.
+
+Given
+  class Y {
+    void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; }
+    int a;
+    static int b;
+  };
+memberExpr(isArrow())
+  matches this->x, x, y.x, a, this->b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>></td><td class="name" onclick="toggle('hasName0')"><a name="hasName0Anchor">hasName</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasName0"><pre>Matches NamedDecl nodes that have the specified name.
+
+Supports specifying enclosing namespaces or classes by prefixing the name
+with '<enclosing>::'.
+Does not match typedefs of an underlying type with the given name.
+
+Example matches X (Name == "X")
+  class X;
+
+Example matches X (Name is one of "::a::b::X", "a::b::X", "b::X", "X")
+  namespace a { namespace b { class X; } }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>></td><td class="name" onclick="toggle('matchesName0')"><a name="matchesName0Anchor">matchesName</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="matchesName0"><pre>Matches NamedDecl nodes whose fully qualified names contain
+a substring matched by the given RegExp.
+
+Supports specifying enclosing namespaces or classes by
+prefixing the name with '<enclosing>::'.  Does not match typedefs
+of an underlying type with the given name.
+
+Example matches X (regexp == "::X")
+  class X;
+
+Example matches X (regexp is one of "::X", "^foo::.*X", among others)
+  namespace foo { namespace bar { class X; } }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('asString0')"><a name="asString0Anchor">asString</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="asString0"><pre>Matches if the matched type is represented by the given string.
+
+Given
+  class Y { public: void x(); };
+  void z() { Y* y; y->x(); }
+callExpr(on(hasType(asString("class Y *"))))
+  matches y->x()
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('equalsBoundNode3')"><a name="equalsBoundNode3Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode3"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+recordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('hasLocalQualifiers0')"><a name="hasLocalQualifiers0Anchor">hasLocalQualifiers</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasLocalQualifiers0"><pre>Matches QualType nodes that have local CV-qualifiers attached to
+the node, not hidden within a typedef.
+
+Given
+  typedef const int const_int;
+  const_int i;
+  int *const j;
+  int *volatile k;
+  int m;
+varDecl(hasType(hasLocalQualifiers())) matches only j and k.
+i is const-qualified but the qualifier is not local.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isConstQualified0')"><a name="isConstQualified0Anchor">isConstQualified</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConstQualified0"><pre>Matches QualType nodes that are const-qualified, i.e., that
+include "top-level" const.
+
+Given
+  void a(int);
+  void b(int const);
+  void c(const int);
+  void d(const int*);
+  void e(int const) {};
+functionDecl(hasAnyParameter(hasType(isConstQualified())))
+  matches "void b(int const)", "void c(const int)" and
+  "void e(int const) {}". It does not match d as there
+  is no top-level const on the parameter type "const int *".
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isInteger0')"><a name="isInteger0Anchor">isInteger</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInteger0"><pre>Matches QualType nodes that are of integer type.
+
+Given
+  void a(int);
+  void b(long);
+  void c(double);
+functionDecl(hasAnyParameter(hasType(isInteger())))
+matches "a(int)", "b(long)", but not "c(double)".
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsBoundNode0')"><a name="equalsBoundNode0Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode0"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+recordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsNode1')"><a name="equalsNode1Anchor">equalsNode</a></td><td>Stmt *Node</td></tr>
+<tr><td colspan="4" class="doc" id="equalsNode1"><pre>Matches if a node equals another node.
+
+Stmt has pointer identity in the AST.
+
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>></td><td class="name" onclick="toggle('isDefinition0')"><a name="isDefinition0Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition0"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('equalsBoundNode2')"><a name="equalsBoundNode2Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode2"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+recordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>></td><td class="name" onclick="toggle('ofKind0')"><a name="ofKind0Anchor">ofKind</a></td><td>UnaryExprOrTypeTrait Kind</td></tr>
+<tr><td colspan="4" class="doc" id="ofKind0"><pre>Matches unary expressions of a certain kind.
+
+Given
+  int x;
+  int s = sizeof(x) + alignof(x)
+unaryExprOrTypeTraitExpr(ofKind(UETT_SizeOf))
+  matches sizeof(x)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>></td><td class="name" onclick="toggle('hasOperatorName1')"><a name="hasOperatorName1Anchor">hasOperatorName</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOperatorName1"><pre>Matches the operator Name of operator expressions (binary or
+unary).
+
+Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasGlobalStorage0')"><a name="hasGlobalStorage0Anchor">hasGlobalStorage</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasGlobalStorage0"><pre>Matches a variable declaration that does not have local storage.
+
+Example matches y and z (matcher = varDecl(hasGlobalStorage())
+void f() {
+  int x;
+  static int y;
+}
+int z;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasLocalStorage0')"><a name="hasLocalStorage0Anchor">hasLocalStorage</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasLocalStorage0"><pre>Matches a variable declaration that has function scope and is a
+non-static local variable.
+
+Example matches x (matcher = varDecl(hasLocalStorage())
+void f() {
+  int x;
+  static int y;
+}
+int z;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isDefinition1')"><a name="isDefinition1Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition1"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization1')"><a name="isExplicitTemplateSpecialization1Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization1"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation1')"><a name="isTemplateInstantiation1Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation1"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+recordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+<!--END_NARROWING_MATCHERS -->
+</table>
+
+<!-- ======================================================================= -->
+<h2 id="traversal-matchers">AST Traversal Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Traversal matchers specify the relationship to other nodes that are
+reachable from the current node.</p>
+
+<p>Note that there are special traversal matchers (has, hasDescendant, forEach and
+forEachDescendant) which work on all nodes and allow users to write more generic
+match expressions.</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_TRAVERSAL_MATCHERS -->
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('eachOf0')"><a name="eachOf0Anchor">eachOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="eachOf0"><pre>Matches if any of the given matchers matches.
+
+Unlike anyOf, eachOf will generate a match result for each
+matching submatcher.
+
+For example, in:
+  class A { int a; int b; };
+The matcher:
+  recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
+                    has(fieldDecl(hasName("b")).bind("v"))))
+will generate two results binding "v", the first of which binds
+the field declaration of a, the second the field declaration of
+b.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEachDescendant0')"><a name="forEachDescendant0Anchor">forEachDescendant</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="forEachDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the
+provided matcher.
+
+Example matches X, A, B, C
+    (matcher = recordDecl(forEachDescendant(recordDecl(hasName("X")))))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class A { class X {}; };
+  class B { class C { class X {}; }; };
+
+DescendantT must be an AST base type.
+
+As opposed to 'hasDescendant', 'forEachDescendant' will cause a match for
+each result that matches instead of only on the first one.
+
+Note: Recursively combined ForEachDescendant can cause many matches:
+  recordDecl(forEachDescendant(recordDecl(forEachDescendant(recordDecl()))))
+will match 10 times (plus injected class name matches) on:
+  class A { class B { class C { class D { class E {}; }; }; }; };
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEach0')"><a name="forEach0Anchor">forEach</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="forEach0"><pre>Matches AST nodes that have child AST nodes that match the
+provided matcher.
+
+Example matches X, Y (matcher = recordDecl(forEach(recordDecl(hasName("X")))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };  Does not match Z.
+
+ChildT must be an AST base type.
+
+As opposed to 'has', 'forEach' will cause a match for each result that
+matches instead of only on the first one.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasAncestor0')"><a name="hasAncestor0Anchor">hasAncestor</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasAncestor0"><pre>Matches AST nodes that have an ancestor that matches the provided
+matcher.
+
+Given
+void f() { if (true) { int x = 42; } }
+void g() { for (;;) { int x = 43; } }
+expr(integerLiteral(hasAncestor(ifStmt()))) matches 42, but not 43.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasDescendant0')"><a name="hasDescendant0Anchor">hasDescendant</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the
+provided matcher.
+
+Example matches X, Y, Z
+    (matcher = recordDecl(hasDescendant(recordDecl(hasName("X")))))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };
+
+DescendantT must be an AST base type.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('has0')"><a name="has0Anchor">has</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="has0"><pre>Matches AST nodes that have child AST nodes that match the
+provided matcher.
+
+Example matches X, Y (matcher = recordDecl(has(recordDecl(hasName("X")))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };  Does not match Z.
+
+ChildT must be an AST base type.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasParent0')"><a name="hasParent0Anchor">hasParent</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasParent0"><pre>Matches AST nodes that have a parent that matches the provided
+matcher.
+
+Given
+void f() { for (;;) { int x = 42; if (true) { int x = 43; } } }
+compoundStmt(hasParent(ifStmt())) matches "{ int x = 43; }".
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasBase0')"><a name="hasBase0Anchor">hasBase</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBase0"><pre>Matches the base expression of an array subscript expression.
+
+Given
+  int i[5];
+  void f() { i[1] = 42; }
+arraySubscriptExpression(hasBase(implicitCastExpr(
+    hasSourceExpression(declRefExpr()))))
+  matches i[1] with the declRefExpr() matching i
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasIndex0')"><a name="hasIndex0Anchor">hasIndex</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasIndex0"><pre>Matches the index expression of an array subscript expression.
+
+Given
+  int i[5];
+  void f() { i[1] = 42; }
+arraySubscriptExpression(hasIndex(integerLiteral()))
+  matches i[1] with the integerLiteral() matching 1
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayTypeLoc.html">ArrayTypeLoc</a>></td><td class="name" onclick="toggle('hasElementTypeLoc0')"><a name="hasElementTypeLoc0Anchor">hasElementTypeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementTypeLoc0"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>></td><td class="name" onclick="toggle('hasElementType0')"><a name="hasElementType0Anchor">hasElementType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementType0"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicTypeLoc.html">AtomicTypeLoc</a>></td><td class="name" onclick="toggle('hasValueTypeLoc0')"><a name="hasValueTypeLoc0Anchor">hasValueTypeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasValueTypeLoc0"><pre>Matches atomic types with a specific value type.
+
+Given
+  _Atomic(int) i;
+  _Atomic(float) f;
+atomicType(hasValueType(isInteger()))
+ matches "_Atomic(int) i"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>></td><td class="name" onclick="toggle('hasValueType0')"><a name="hasValueType0Anchor">hasValueType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasValueType0"><pre>Matches atomic types with a specific value type.
+
+Given
+  _Atomic(int) i;
+  _Atomic(float) f;
+atomicType(hasValueType(isInteger()))
+ matches "_Atomic(int) i"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>></td><td class="name" onclick="toggle('hasDeducedType0')"><a name="hasDeducedType0Anchor">hasDeducedType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasDeducedType0"><pre>Matches AutoType nodes where the deduced type is a specific type.
+
+Note: There is no TypeLoc for the deduced type and thus no
+getDeducedLoc() matcher.
+
+Given
+  auto a = 1;
+  auto b = 2.0;
+autoType(hasDeducedType(isInteger()))
+  matches "auto a"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasEitherOperand0')"><a name="hasEitherOperand0Anchor">hasEitherOperand</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasEitherOperand0"><pre>Matches if either the left hand side or the right hand side of a
+binary operator matches.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasLHS0')"><a name="hasLHS0Anchor">hasLHS</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLHS0"><pre>Matches the left hand side of binary operator expressions.
+
+Example matches a (matcher = binaryOperator(hasLHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasRHS0')"><a name="hasRHS0Anchor">hasRHS</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasRHS0"><pre>Matches the right hand side of binary operator expressions.
+
+Example matches b (matcher = binaryOperator(hasRHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerTypeLoc.html">BlockPointerTypeLoc</a>></td><td class="name" onclick="toggle('pointeeLoc0')"><a name="pointeeLoc0Anchor">pointeeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointeeLoc0"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>></td><td class="name" onclick="toggle('pointee0')"><a name="pointee0Anchor">pointee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointee0"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasAnyArgument1')"><a name="hasAnyArgument1Anchor">hasAnyArgument</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyArgument1"><pre>Matches any argument of a call expression or a constructor call
+expression.
+
+Given
+  void x(int, int, int) { int y; x(1, y, 42); }
+callExpr(hasAnyArgument(declRefExpr()))
+  matches x(1, y, 42)
+with hasAnyArgument(...)
+  matching y
+
+FIXME: Currently this will ignore parentheses and implicit casts on
+the argument before applying the inner matcher. We'll want to remove
+this to allow for greater control by the user once ignoreImplicit()
+has been implemented.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasArgument1')"><a name="hasArgument1Anchor">hasArgument</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasArgument1"><pre>Matches the n'th argument of a call expression or a constructor
+call expression.
+
+Example matches y in x(y)
+    (matcher = callExpr(hasArgument(0, declRefExpr())))
+  void x(int) { int y; x(y); }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasDeclaration12')"><a name="hasDeclaration12Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration12"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('forEachConstructorInitializer0')"><a name="forEachConstructorInitializer0Anchor">forEachConstructorInitializer</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachConstructorInitializer0"><pre>Matches each constructor initializer in a constructor definition.
+
+Given
+  class A { A() : i(42), j(42) {} int i; int j; };
+constructorDecl(forEachConstructorInitializer(forField(decl().bind("x"))))
+  will trigger two matches, binding for 'i' and 'j' respectively.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('hasAnyConstructorInitializer0')"><a name="hasAnyConstructorInitializer0Anchor">hasAnyConstructorInitializer</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyConstructorInitializer0"><pre>Matches a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+recordDecl(has(constructorDecl(hasAnyConstructorInitializer(anything()))))
+  record matches Foo, hasAnyConstructorInitializer matches foo_(1)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('forField0')"><a name="forField0Anchor">forField</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forField0"><pre>Matches the field declaration of a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+recordDecl(has(constructorDecl(hasAnyConstructorInitializer(
+    forField(hasName("foo_"))))))
+  matches Foo
+with forField matching foo_
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('withInitializer0')"><a name="withInitializer0Anchor">withInitializer</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="withInitializer0"><pre>Matches the initializer expression of a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+recordDecl(has(constructorDecl(hasAnyConstructorInitializer(
+    withInitializer(integerLiteral(equals(1)))))))
+  matches Foo
+with withInitializer matching (1)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasBody3')"><a name="hasBody3Anchor">hasBody</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBody3"><pre>Matches a 'for', 'while', or 'do while' statement that has
+a given body.
+
+Given
+  for (;;) {}
+hasBody(compoundStmt())
+  matches 'for (;;) {}'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasLoopVariable0')"><a name="hasLoopVariable0Anchor">hasLoopVariable</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLoopVariable0"><pre>Matches the initialization statement of a for loop.
+
+Example:
+    forStmt(hasLoopVariable(anything()))
+matches 'int x' in
+    for (int x : a) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasRangeInit0')"><a name="hasRangeInit0Anchor">hasRangeInit</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasRangeInit0"><pre>Matches the range initialization statement of a for loop.
+
+Example:
+    forStmt(hasRangeInit(anything()))
+matches 'a' in
+    for (int x : a) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('onImplicitObjectArgument0')"><a name="onImplicitObjectArgument0Anchor">onImplicitObjectArgument</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="onImplicitObjectArgument0"><pre></pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('on0')"><a name="on0Anchor">on</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="on0"><pre>Matches on the implicit object argument of a member call expression.
+
+Example matches y.x() (matcher = callExpr(on(hasType(recordDecl(hasName("Y"))))))
+  class Y { public: void x(); };
+  void z() { Y y; y.x(); }",
+
+FIXME: Overload to allow directly matching types?
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('thisPointerType1')"><a name="thisPointerType1Anchor">thisPointerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="thisPointerType1"><pre>Overloaded to match the type's declaration.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('thisPointerType0')"><a name="thisPointerType0Anchor">thisPointerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="thisPointerType0"><pre>Matches if the expression's type either matches the specified
+matcher, or is a pointer to a type that matches the InnerMatcher.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('ofClass0')"><a name="ofClass0Anchor">ofClass</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="ofClass0"><pre>Matches the class declaration that the given method declaration
+belongs to.
+
+FIXME: Generalize this for other kinds of declarations.
+FIXME: What other kind of declarations would we need to generalize
+this to?
+
+Example matches A() in the last line
+    (matcher = constructExpr(hasDeclaration(methodDecl(
+        ofClass(hasName("A"))))))
+  class A {
+   public:
+    A();
+  };
+  A a = A();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('hasMethod0')"><a name="hasMethod0Anchor">hasMethod</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasMethod0"><pre>Matches the first method of a class or struct that satisfies InnerMatcher.
+
+Given:
+  class A { void func(); };
+  class B { void member(); };
+
+recordDecl(hasMethod(hasName("func"))) matches the declaration of A
+but not B.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isDerivedFrom0')"><a name="isDerivedFrom0Anchor">isDerivedFrom</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>> Base</td></tr>
+<tr><td colspan="4" class="doc" id="isDerivedFrom0"><pre>Matches C++ classes that are directly or indirectly derived from
+a class matching Base.
+
+Note that a class is not considered to be derived from itself.
+
+Example matches Y, Z, C (Base == hasName("X"))
+  class X;
+  class Y : public X {};  directly derived
+  class Z : public Y {};  indirectly derived
+  typedef X A;
+  typedef A B;
+  class C : public B {};  derived from a typedef of X
+
+In the following example, Bar matches isDerivedFrom(hasName("X")):
+  class Foo;
+  typedef Foo X;
+  class Bar : public Foo {};  derived from a type that X is a typedef of
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isSameOrDerivedFrom0')"><a name="isSameOrDerivedFrom0Anchor">isSameOrDerivedFrom</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>> Base</td></tr>
+<tr><td colspan="4" class="doc" id="isSameOrDerivedFrom0"><pre>Similar to isDerivedFrom(), but also matches classes that directly
+match Base.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('callee1')"><a name="callee1Anchor">callee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="callee1"><pre>Matches if the call expression's callee's declaration matches the
+given matcher.
+
+Example matches y.x() (matcher = callExpr(callee(methodDecl(hasName("x")))))
+  class Y { public: void x(); };
+  void z() { Y y; y.x();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('callee0')"><a name="callee0Anchor">callee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="callee0"><pre>Matches if the call expression's callee expression matches.
+
+Given
+  class Y { void x() { this->x(); x(); Y y; y.x(); } };
+  void f() { f(); }
+callExpr(callee(expr()))
+  matches this->x(), x(), y.x(), f()
+with callee(...)
+  matching this->x, x, y.x, f respectively
+
+Note: Callee cannot take the more general internal::Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>
+because this introduces ambiguous overloads with calls to Callee taking a
+internal::Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, as the matcher hierarchy is purely
+implemented in terms of implicit casts.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasAnyArgument0')"><a name="hasAnyArgument0Anchor">hasAnyArgument</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyArgument0"><pre>Matches any argument of a call expression or a constructor call
+expression.
+
+Given
+  void x(int, int, int) { int y; x(1, y, 42); }
+callExpr(hasAnyArgument(declRefExpr()))
+  matches x(1, y, 42)
+with hasAnyArgument(...)
+  matching y
+
+FIXME: Currently this will ignore parentheses and implicit casts on
+the argument before applying the inner matcher. We'll want to remove
+this to allow for greater control by the user once ignoreImplicit()
+has been implemented.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasArgument0')"><a name="hasArgument0Anchor">hasArgument</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasArgument0"><pre>Matches the n'th argument of a call expression or a constructor
+call expression.
+
+Example matches y in x(y)
+    (matcher = callExpr(hasArgument(0, declRefExpr())))
+  void x(int) { int y; x(y); }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasDeclaration13')"><a name="hasDeclaration13Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration13"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>></td><td class="name" onclick="toggle('hasCaseConstant0')"><a name="hasCaseConstant0Anchor">hasCaseConstant</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCaseConstant0"><pre>If the given case statement does not use the GNU case range
+extension, matches the constant given in the statement.
+
+Given
+  switch (1) { case 1: case 1+1: case 3 ... 4: ; }
+caseStmt(hasCaseConstant(integerLiteral()))
+  matches "case 1:"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>></td><td class="name" onclick="toggle('hasSourceExpression0')"><a name="hasSourceExpression0Anchor">hasSourceExpression</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasSourceExpression0"><pre>Matches if the cast's source expression matches the given matcher.
+
+Example: matches "a string" (matcher =
+                                 hasSourceExpression(constructExpr()))
+class URL { URL(string); };
+URL url = "a string";
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('hasAnyTemplateArgument0')"><a name="hasAnyTemplateArgument0Anchor">hasAnyTemplateArgument</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyTemplateArgument0"><pre>Matches classTemplateSpecializations that have at least one
+TemplateArgument matching the given InnerMatcher.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToType(asString("int"))))
+  matches the specialization A<int>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('hasTemplateArgument0')"><a name="hasTemplateArgument0Anchor">hasTemplateArgument</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTemplateArgument0"><pre>Matches classTemplateSpecializations where the n'th TemplateArgument
+matches the given InnerMatcher.
+
+Given
+  template<typename T, typename U> class A {};
+  A<bool, int> b;
+  A<int, bool> c;
+classTemplateSpecializationDecl(hasTemplateArgument(
+    1, refersToType(asString("int"))))
+  matches the specialization A<bool, int>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexTypeLoc.html">ComplexTypeLoc</a>></td><td class="name" onclick="toggle('hasElementTypeLoc1')"><a name="hasElementTypeLoc1Anchor">hasElementTypeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementTypeLoc1"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>></td><td class="name" onclick="toggle('hasElementType1')"><a name="hasElementType1Anchor">hasElementType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementType1"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>></td><td class="name" onclick="toggle('hasAnySubstatement0')"><a name="hasAnySubstatement0Anchor">hasAnySubstatement</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnySubstatement0"><pre>Matches compound statements where at least one substatement matches
+a given matcher.
+
+Given
+  { {}; 1+2; }
+hasAnySubstatement(compoundStmt())
+  matches '{ {}; 1+2; }'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConditionalOperator.html">ConditionalOperator</a>></td><td class="name" onclick="toggle('hasCondition4')"><a name="hasCondition4Anchor">hasCondition</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition4"><pre>Matches the condition expression of an if statement, for loop,
+or conditional operator.
+
+Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConditionalOperator.html">ConditionalOperator</a>></td><td class="name" onclick="toggle('hasFalseExpression0')"><a name="hasFalseExpression0Anchor">hasFalseExpression</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasFalseExpression0"><pre>Matches the false branch expression of a conditional operator.
+
+Example matches b
+  condition ? a : b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ConditionalOperator.html">ConditionalOperator</a>></td><td class="name" onclick="toggle('hasTrueExpression0')"><a name="hasTrueExpression0Anchor">hasTrueExpression</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTrueExpression0"><pre>Matches the true branch expression of a conditional operator.
+
+Example matches a
+  condition ? a : b
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>></td><td class="name" onclick="toggle('hasDeclaration11')"><a name="hasDeclaration11Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration11"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>></td><td class="name" onclick="toggle('throughUsingDecl0')"><a name="throughUsingDecl0Anchor">throughUsingDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingShadowDecl.html">UsingShadowDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="throughUsingDecl0"><pre>Matches a DeclRefExpr that refers to a declaration through a
+specific using shadow declaration.
+
+FIXME: This currently only works for functions. Fix.
+
+Given
+  namespace a { void f() {} }
+  using a::f;
+  void g() {
+    f();     Matches this ..
+    a::f();  .. but not this.
+  }
+declRefExpr(throughUsingDeclaration(anything()))
+  matches f()
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>></td><td class="name" onclick="toggle('to0')"><a name="to0Anchor">to</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="to0"><pre>Matches a DeclRefExpr that refers to a declaration that matches the
+specified matcher.
+
+Example matches x in if(x)
+    (matcher = declRefExpr(to(varDecl(hasName("x")))))
+  bool x;
+  if (x) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>></td><td class="name" onclick="toggle('containsDeclaration0')"><a name="containsDeclaration0Anchor">containsDeclaration</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="containsDeclaration0"><pre>Matches the n'th declaration of a declaration statement.
+
+Note that this does not work for global declarations because the AST
+breaks up multiple-declaration DeclStmt's into multiple single-declaration
+DeclStmt's.
+Example: Given non-global declarations
+  int a, b = 0;
+  int c;
+  int d = 2, e;
+declStmt(containsDeclaration(
+      0, varDecl(hasInitializer(anything()))))
+  matches only 'int d = 2, e;', and
+declStmt(containsDeclaration(1, varDecl()))
+  matches 'int a, b = 0' as well as 'int d = 2, e;'
+  but 'int c;' is not matched.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>></td><td class="name" onclick="toggle('hasSingleDecl0')"><a name="hasSingleDecl0Anchor">hasSingleDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasSingleDecl0"><pre>Matches the Decl of a DeclStmt which has a single declaration.
+
+Given
+  int a, b;
+  int c;
+declStmt(hasSingleDecl(anything()))
+  matches 'int c;' but not 'int a, b;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclaratorDecl.html">DeclaratorDecl</a>></td><td class="name" onclick="toggle('hasTypeLoc0')"><a name="hasTypeLoc0Anchor">hasTypeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>> Inner</td></tr>
+<tr><td colspan="4" class="doc" id="hasTypeLoc0"><pre>Matches if the type location of the declarator decl's type matches
+the inner matcher.
+
+Given
+  int x;
+declaratorDecl(hasTypeLoc(loc(asString("int"))))
+  matches int x
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('hasDeclContext0')"><a name="hasDeclContext0Anchor">hasDeclContext</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclContext0"><pre>Matches declarations whose declaration context, interpreted as a
+Decl, matches InnerMatcher.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+
+recordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
+declaration of class D.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>></td><td class="name" onclick="toggle('hasBody0')"><a name="hasBody0Anchor">hasBody</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBody0"><pre>Matches a 'for', 'while', or 'do while' statement that has
+a given body.
+
+Given
+  for (;;) {}
+hasBody(compoundStmt())
+  matches 'for (;;) {}'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>></td><td class="name" onclick="toggle('hasCondition3')"><a name="hasCondition3Anchor">hasCondition</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition3"><pre>Matches the condition expression of an if statement, for loop,
+or conditional operator.
+
+Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ElaboratedType.html">ElaboratedType</a>></td><td class="name" onclick="toggle('hasQualifier0')"><a name="hasQualifier0Anchor">hasQualifier</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasQualifier0"><pre>Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier,
+matches InnerMatcher if the qualifier exists.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+  N::M::D d;
+
+elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N"))))
+matches the type of the variable declaration of d.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ElaboratedType.html">ElaboratedType</a>></td><td class="name" onclick="toggle('namesType0')"><a name="namesType0Anchor">namesType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="namesType0"><pre>Matches ElaboratedTypes whose named type matches InnerMatcher.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+  N::M::D d;
+
+elaboratedType(namesType(recordType(
+hasDeclaration(namedDecl(hasName("D")))))) matches the type of the variable
+declaration of d.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>></td><td class="name" onclick="toggle('hasDeclaration10')"><a name="hasDeclaration10Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration10"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>></td><td class="name" onclick="toggle('hasDestinationType0')"><a name="hasDestinationType0Anchor">hasDestinationType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDestinationType0"><pre>Matches casts whose destination type matches a given matcher.
+
+(Note: Clang's AST refers to other conversions as "casts" too, and calls
+actual casts "explicit" casts.)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('hasType2')"><a name="hasType2Anchor">hasType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasType2"><pre>Overloaded to match the declaration of the expression's or value
+declaration's type.
+
+In case of a value declaration (for example a variable declaration),
+this resolves one layer of indirection. For example, in the value
+declaration "X x;", recordDecl(hasName("X")) matches the declaration of X,
+while varDecl(hasType(recordDecl(hasName("X")))) matches the declaration
+of x."
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('hasType0')"><a name="hasType0Anchor">hasType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasType0"><pre>Matches if the expression's or declaration's type matches a type
+matcher.
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('ignoringImpCasts0')"><a name="ignoringImpCasts0Anchor">ignoringImpCasts</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="ignoringImpCasts0"><pre>Matches expressions that match InnerMatcher after any implicit casts
+are stripped off.
+
+Parentheses and explicit casts are not discarded.
+Given
+  int arr[5];
+  int a = 0;
+  char b = 0;
+  const int c = a;
+  int *d = arr;
+  long e = (long) 0l;
+The matchers
+   varDecl(hasInitializer(ignoringImpCasts(integerLiteral())))
+   varDecl(hasInitializer(ignoringImpCasts(declRefExpr())))
+would match the declarations for a, b, c, and d, but not e.
+While
+   varDecl(hasInitializer(integerLiteral()))
+   varDecl(hasInitializer(declRefExpr()))
+only match the declarations for b, c, and d.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('ignoringParenCasts0')"><a name="ignoringParenCasts0Anchor">ignoringParenCasts</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="ignoringParenCasts0"><pre>Matches expressions that match InnerMatcher after parentheses and
+casts are stripped off.
+
+Implicit and non-C Style casts are also discarded.
+Given
+  int a = 0;
+  char b = (0);
+  void* c = reinterpret_cast<char*>(0);
+  char d = char(0);
+The matcher
+   varDecl(hasInitializer(ignoringParenCasts(integerLiteral())))
+would match the declarations for a, b, c, and d.
+while
+   varDecl(hasInitializer(integerLiteral()))
+only match the declaration for a.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('ignoringParenImpCasts0')"><a name="ignoringParenImpCasts0Anchor">ignoringParenImpCasts</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="ignoringParenImpCasts0"><pre>Matches expressions that match InnerMatcher after implicit casts and
+parentheses are stripped off.
+
+Explicit casts are not discarded.
+Given
+  int arr[5];
+  int a = 0;
+  char b = (0);
+  const int c = a;
+  int *d = (arr);
+  long e = ((long) 0l);
+The matchers
+   varDecl(hasInitializer(ignoringParenImpCasts(integerLiteral())))
+   varDecl(hasInitializer(ignoringParenImpCasts(declRefExpr())))
+would match the declarations for a, b, c, and d, but not e.
+while
+   varDecl(hasInitializer(integerLiteral()))
+   varDecl(hasInitializer(declRefExpr()))
+would only match the declaration for a.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasBody1')"><a name="hasBody1Anchor">hasBody</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBody1"><pre>Matches a 'for', 'while', or 'do while' statement that has
+a given body.
+
+Given
+  for (;;) {}
+hasBody(compoundStmt())
+  matches 'for (;;) {}'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasCondition1')"><a name="hasCondition1Anchor">hasCondition</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition1"><pre>Matches the condition expression of an if statement, for loop,
+or conditional operator.
+
+Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasIncrement0')"><a name="hasIncrement0Anchor">hasIncrement</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasIncrement0"><pre>Matches the increment statement of a for loop.
+
+Example:
+    forStmt(hasIncrement(unaryOperator(hasOperatorName("++"))))
+matches '++x' in
+    for (x; x < N; ++x) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasLoopInit0')"><a name="hasLoopInit0Anchor">hasLoopInit</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLoopInit0"><pre>Matches the initialization statement of a for loop.
+
+Example:
+    forStmt(hasLoopInit(declStmt()))
+matches 'int x = 0' in
+    for (int x = 0; x < N; ++x) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasAnyParameter0')"><a name="hasAnyParameter0Anchor">hasAnyParameter</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyParameter0"><pre>Matches any parameter of a function declaration.
+
+Does not match the 'this' parameter of a method.
+
+Given
+  class X { void f(int x, int y, int z) {} };
+methodDecl(hasAnyParameter(hasName("y")))
+  matches f(int x, int y, int z) {}
+with hasAnyParameter(...)
+  matching int y
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasParameter0')"><a name="hasParameter0Anchor">hasParameter</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasParameter0"><pre>Matches the n'th parameter of a function declaration.
+
+Given
+  class X { void f(int x) {} };
+methodDecl(hasParameter(0, hasType(varDecl())))
+  matches f(int x) {}
+with hasParameter(...)
+  matching int x
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('returns0')"><a name="returns0Anchor">returns</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="returns0"><pre>Matches the return type of a function declaration.
+
+Given:
+  class X { int f() { return 1; } };
+methodDecl(returns(asString("int")))
+  matches int f() { return 1; }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>></td><td class="name" onclick="toggle('hasCondition0')"><a name="hasCondition0Anchor">hasCondition</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition0"><pre>Matches the condition expression of an if statement, for loop,
+or conditional operator.
+
+Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>></td><td class="name" onclick="toggle('hasConditionVariableStatement0')"><a name="hasConditionVariableStatement0Anchor">hasConditionVariableStatement</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasConditionVariableStatement0"><pre>Matches the condition variable statement in an if statement.
+
+Given
+  if (A* a = GetAPointer()) {}
+hasConditionVariableStatement(...)
+  matches 'A* a = GetAPointer()'.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>></td><td class="name" onclick="toggle('hasElse0')"><a name="hasElse0Anchor">hasElse</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasElse0"><pre>Matches the else-statement of an if statement.
+
+Examples matches the if statement
+  (matcher = ifStmt(hasElse(boolLiteral(equals(true)))))
+  if (false) false; else true;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>></td><td class="name" onclick="toggle('hasThen0')"><a name="hasThen0Anchor">hasThen</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasThen0"><pre>Matches the then-statement of an if statement.
+
+Examples matches the if statement
+  (matcher = ifStmt(hasThen(boolLiteral(equals(true)))))
+  if (false) true; else false;
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitCastExpr.html">ImplicitCastExpr</a>></td><td class="name" onclick="toggle('hasImplicitDestinationType0')"><a name="hasImplicitDestinationType0Anchor">hasImplicitDestinationType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasImplicitDestinationType0"><pre>Matches implicit casts whose destination type matches a given
+matcher.
+
+FIXME: Unit test this matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>></td><td class="name" onclick="toggle('hasDeclaration9')"><a name="hasDeclaration9Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration9"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>></td><td class="name" onclick="toggle('hasDeclaration8')"><a name="hasDeclaration8Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration8"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('hasDeclaration7')"><a name="hasDeclaration7Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration7"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('hasObjectExpression0')"><a name="hasObjectExpression0Anchor">hasObjectExpression</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasObjectExpression0"><pre>Matches a member expression where the object expression is
+matched by a given matcher.
+
+Given
+  struct X { int m; };
+  void f(X x) { x.m; m; }
+memberExpr(hasObjectExpression(hasType(recordDecl(hasName("X")))))))
+  matches "x.m" and "m"
+with hasObjectExpression(...)
+  matching "x" and the implicit object expression of "m" which has type X*.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('member0')"><a name="member0Anchor">member</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="member0"><pre>Matches a member expression where the member is matched by a
+given matcher.
+
+Given
+  struct { int first, second; } first, second;
+  int i(second.first);
+  int j(first.second);
+memberExpr(member(hasName("first")))
+  matches second.first
+  but not first.second (because the member name there is "second").
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerTypeLoc.html">MemberPointerTypeLoc</a>></td><td class="name" onclick="toggle('pointeeLoc1')"><a name="pointeeLoc1Anchor">pointeeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointeeLoc1"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>></td><td class="name" onclick="toggle('pointee1')"><a name="pointee1Anchor">pointee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointee1"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>></td><td class="name" onclick="toggle('hasPrefix1')"><a name="hasPrefix1Anchor">hasPrefix</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasPrefix1"><pre>Matches on the prefix of a NestedNameSpecifierLoc.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifierLoc(hasPrefix(loc(specifiesType(asString("struct A")))))
+  matches "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>></td><td class="name" onclick="toggle('specifiesTypeLoc0')"><a name="specifiesTypeLoc0Anchor">specifiesTypeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="specifiesTypeLoc0"><pre>Matches nested name specifier locs that specify a type matching the
+given TypeLoc.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifierLoc(specifiesTypeLoc(loc(type(
+  hasDeclaration(recordDecl(hasName("A")))))))
+  matches "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>></td><td class="name" onclick="toggle('hasPrefix0')"><a name="hasPrefix0Anchor">hasPrefix</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasPrefix0"><pre>Matches on the prefix of a NestedNameSpecifier.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifier(hasPrefix(specifiesType(asString("struct A")))) and
+  matches "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>></td><td class="name" onclick="toggle('specifiesNamespace0')"><a name="specifiesNamespace0Anchor">specifiesNamespace</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceDecl.html">NamespaceDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="specifiesNamespace0"><pre>Matches nested name specifiers that specify a namespace matching the
+given namespace matcher.
+
+Given
+  namespace ns { struct A {}; }
+  ns::A a;
+nestedNameSpecifier(specifiesNamespace(hasName("ns")))
+  matches "ns::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>></td><td class="name" onclick="toggle('specifiesType0')"><a name="specifiesType0Anchor">specifiesType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="specifiesType0"><pre>Matches nested name specifiers that specify a type matching the
+given QualType matcher without qualifiers.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifier(specifiesType(hasDeclaration(recordDecl(hasName("A")))))
+  matches "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenType.html">ParenType</a>></td><td class="name" onclick="toggle('innerType0')"><a name="innerType0Anchor">innerType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="innerType0"><pre>Matches ParenType nodes where the inner type is a specific type.
+
+Given
+  int (*ptr_to_array)[4];
+  int (*ptr_to_func)(int);
+
+varDecl(hasType(pointsTo(parenType(innerType(functionType()))))) matches
+ptr_to_func but not ptr_to_array.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenType.html">ParenType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerTypeLoc.html">PointerTypeLoc</a>></td><td class="name" onclick="toggle('pointeeLoc2')"><a name="pointeeLoc2Anchor">pointeeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointeeLoc2"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>></td><td class="name" onclick="toggle('pointee2')"><a name="pointee2Anchor">pointee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointee2"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('hasCanonicalType0')"><a name="hasCanonicalType0Anchor">hasCanonicalType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCanonicalType0"><pre>Matches QualTypes whose canonical type matches InnerMatcher.
+
+Given:
+  typedef int &int_ref;
+  int a;
+  int_ref b = a;
+
+varDecl(hasType(qualType(referenceType()))))) will not match the
+declaration of b but varDecl(hasType(qualType(hasCanonicalType(referenceType())))))) does.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('hasDeclaration6')"><a name="hasDeclaration6Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration6"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('pointsTo1')"><a name="pointsTo1Anchor">pointsTo</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="pointsTo1"><pre>Overloaded to match the pointee type's declaration.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('pointsTo0')"><a name="pointsTo0Anchor">pointsTo</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="pointsTo0"><pre>Matches if the matched type is a pointer type and the pointee type
+matches the specified matcher.
+
+Example matches y->x()
+    (matcher = callExpr(on(hasType(pointsTo(recordDecl(hasName("Y")))))))
+  class Y { public: void x(); };
+  void z() { Y *y; y->x(); }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('references1')"><a name="references1Anchor">references</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="references1"><pre>Overloaded to match the referenced type's declaration.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('references0')"><a name="references0Anchor">references</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="references0"><pre>Matches if the matched type is a reference type and the referenced
+type matches the specified matcher.
+
+Example matches X &x and const X &y
+    (matcher = varDecl(hasType(references(recordDecl(hasName("X"))))))
+  class X {
+    void a(X b) {
+      X &x = b;
+      const X &y = b;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>></td><td class="name" onclick="toggle('hasDeclaration5')"><a name="hasDeclaration5Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration5"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceTypeLoc.html">ReferenceTypeLoc</a>></td><td class="name" onclick="toggle('pointeeLoc3')"><a name="pointeeLoc3Anchor">pointeeLoc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointeeLoc3"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>></td><td class="name" onclick="toggle('pointee3')"><a name="pointee3Anchor">pointee</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointee3"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('alignOfExpr0')"><a name="alignOfExpr0Anchor">alignOfExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="alignOfExpr0"><pre>Same as unaryExprOrTypeTraitExpr, but only matching
+alignof.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('sizeOfExpr0')"><a name="sizeOfExpr0Anchor">sizeOfExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="sizeOfExpr0"><pre>Same as unaryExprOrTypeTraitExpr, but only matching
+sizeof.
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchStmt.html">SwitchStmt</a>></td><td class="name" onclick="toggle('forEachSwitchCase0')"><a name="forEachSwitchCase0Anchor">forEachSwitchCase</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchCase.html">SwitchCase</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachSwitchCase0"><pre>Matches each case or default statement belonging to the given switch
+statement. This matcher may produce multiple matches.
+
+Given
+  switch (1) { case 1: case 2: default: switch (2) { case 3: case 4: ; } }
+switchStmt(forEachSwitchCase(caseStmt().bind("c"))).bind("s")
+  matches four times, with "c" binding each of "case 1:", "case 2:",
+"case 3:" and "case 4:", and "s" respectively binding "switch (1)",
+"switch (1)", "switch (2)" and "switch (2)".
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>></td><td class="name" onclick="toggle('hasDeclaration4')"><a name="hasDeclaration4Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration4"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('isExpr0')"><a name="isExpr0Anchor">isExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="isExpr0"><pre>Matches a sugar TemplateArgument that refers to a certain expression.
+
+Given
+  template<typename T> struct A {};
+  struct B { B* next; };
+  A<&B::next> a;
+templateSpecializationType(hasAnyTemplateArgument(
+  isExpr(hasDescendant(declRefExpr(to(fieldDecl(hasName("next"))))))))
+  matches the specialization A<&B::next> with fieldDecl(...) matching
+    B::next
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('refersToDeclaration0')"><a name="refersToDeclaration0Anchor">refersToDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="refersToDeclaration0"><pre>Matches a canonical TemplateArgument that refers to a certain
+declaration.
+
+Given
+  template<typename T> struct A {};
+  struct B { B* next; };
+  A<&B::next> a;
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToDeclaration(fieldDecl(hasName("next"))))
+  matches the specialization A<&B::next> with fieldDecl(...) matching
+    B::next
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('refersToType0')"><a name="refersToType0Anchor">refersToType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="refersToType0"><pre>Matches a TemplateArgument that refers to a certain type.
+
+Given
+  struct X {};
+  template<typename T> struct A {};
+  A<X> a;
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToType(class(hasName("X")))))
+  matches the specialization A<X>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>></td><td class="name" onclick="toggle('hasAnyTemplateArgument1')"><a name="hasAnyTemplateArgument1Anchor">hasAnyTemplateArgument</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyTemplateArgument1"><pre>Matches classTemplateSpecializations that have at least one
+TemplateArgument matching the given InnerMatcher.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToType(asString("int"))))
+  matches the specialization A<int>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>></td><td class="name" onclick="toggle('hasDeclaration3')"><a name="hasDeclaration3Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration3"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>></td><td class="name" onclick="toggle('hasTemplateArgument1')"><a name="hasTemplateArgument1Anchor">hasTemplateArgument</a></td><td>unsigned N, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTemplateArgument1"><pre>Matches classTemplateSpecializations where the n'th TemplateArgument
+matches the given InnerMatcher.
+
+Given
+  template<typename T, typename U> class A {};
+  A<bool, int> b;
+  A<int, bool> c;
+classTemplateSpecializationDecl(hasTemplateArgument(
+    1, refersToType(asString("int"))))
+  matches the specialization A<bool, int>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>></td><td class="name" onclick="toggle('hasDeclaration2')"><a name="hasDeclaration2Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration2"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<T></td><td class="name" onclick="toggle('findAll0')"><a name="findAll0Anchor">findAll</a></td><td>Matcher<T>  Matcher</td></tr>
+<tr><td colspan="4" class="doc" id="findAll0"><pre>Matches if the node or any descendant matches.
+
+Generates results for each match.
+
+For example, in:
+  class A { class B {}; class C {}; };
+The matcher:
+  recordDecl(hasName("::A"), findAll(recordDecl(isDefinition()).bind("m")))
+will generate results for A, B and C.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>></td><td class="name" onclick="toggle('hasDeclaration1')"><a name="hasDeclaration1Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration1"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>></td><td class="name" onclick="toggle('hasArgumentOfType0')"><a name="hasArgumentOfType0Anchor">hasArgumentOfType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasArgumentOfType0"><pre>Matches unary expressions that have a specific type of argument.
+
+Given
+  int a, c; float b; int s = sizeof(a) + sizeof(b) + alignof(c);
+unaryExprOrTypeTraitExpr(hasArgumentOfType(asString("int"))
+  matches sizeof(a) and alignof(c)
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>></td><td class="name" onclick="toggle('hasUnaryOperand0')"><a name="hasUnaryOperand0Anchor">hasUnaryOperand</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasUnaryOperand0"><pre>Matches if the operand of a unary operator matches.
+
+Example matches true (matcher = hasUnaryOperand(boolLiteral(equals(true))))
+  !true
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>></td><td class="name" onclick="toggle('hasDeclaration0')"><a name="hasDeclaration0Anchor">hasDeclaration</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration0"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>,
+  Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingDecl.html">UsingDecl</a>></td><td class="name" onclick="toggle('hasAnyUsingShadowDecl0')"><a name="hasAnyUsingShadowDecl0Anchor">hasAnyUsingShadowDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingShadowDecl.html">UsingShadowDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyUsingShadowDecl0"><pre>Matches any using shadow declaration.
+
+Given
+  namespace X { void b(); }
+  using X::b;
+usingDecl(hasAnyUsingShadowDecl(hasName("b"))))
+  matches using X::b </pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingShadowDecl.html">UsingShadowDecl</a>></td><td class="name" onclick="toggle('hasTargetDecl0')"><a name="hasTargetDecl0Anchor">hasTargetDecl</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTargetDecl0"><pre>Matches a using shadow declaration where the target declaration is
+matched by the given matcher.
+
+Given
+  namespace X { int a; void b(); }
+  using X::a;
+  using X::b;
+usingDecl(hasAnyUsingShadowDecl(hasTargetDecl(functionDecl())))
+  matches using X::b but not using X::a </pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>></td><td class="name" onclick="toggle('hasType3')"><a name="hasType3Anchor">hasType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasType3"><pre>Overloaded to match the declaration of the expression's or value
+declaration's type.
+
+In case of a value declaration (for example a variable declaration),
+this resolves one layer of indirection. For example, in the value
+declaration "X x;", recordDecl(hasName("X")) matches the declaration of X,
+while varDecl(hasType(recordDecl(hasName("X")))) matches the declaration
+of x."
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+
+Usable as: Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>, Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>></td><td class="name" onclick="toggle('hasType1')"><a name="hasType1Anchor">hasType</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasType1"><pre>Matches if the expression's or declaration's type matches a type
+matcher.
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasInitializer0')"><a name="hasInitializer0Anchor">hasInitializer</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasInitializer0"><pre>Matches a variable declaration that has an initializer expression
+that matches the given matcher.
+
+Example matches x (matcher = varDecl(hasInitializer(callExpr())))
+  bool y() { return true; }
+  bool x = y();
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1VariableArrayType.html">VariableArrayType</a>></td><td class="name" onclick="toggle('hasSizeExpr0')"><a name="hasSizeExpr0Anchor">hasSizeExpr</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasSizeExpr0"><pre>Matches VariableArrayType nodes that have a specific size
+expression.
+
+Given
+  void f(int b) {
+    int a[b];
+  }
+variableArrayType(hasSizeExpr(ignoringImpCasts(declRefExpr(to(
+  varDecl(hasName("b")))))))
+  matches "int a[b]"
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>></td><td class="name" onclick="toggle('hasBody2')"><a name="hasBody2Anchor">hasBody</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBody2"><pre>Matches a 'for', 'while', or 'do while' statement that has
+a given body.
+
+Given
+  for (;;) {}
+hasBody(compoundStmt())
+  matches 'for (;;) {}'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>></td><td class="name" onclick="toggle('hasCondition2')"><a name="hasCondition2Anchor">hasCondition</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition2"><pre>Matches the condition expression of an if statement, for loop,
+or conditional operator.
+
+Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::BindableMatcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>>></td><td class="name" onclick="toggle('loc1')"><a name="loc1Anchor">loc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="loc1"><pre>Matches NestedNameSpecifierLocs for which the given inner
+NestedNameSpecifier-matcher matches.
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::BindableMatcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>></td><td class="name" onclick="toggle('loc0')"><a name="loc0Anchor">loc</a></td><td>Matcher&lt<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="loc0"><pre>Matches TypeLocs for which the given inner
+QualType-matcher matches.
+</pre></td></tr>
+
+<!--END_TRAVERSAL_MATCHERS -->
+</table>
+
+</div>
+</body>
+</html>
+
+

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersTutorial.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersTutorial.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersTutorial.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibASTMatchersTutorial.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,545 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Tutorial for building tools using LibTooling and LibASTMatchers — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Matching the Clang AST" href="LibASTMatchers.html" />
+    <link rel="prev" title="How to write RecursiveASTVisitor based ASTFrontendActions." href="RAVFrontendAction.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Tutorial for building tools using LibTooling and LibASTMatchers</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="RAVFrontendAction.html">How to write RecursiveASTVisitor based ASTFrontendActions.</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibASTMatchers.html">Matching the Clang AST</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="tutorial-for-building-tools-using-libtooling-and-libastmatchers">
+<h1>Tutorial for building tools using LibTooling and LibASTMatchers<a class="headerlink" href="#tutorial-for-building-tools-using-libtooling-and-libastmatchers" title="Permalink to this headline">¶</a></h1>
+<p>This document is intended to show how to build a useful source-to-source
+translation tool based on Clang’s <a class="reference external" href="LibTooling.html">LibTooling</a>. It is
+explicitly aimed at people who are new to Clang, so all you should need
+is a working knowledge of C++ and the command line.</p>
+<p>In order to work on the compiler, you need some basic knowledge of the
+abstract syntax tree (AST). To this end, the reader is incouraged to
+skim the <a class="reference internal" href="IntroductionToTheClangAST.html"><em>Introduction to the Clang
+AST</em></a></p>
+<div class="section" id="step-0-obtaining-clang">
+<h2>Step 0: Obtaining Clang<a class="headerlink" href="#step-0-obtaining-clang" title="Permalink to this headline">¶</a></h2>
+<p>As Clang is part of the LLVM project, you’ll need to download LLVM’s
+source code first. Both Clang and LLVM are maintained as Subversion
+repositories, but we’ll be accessing them through the git mirror. For
+further information, see the <a class="reference external" href="http://llvm.org/docs/GettingStarted.html">getting started
+guide</a>.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">mkdir ~/clang-llvm && cd ~/clang-llvm</span>
+<span class="go">git clone http://llvm.org/git/llvm.git</span>
+<span class="go">cd llvm/tools</span>
+<span class="go">git clone http://llvm.org/git/clang.git</span>
+<span class="go">cd clang/tools</span>
+<span class="go">git clone http://llvm.org/git/clang-tools-extra.git extra</span>
+</pre></div>
+</div>
+<p>Next you need to obtain the CMake build system and Ninja build tool. You
+may already have CMake installed, but current binary versions of CMake
+aren’t built with Ninja support.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm</span>
+<span class="go">git clone https://github.com/martine/ninja.git</span>
+<span class="go">cd ninja</span>
+<span class="go">git checkout release</span>
+<span class="go">./bootstrap.py</span>
+<span class="go">sudo cp ninja /usr/bin/</span>
+
+<span class="go">cd ~/clang-llvm</span>
+<span class="go">git clone git://cmake.org/stage/cmake.git</span>
+<span class="go">cd cmake</span>
+<span class="go">git checkout next</span>
+<span class="go">./bootstrap</span>
+<span class="go">make</span>
+<span class="go">sudo make install</span>
+</pre></div>
+</div>
+<p>Okay. Now we’ll build Clang!</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm</span>
+<span class="go">mkdir build && cd build</span>
+<span class="go">cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON  # Enable tests; default is off.</span>
+<span class="go">ninja</span>
+<span class="go">ninja check       # Test LLVM only.</span>
+<span class="go">ninja clang-test  # Test Clang only.</span>
+<span class="go">ninja install</span>
+</pre></div>
+</div>
+<p>And we’re live.</p>
+<p>All of the tests should pass, though there is a (very) small chance that
+you can catch LLVM and Clang out of sync. Running <tt class="docutils literal"><span class="pre">'git</span> <span class="pre">svn</span> <span class="pre">rebase'</span></tt>
+in both the llvm and clang directories should fix any problems.</p>
+<p>Finally, we want to set Clang as its own compiler.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm/build</span>
+<span class="go">ccmake ../llvm</span>
+</pre></div>
+</div>
+<p>The second command will bring up a GUI for configuring Clang. You need
+to set the entry for <tt class="docutils literal"><span class="pre">CMAKE_CXX_COMPILER</span></tt>. Press <tt class="docutils literal"><span class="pre">'t'</span></tt> to turn on
+advanced mode. Scroll down to <tt class="docutils literal"><span class="pre">CMAKE_CXX_COMPILER</span></tt>, and set it to
+<tt class="docutils literal"><span class="pre">/usr/bin/clang++</span></tt>, or wherever you installed it. Press <tt class="docutils literal"><span class="pre">'c'</span></tt> to
+configure, then <tt class="docutils literal"><span class="pre">'g'</span></tt> to generate CMake’s files.</p>
+<p>Finally, run ninja one last time, and you’re done.</p>
+</div>
+<div class="section" id="step-1-create-a-clangtool">
+<h2>Step 1: Create a ClangTool<a class="headerlink" href="#step-1-create-a-clangtool" title="Permalink to this headline">¶</a></h2>
+<p>Now that we have enough background knowledge, it’s time to create the
+simplest productive ClangTool in existence: a syntax checker. While this
+already exists as <tt class="docutils literal"><span class="pre">clang-check</span></tt>, it’s important to understand what’s
+going on.</p>
+<p>First, we’ll need to create a new directory for our tool and tell CMake
+that it exists. As this is not going to be a core clang tool, it will
+live in the <tt class="docutils literal"><span class="pre">tools/extra</span></tt> repository.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm/llvm/tools/clang</span>
+<span class="go">mkdir tools/extra/loop-convert</span>
+<span class="go">echo 'add_subdirectory(loop-convert)' >> tools/extra/CMakeLists.txt</span>
+<span class="go">vim tools/extra/loop-convert/CMakeLists.txt</span>
+</pre></div>
+</div>
+<p>CMakeLists.txt should have the following contents:</p>
+<div class="highlight-python"><pre>set(LLVM_LINK_COMPONENTS support)
+set(LLVM_USED_LIBS clangTooling clangBasic clangAST)
+
+add_clang_executable(loop-convert
+  LoopConvert.cpp
+  )
+target_link_libraries(loop-convert
+  clangTooling
+  clangBasic
+  clangASTMatchers
+  )</pre>
+</div>
+<p>With that done, Ninja will be able to compile our tool. Let’s give it
+something to compile! Put the following into
+<tt class="docutils literal"><span class="pre">tools/extra/loop-convert/LoopConvert.cpp</span></tt>. A detailed explanation of
+why the different parts are needed can be found in the <a class="reference external" href="LibTooling.html">LibTooling
+documentation</a>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Declares clang::SyntaxOnlyAction.</span>
+<span class="cp">#include "clang/Frontend/FrontendActions.h"</span>
+<span class="cp">#include "clang/Tooling/CommonOptionsParser.h"</span>
+<span class="cp">#include "clang/Tooling/Tooling.h"</span>
+<span class="c1">// Declares llvm::cl::extrahelp.</span>
+<span class="cp">#include "llvm/Support/CommandLine.h"</span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">clang</span><span class="o">::</span><span class="n">tooling</span><span class="p">;</span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">// Apply a custom category to all command-line options so that they are the</span>
+<span class="c1">// only ones displayed.</span>
+<span class="k">static</span> <span class="n">llvm</span><span class="o">::</span><span class="n">cl</span><span class="o">::</span><span class="n">OptionCategory</span> <span class="n">MyToolCategory</span><span class="p">(</span><span class="s">"my-tool options"</span><span class="p">);</span>
+
+<span class="c1">// CommonOptionsParser declares HelpMessage with a description of the common</span>
+<span class="c1">// command-line options related to the compilation database and input files.</span>
+<span class="c1">// It's nice to have this help message in all tools.</span>
+<span class="k">static</span> <span class="n">cl</span><span class="o">::</span><span class="n">extrahelp</span> <span class="n">CommonHelp</span><span class="p">(</span><span class="n">CommonOptionsParser</span><span class="o">::</span><span class="n">HelpMessage</span><span class="p">);</span>
+
+<span class="c1">// A help message for this specific tool can be added afterwards.</span>
+<span class="k">static</span> <span class="n">cl</span><span class="o">::</span><span class="n">extrahelp</span> <span class="n">MoreHelp</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">More help text..."</span><span class="p">);</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">CommonOptionsParser</span> <span class="n">OptionsParser</span><span class="p">(</span><span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">MyToolCategory</span><span class="p">);</span>
+  <span class="n">ClangTool</span> <span class="n">Tool</span><span class="p">(</span><span class="n">OptionsParser</span><span class="p">.</span><span class="n">getCompilations</span><span class="p">(),</span>
+                 <span class="n">OptionsParser</span><span class="p">.</span><span class="n">getSourcePathList</span><span class="p">());</span>
+  <span class="k">return</span> <span class="n">Tool</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="n">newFrontendActionFactory</span><span class="o"><</span><span class="n">clang</span><span class="o">::</span><span class="n">SyntaxOnlyAction</span><span class="o">></span><span class="p">().</span><span class="n">get</span><span class="p">());</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>And that’s it! You can compile our new tool by running ninja from the
+<tt class="docutils literal"><span class="pre">build</span></tt> directory.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm/build</span>
+<span class="go">ninja</span>
+</pre></div>
+</div>
+<p>You should now be able to run the syntax checker, which is located in
+<tt class="docutils literal"><span class="pre">~/clang-llvm/build/bin</span></tt>, on any source file. Try it!</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cat "int main() { return 0; }" > test.cpp</span>
+<span class="go">bin/loop-convert test.cpp --</span>
+</pre></div>
+</div>
+<p>Note the two dashes after we specify the source file. The additional
+options for the compiler are passed after the dashes rather than loading
+them from a compilation database - there just aren’t any options needed
+right now.</p>
+</div>
+<div class="section" id="intermezzo-learn-ast-matcher-basics">
+<h2>Intermezzo: Learn AST matcher basics<a class="headerlink" href="#intermezzo-learn-ast-matcher-basics" title="Permalink to this headline">¶</a></h2>
+<p>Clang recently introduced the <a class="reference internal" href="LibASTMatchers.html"><em>ASTMatcher
+library</em></a> to provide a simple, powerful, and
+concise way to describe specific patterns in the AST. Implemented as a
+DSL powered by macros and templates (see
+<a class="reference external" href="../doxygen/ASTMatchers_8h_source.html">ASTMatchers.h</a> if you’re
+curious), matchers offer the feel of algebraic data types common to
+functional programming languages.</p>
+<p>For example, suppose you wanted to examine only binary operators. There
+is a matcher to do exactly that, conveniently named <tt class="docutils literal"><span class="pre">binaryOperator</span></tt>.
+I’ll give you one guess what this matcher does:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">binaryOperator</span><span class="p">(</span><span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"+"</span><span class="p">),</span> <span class="n">hasLHS</span><span class="p">(</span><span class="n">integerLiteral</span><span class="p">(</span><span class="n">equals</span><span class="p">(</span><span class="mi">0</span><span class="p">))))</span>
+</pre></div>
+</div>
+<p>Shockingly, it will match against addition expressions whose left hand
+side is exactly the literal 0. It will not match against other forms of
+0, such as <tt class="docutils literal"><span class="pre">'\0'</span></tt> or <tt class="docutils literal"><span class="pre">NULL</span></tt>, but it will match against macros that
+expand to 0. The matcher will also not match against calls to the
+overloaded operator <tt class="docutils literal"><span class="pre">'+'</span></tt>, as there is a separate <tt class="docutils literal"><span class="pre">operatorCallExpr</span></tt>
+matcher to handle overloaded operators.</p>
+<p>There are AST matchers to match all the different nodes of the AST,
+narrowing matchers to only match AST nodes fulfilling specific criteria,
+and traversal matchers to get from one kind of AST node to another. For
+a complete list of AST matchers, take a look at the <a class="reference external" href="LibASTMatchersReference.html">AST Matcher
+References</a></p>
+<p>All matcher that are nouns describe entities in the AST and can be
+bound, so that they can be referred to whenever a match is found. To do
+so, simply call the method <tt class="docutils literal"><span class="pre">bind</span></tt> on these matchers, e.g.:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">variable</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())).</span><span class="n">bind</span><span class="p">(</span><span class="s">"intvar"</span><span class="p">)</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="step-2-using-ast-matchers">
+<h2>Step 2: Using AST matchers<a class="headerlink" href="#step-2-using-ast-matchers" title="Permalink to this headline">¶</a></h2>
+<p>Okay, on to using matchers for real. Let’s start by defining a matcher
+which will capture all <tt class="docutils literal"><span class="pre">for</span></tt> statements that define a new variable
+initialized to zero. Let’s start with matching all <tt class="docutils literal"><span class="pre">for</span></tt> loops:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">forStmt</span><span class="p">()</span>
+</pre></div>
+</div>
+<p>Next, we want to specify that a single variable is declared in the first
+portion of the loop, so we can extend the matcher to</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">forStmt</span><span class="p">(</span><span class="n">hasLoopInit</span><span class="p">(</span><span class="n">declStmt</span><span class="p">(</span><span class="n">hasSingleDecl</span><span class="p">(</span><span class="n">varDecl</span><span class="p">()))))</span>
+</pre></div>
+</div>
+<p>Finally, we can add the condition that the variable is initialized to
+zero.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">forStmt</span><span class="p">(</span><span class="n">hasLoopInit</span><span class="p">(</span><span class="n">declStmt</span><span class="p">(</span><span class="n">hasSingleDecl</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span>
+  <span class="n">hasInitializer</span><span class="p">(</span><span class="n">integerLiteral</span><span class="p">(</span><span class="n">equals</span><span class="p">(</span><span class="mi">0</span><span class="p">))))))))</span>
+</pre></div>
+</div>
+<p>It is fairly easy to read and understand the matcher definition (“match
+loops whose init portion declares a single variable which is initialized
+to the integer literal 0”), but deciding that every piece is necessary
+is more difficult. Note that this matcher will not match loops whose
+variables are initialized to <tt class="docutils literal"><span class="pre">'\0'</span></tt>, <tt class="docutils literal"><span class="pre">0.0</span></tt>, <tt class="docutils literal"><span class="pre">NULL</span></tt>, or any form of
+zero besides the integer 0.</p>
+<p>The last step is giving the matcher a name and binding the <tt class="docutils literal"><span class="pre">ForStmt</span></tt>
+as we will want to do something with it:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">StatementMatcher</span> <span class="n">LoopMatcher</span> <span class="o">=</span>
+  <span class="n">forStmt</span><span class="p">(</span><span class="n">hasLoopInit</span><span class="p">(</span><span class="n">declStmt</span><span class="p">(</span><span class="n">hasSingleDecl</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span>
+    <span class="n">hasInitializer</span><span class="p">(</span><span class="n">integerLiteral</span><span class="p">(</span><span class="n">equals</span><span class="p">(</span><span class="mi">0</span><span class="p">)))))))).</span><span class="n">bind</span><span class="p">(</span><span class="s">"forLoop"</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Once you have defined your matchers, you will need to add a little more
+scaffolding in order to run them. Matchers are paired with a
+<tt class="docutils literal"><span class="pre">MatchCallback</span></tt> and registered with a <tt class="docutils literal"><span class="pre">MatchFinder</span></tt> object, then run
+from a <tt class="docutils literal"><span class="pre">ClangTool</span></tt>. More code!</p>
+<p>Add the following to <tt class="docutils literal"><span class="pre">LoopConvert.cpp</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "clang/ASTMatchers/ASTMatchers.h"</span>
+<span class="cp">#include "clang/ASTMatchers/ASTMatchFinder.h"</span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">clang</span><span class="p">;</span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">clang</span><span class="o">::</span><span class="n">ast_matchers</span><span class="p">;</span>
+
+<span class="n">StatementMatcher</span> <span class="n">LoopMatcher</span> <span class="o">=</span>
+  <span class="n">forStmt</span><span class="p">(</span><span class="n">hasLoopInit</span><span class="p">(</span><span class="n">declStmt</span><span class="p">(</span><span class="n">hasSingleDecl</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span>
+    <span class="n">hasInitializer</span><span class="p">(</span><span class="n">integerLiteral</span><span class="p">(</span><span class="n">equals</span><span class="p">(</span><span class="mi">0</span><span class="p">)))))))).</span><span class="n">bind</span><span class="p">(</span><span class="s">"forLoop"</span><span class="p">);</span>
+
+<span class="k">class</span> <span class="nc">LoopPrinter</span> <span class="o">:</span> <span class="k">public</span> <span class="n">MatchFinder</span><span class="o">::</span><span class="n">MatchCallback</span> <span class="p">{</span>
+<span class="k">public</span> <span class="o">:</span>
+  <span class="k">virtual</span> <span class="kt">void</span> <span class="n">run</span><span class="p">(</span><span class="k">const</span> <span class="n">MatchFinder</span><span class="o">::</span><span class="n">MatchResult</span> <span class="o">&</span><span class="n">Result</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="k">const</span> <span class="n">ForStmt</span> <span class="o">*</span><span class="n">FS</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Nodes</span><span class="p">.</span><span class="n">getNodeAs</span><span class="o"><</span><span class="n">clang</span><span class="o">::</span><span class="n">ForStmt</span><span class="o">></span><span class="p">(</span><span class="s">"forLoop"</span><span class="p">))</span>
+      <span class="n">FS</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>And change <tt class="docutils literal"><span class="pre">main()</span></tt> to:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">CommonOptionsParser</span> <span class="n">OptionsParser</span><span class="p">(</span><span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">MyToolCategory</span><span class="p">);</span>
+  <span class="n">ClangTool</span> <span class="n">Tool</span><span class="p">(</span><span class="n">OptionsParser</span><span class="p">.</span><span class="n">getCompilations</span><span class="p">(),</span>
+                 <span class="n">OptionsParser</span><span class="p">.</span><span class="n">getSourcePathList</span><span class="p">());</span>
+
+  <span class="n">LoopPrinter</span> <span class="n">Printer</span><span class="p">;</span>
+  <span class="n">MatchFinder</span> <span class="n">Finder</span><span class="p">;</span>
+  <span class="n">Finder</span><span class="p">.</span><span class="n">addMatcher</span><span class="p">(</span><span class="n">LoopMatcher</span><span class="p">,</span> <span class="o">&</span><span class="n">Printer</span><span class="p">);</span>
+
+  <span class="k">return</span> <span class="n">Tool</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="n">newFrontendActionFactory</span><span class="p">(</span><span class="o">&</span><span class="n">Finder</span><span class="p">).</span><span class="n">get</span><span class="p">());</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Now, you should be able to recompile and run the code to discover for
+loops. Create a new file with a few examples, and test out our new
+handiwork:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="go">cd ~/clang-llvm/llvm/llvm_build/</span>
+<span class="go">ninja loop-convert</span>
+<span class="go">vim ~/test-files/simple-loops.cc</span>
+<span class="go">bin/loop-convert ~/test-files/simple-loops.cc</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="step-3-5-more-complicated-matchers">
+<h2>Step 3.5: More Complicated Matchers<a class="headerlink" href="#step-3-5-more-complicated-matchers" title="Permalink to this headline">¶</a></h2>
+<p>Our simple matcher is capable of discovering for loops, but we would
+still need to filter out many more ourselves. We can do a good portion
+of the remaining work with some cleverly chosen matchers, but first we
+need to decide exactly which properties we want to allow.</p>
+<p>How can we characterize for loops over arrays which would be eligible
+for translation to range-based syntax? Range based loops over arrays of
+size <tt class="docutils literal"><span class="pre">N</span></tt> that:</p>
+<ul class="simple">
+<li>start at index <tt class="docutils literal"><span class="pre">0</span></tt></li>
+<li>iterate consecutively</li>
+<li>end at index <tt class="docutils literal"><span class="pre">N-1</span></tt></li>
+</ul>
+<p>We already check for (1), so all we need to add is a check to the loop’s
+condition to ensure that the loop’s index variable is compared against
+<tt class="docutils literal"><span class="pre">N</span></tt> and another check to ensure that the increment step just
+increments this same variable. The matcher for (2) is straightforward:
+require a pre- or post-increment of the same variable declared in the
+init portion.</p>
+<p>Unfortunately, such a matcher is impossible to write. Matchers contain
+no logic for comparing two arbitrary AST nodes and determining whether
+or not they are equal, so the best we can do is matching more than we
+would like to allow, and punting extra comparisons to the callback.</p>
+<p>In any case, we can start building this sub-matcher. We can require that
+the increment step be a unary increment like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasIncrement</span><span class="p">(</span><span class="n">unaryOperator</span><span class="p">(</span><span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"++"</span><span class="p">)))</span>
+</pre></div>
+</div>
+<p>Specifying what is incremented introduces another quirk of Clang’s AST:
+Usages of variables are represented as <tt class="docutils literal"><span class="pre">DeclRefExpr</span></tt>‘s (“declaration
+reference expressions”) because they are expressions which refer to
+variable declarations. To find a <tt class="docutils literal"><span class="pre">unaryOperator</span></tt> that refers to a
+specific declaration, we can simply add a second condition to it:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasIncrement</span><span class="p">(</span><span class="n">unaryOperator</span><span class="p">(</span>
+  <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"++"</span><span class="p">),</span>
+  <span class="n">hasUnaryOperand</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">())))</span>
+</pre></div>
+</div>
+<p>Furthermore, we can restrict our matcher to only match if the
+incremented variable is an integer:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasIncrement</span><span class="p">(</span><span class="n">unaryOperator</span><span class="p">(</span>
+  <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"++"</span><span class="p">),</span>
+  <span class="n">hasUnaryOperand</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span><span class="n">to</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())))))))</span>
+</pre></div>
+</div>
+<p>And the last step will be to attach an identifier to this variable, so
+that we can retrieve it in the callback:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasIncrement</span><span class="p">(</span><span class="n">unaryOperator</span><span class="p">(</span>
+  <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"++"</span><span class="p">),</span>
+  <span class="n">hasUnaryOperand</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span><span class="n">to</span><span class="p">(</span>
+    <span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())).</span><span class="n">bind</span><span class="p">(</span><span class="s">"incrementVariable"</span><span class="p">))))))</span>
+</pre></div>
+</div>
+<p>We can add this code to the definition of <tt class="docutils literal"><span class="pre">LoopMatcher</span></tt> and make sure
+that our program, outfitted with the new matcher, only prints out loops
+that declare a single variable initialized to zero and have an increment
+step consisting of a unary increment of some variable.</p>
+<p>Now, we just need to add a matcher to check if the condition part of the
+<tt class="docutils literal"><span class="pre">for</span></tt> loop compares a variable against the size of the array. There is
+only one problem - we don’t know which array we’re iterating over
+without looking at the body of the loop! We are again restricted to
+approximating the result we want with matchers, filling in the details
+in the callback. So we start with:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasCondition</span><span class="p">(</span><span class="n">binaryOperator</span><span class="p">(</span><span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"<"</span><span class="p">))</span>
+</pre></div>
+</div>
+<p>It makes sense to ensure that the left-hand side is a reference to a
+variable, and that the right-hand side has integer type.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasCondition</span><span class="p">(</span><span class="n">binaryOperator</span><span class="p">(</span>
+  <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"<"</span><span class="p">),</span>
+  <span class="n">hasLHS</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span><span class="n">to</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">()))))),</span>
+  <span class="n">hasRHS</span><span class="p">(</span><span class="n">expr</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())))))</span>
+</pre></div>
+</div>
+<p>Why? Because it doesn’t work. Of the three loops provided in
+<tt class="docutils literal"><span class="pre">test-files/simple.cpp</span></tt>, zero of them have a matching condition. A
+quick look at the AST dump of the first for loop, produced by the
+previous iteration of loop-convert, shows us the answer:</p>
+<div class="highlight-python"><pre>(ForStmt 0x173b240
+  (DeclStmt 0x173afc8
+    0x173af50 "int i =
+      (IntegerLiteral 0x173afa8 'int' 0)")
+  <<>>
+  (BinaryOperator 0x173b060 '_Bool' '<'
+    (ImplicitCastExpr 0x173b030 'int'
+      (DeclRefExpr 0x173afe0 'int' lvalue Var 0x173af50 'i' 'int'))
+    (ImplicitCastExpr 0x173b048 'int'
+      (DeclRefExpr 0x173b008 'const int' lvalue Var 0x170fa80 'N' 'const int')))
+  (UnaryOperator 0x173b0b0 'int' lvalue prefix '++'
+    (DeclRefExpr 0x173b088 'int' lvalue Var 0x173af50 'i' 'int'))
+  (CompoundStatement ...</pre>
+</div>
+<p>We already know that the declaration and increments both match, or this
+loop wouldn’t have been dumped. The culprit lies in the implicit cast
+applied to the first operand (i.e. the LHS) of the less-than operator,
+an L-value to R-value conversion applied to the expression referencing
+<tt class="docutils literal"><span class="pre">i</span></tt>. Thankfully, the matcher library offers a solution to this problem
+in the form of <tt class="docutils literal"><span class="pre">ignoringParenImpCasts</span></tt>, which instructs the matcher to
+ignore implicit casts and parentheses before continuing to match.
+Adjusting the condition operator will restore the desired match.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">hasCondition</span><span class="p">(</span><span class="n">binaryOperator</span><span class="p">(</span>
+  <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"<"</span><span class="p">),</span>
+  <span class="n">hasLHS</span><span class="p">(</span><span class="n">ignoringParenImpCasts</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span>
+    <span class="n">to</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())))))),</span>
+  <span class="n">hasRHS</span><span class="p">(</span><span class="n">expr</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())))))</span>
+</pre></div>
+</div>
+<p>After adding binds to the expressions we wished to capture and
+extracting the identifier strings into variables, we have array-step-2
+completed.</p>
+</div>
+<div class="section" id="step-4-retrieving-matched-nodes">
+<h2>Step 4: Retrieving Matched Nodes<a class="headerlink" href="#step-4-retrieving-matched-nodes" title="Permalink to this headline">¶</a></h2>
+<p>So far, the matcher callback isn’t very interesting: it just dumps the
+loop’s AST. At some point, we will need to make changes to the input
+source code. Next, we’ll work on using the nodes we bound in the
+previous step.</p>
+<p>The <tt class="docutils literal"><span class="pre">MatchFinder::run()</span></tt> callback takes a
+<tt class="docutils literal"><span class="pre">MatchFinder::MatchResult&</span></tt> as its parameter. We’re most interested in
+its <tt class="docutils literal"><span class="pre">Context</span></tt> and <tt class="docutils literal"><span class="pre">Nodes</span></tt> members. Clang uses the <tt class="docutils literal"><span class="pre">ASTContext</span></tt>
+class to represent contextual information about the AST, as the name
+implies, though the most functionally important detail is that several
+operations require an <tt class="docutils literal"><span class="pre">ASTContext*</span></tt> parameter. More immediately useful
+is the set of matched nodes, and how we retrieve them.</p>
+<p>Since we bind three variables (identified by ConditionVarName,
+InitVarName, and IncrementVarName), we can obtain the matched nodes by
+using the <tt class="docutils literal"><span class="pre">getNodeAs()</span></tt> member function.</p>
+<p>In <tt class="docutils literal"><span class="pre">LoopConvert.cpp</span></tt> add</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "clang/AST/ASTContext.h"</span>
+</pre></div>
+</div>
+<p>Change <tt class="docutils literal"><span class="pre">LoopMatcher</span></tt> to</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">StatementMatcher</span> <span class="n">LoopMatcher</span> <span class="o">=</span>
+    <span class="n">forStmt</span><span class="p">(</span><span class="n">hasLoopInit</span><span class="p">(</span><span class="n">declStmt</span><span class="p">(</span>
+                <span class="n">hasSingleDecl</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasInitializer</span><span class="p">(</span><span class="n">integerLiteral</span><span class="p">(</span><span class="n">equals</span><span class="p">(</span><span class="mi">0</span><span class="p">))))</span>
+                                  <span class="p">.</span><span class="n">bind</span><span class="p">(</span><span class="s">"initVarName"</span><span class="p">)))),</span>
+            <span class="n">hasIncrement</span><span class="p">(</span><span class="n">unaryOperator</span><span class="p">(</span>
+                <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"++"</span><span class="p">),</span>
+                <span class="n">hasUnaryOperand</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span>
+                    <span class="n">to</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())).</span><span class="n">bind</span><span class="p">(</span><span class="s">"incVarName"</span><span class="p">)))))),</span>
+            <span class="n">hasCondition</span><span class="p">(</span><span class="n">binaryOperator</span><span class="p">(</span>
+                <span class="n">hasOperatorName</span><span class="p">(</span><span class="s">"<"</span><span class="p">),</span>
+                <span class="n">hasLHS</span><span class="p">(</span><span class="n">ignoringParenImpCasts</span><span class="p">(</span><span class="n">declRefExpr</span><span class="p">(</span>
+                    <span class="n">to</span><span class="p">(</span><span class="n">varDecl</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())).</span><span class="n">bind</span><span class="p">(</span><span class="s">"condVarName"</span><span class="p">))))),</span>
+                <span class="n">hasRHS</span><span class="p">(</span><span class="n">expr</span><span class="p">(</span><span class="n">hasType</span><span class="p">(</span><span class="n">isInteger</span><span class="p">())))))).</span><span class="n">bind</span><span class="p">(</span><span class="s">"forLoop"</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>And change <tt class="docutils literal"><span class="pre">LoopPrinter::run</span></tt> to</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="n">LoopPrinter</span><span class="o">::</span><span class="n">run</span><span class="p">(</span><span class="k">const</span> <span class="n">MatchFinder</span><span class="o">::</span><span class="n">MatchResult</span> <span class="o">&</span><span class="n">Result</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">ASTContext</span> <span class="o">*</span><span class="n">Context</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Context</span><span class="p">;</span>
+  <span class="k">const</span> <span class="n">ForStmt</span> <span class="o">*</span><span class="n">FS</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Nodes</span><span class="p">.</span><span class="n">getStmtAs</span><span class="o"><</span><span class="n">ForStmt</span><span class="o">></span><span class="p">(</span><span class="s">"forLoop"</span><span class="p">);</span>
+  <span class="c1">// We do not want to convert header files!</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">FS</span> <span class="o">||</span> <span class="o">!</span><span class="n">Context</span><span class="o">-></span><span class="n">getSourceManager</span><span class="p">().</span><span class="n">isFromMainFile</span><span class="p">(</span><span class="n">FS</span><span class="o">-></span><span class="n">getForLoc</span><span class="p">()))</span>
+    <span class="k">return</span><span class="p">;</span>
+  <span class="k">const</span> <span class="n">VarDecl</span> <span class="o">*</span><span class="n">IncVar</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Nodes</span><span class="p">.</span><span class="n">getNodeAs</span><span class="o"><</span><span class="n">VarDecl</span><span class="o">></span><span class="p">(</span><span class="s">"incVarName"</span><span class="p">);</span>
+  <span class="k">const</span> <span class="n">VarDecl</span> <span class="o">*</span><span class="n">CondVar</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Nodes</span><span class="p">.</span><span class="n">getNodeAs</span><span class="o"><</span><span class="n">VarDecl</span><span class="o">></span><span class="p">(</span><span class="s">"condVarName"</span><span class="p">);</span>
+  <span class="k">const</span> <span class="n">VarDecl</span> <span class="o">*</span><span class="n">InitVar</span> <span class="o">=</span> <span class="n">Result</span><span class="p">.</span><span class="n">Nodes</span><span class="p">.</span><span class="n">getNodeAs</span><span class="o"><</span><span class="n">VarDecl</span><span class="o">></span><span class="p">(</span><span class="s">"initVarName"</span><span class="p">);</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">areSameVariable</span><span class="p">(</span><span class="n">IncVar</span><span class="p">,</span> <span class="n">CondVar</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span><span class="n">areSameVariable</span><span class="p">(</span><span class="n">IncVar</span><span class="p">,</span> <span class="n">InitVar</span><span class="p">))</span>
+    <span class="k">return</span><span class="p">;</span>
+  <span class="n">llvm</span><span class="o">::</span><span class="n">outs</span><span class="p">()</span> <span class="o"><<</span> <span class="s">"Potential array-based loop discovered.</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Clang associates a <tt class="docutils literal"><span class="pre">VarDecl</span></tt> with each variable to represent the variable’s
+declaration. Since the “canonical” form of each declaration is unique by
+address, all we need to do is make sure neither <tt class="docutils literal"><span class="pre">ValueDecl</span></tt> (base class of
+<tt class="docutils literal"><span class="pre">VarDecl</span></tt>) is <tt class="docutils literal"><span class="pre">NULL</span></tt> and compare the canonical Decls.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="kt">bool</span> <span class="nf">areSameVariable</span><span class="p">(</span><span class="k">const</span> <span class="n">ValueDecl</span> <span class="o">*</span><span class="n">First</span><span class="p">,</span> <span class="k">const</span> <span class="n">ValueDecl</span> <span class="o">*</span><span class="n">Second</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">First</span> <span class="o">&&</span> <span class="n">Second</span> <span class="o">&&</span>
+         <span class="n">First</span><span class="o">-></span><span class="n">getCanonicalDecl</span><span class="p">()</span> <span class="o">==</span> <span class="n">Second</span><span class="o">-></span><span class="n">getCanonicalDecl</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If execution reaches the end of <tt class="docutils literal"><span class="pre">LoopPrinter::run()</span></tt>, we know that the
+loop shell that looks like</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">expr</span><span class="p">();</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span> <span class="p">...</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>For now, we will just print a message explaining that we found a loop.
+The next section will deal with recursively traversing the AST to
+discover all changes needed.</p>
+<p>As a side note, it’s not as trivial to test if two expressions are the same,
+though Clang has already done the hard work for us by providing a way to
+canonicalize expressions:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="kt">bool</span> <span class="nf">areSameExpr</span><span class="p">(</span><span class="n">ASTContext</span> <span class="o">*</span><span class="n">Context</span><span class="p">,</span> <span class="k">const</span> <span class="n">Expr</span> <span class="o">*</span><span class="n">First</span><span class="p">,</span>
+                        <span class="k">const</span> <span class="n">Expr</span> <span class="o">*</span><span class="n">Second</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">First</span> <span class="o">||</span> <span class="o">!</span><span class="n">Second</span><span class="p">)</span>
+    <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+  <span class="n">llvm</span><span class="o">::</span><span class="n">FoldingSetNodeID</span> <span class="n">FirstID</span><span class="p">,</span> <span class="n">SecondID</span><span class="p">;</span>
+  <span class="n">First</span><span class="o">-></span><span class="n">Profile</span><span class="p">(</span><span class="n">FirstID</span><span class="p">,</span> <span class="o">*</span><span class="n">Context</span><span class="p">,</span> <span class="nb">true</span><span class="p">);</span>
+  <span class="n">Second</span><span class="o">-></span><span class="n">Profile</span><span class="p">(</span><span class="n">SecondID</span><span class="p">,</span> <span class="o">*</span><span class="n">Context</span><span class="p">,</span> <span class="nb">true</span><span class="p">);</span>
+  <span class="k">return</span> <span class="n">FirstID</span> <span class="o">==</span> <span class="n">SecondID</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This code relies on the comparison between two
+<tt class="docutils literal"><span class="pre">llvm::FoldingSetNodeIDs</span></tt>. As the documentation for
+<tt class="docutils literal"><span class="pre">Stmt::Profile()</span></tt> indicates, the <tt class="docutils literal"><span class="pre">Profile()</span></tt> member function builds
+a description of a node in the AST, based on its properties, along with
+those of its children. <tt class="docutils literal"><span class="pre">FoldingSetNodeID</span></tt> then serves as a hash we can
+use to compare expressions. We will need <tt class="docutils literal"><span class="pre">areSameExpr</span></tt> later. Before
+you run the new code on the additional loops added to
+test-files/simple.cpp, try to figure out which ones will be considered
+potentially convertible.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="RAVFrontendAction.html">How to write RecursiveASTVisitor based ASTFrontendActions.</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibASTMatchers.html">Matching the Clang AST</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibFormat.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibFormat.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibFormat.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibFormat.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,116 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>LibFormat — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Clang Plugins" href="ClangPlugins.html" />
+    <link rel="prev" title="LibTooling" href="LibTooling.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>LibFormat</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="LibTooling.html">LibTooling</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangPlugins.html">Clang Plugins</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="libformat">
+<h1>LibFormat<a class="headerlink" href="#libformat" title="Permalink to this headline">¶</a></h1>
+<p>LibFormat is a library that implements automatic source code formatting based
+on Clang. This documents describes the LibFormat interface and design as well
+as some basic style discussions.</p>
+<p>If you just want to use <cite>clang-format</cite> as a tool or integrated into an editor,
+checkout <a class="reference internal" href="ClangFormat.html"><em>ClangFormat</em></a>.</p>
+<div class="section" id="design">
+<h2>Design<a class="headerlink" href="#design" title="Permalink to this headline">¶</a></h2>
+<p>FIXME: Write up design.</p>
+</div>
+<div class="section" id="interface">
+<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline">¶</a></h2>
+<p>The core routine of LibFormat is <tt class="docutils literal"><span class="pre">reformat()</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">tooling</span><span class="o">::</span><span class="n">Replacements</span> <span class="n">reformat</span><span class="p">(</span><span class="k">const</span> <span class="n">FormatStyle</span> <span class="o">&</span><span class="n">Style</span><span class="p">,</span> <span class="n">Lexer</span> <span class="o">&</span><span class="n">Lex</span><span class="p">,</span>
+                               <span class="n">SourceManager</span> <span class="o">&</span><span class="n">SourceMgr</span><span class="p">,</span>
+                               <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">CharSourceRange</span><span class="o">></span> <span class="n">Ranges</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>This reads a token stream out of the lexer <tt class="docutils literal"><span class="pre">Lex</span></tt> and reformats all the code
+ranges in <tt class="docutils literal"><span class="pre">Ranges</span></tt>. The <tt class="docutils literal"><span class="pre">FormatStyle</span></tt> controls basic decisions made during
+formatting. A list of options can be found under <a class="reference internal" href="#style-options"><em>Style Options</em></a>.</p>
+</div>
+<div class="section" id="style-options">
+<span id="id1"></span><h2>Style Options<a class="headerlink" href="#style-options" title="Permalink to this headline">¶</a></h2>
+<p>The style options describe specific formatting options that can be used in
+order to make <cite>ClangFormat</cite> comply with different style guides. Currently,
+two style guides are hard-coded:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// \brief Returns a format style complying with the LLVM coding standards:</span>
+<span class="c1">/// http://llvm.org/docs/CodingStandards.html.</span>
+<span class="n">FormatStyle</span> <span class="nf">getLLVMStyle</span><span class="p">();</span>
+
+<span class="c1">/// \brief Returns a format style complying with Google's C++ style guide:</span>
+<span class="c1">/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml.</span>
+<span class="n">FormatStyle</span> <span class="nf">getGoogleStyle</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>These options are also exposed in the <a class="reference internal" href="ClangFormat.html"><em>standalone tools</em></a>
+through the <cite>-style</cite> option.</p>
+<p>In the future, we plan on making this configurable.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="LibTooling.html">LibTooling</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangPlugins.html">Clang Plugins</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibTooling.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibTooling.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibTooling.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/LibTooling.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,246 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>LibTooling — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="LibFormat" href="LibFormat.html" />
+    <link rel="prev" title="Introduction to the Clang AST" href="IntroductionToTheClangAST.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>LibTooling</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="IntroductionToTheClangAST.html">Introduction to the Clang AST</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibFormat.html">LibFormat</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="libtooling">
+<h1>LibTooling<a class="headerlink" href="#libtooling" title="Permalink to this headline">¶</a></h1>
+<p>LibTooling is a library to support writing standalone tools based on Clang.
+This document will provide a basic walkthrough of how to write a tool using
+LibTooling.</p>
+<p>For the information on how to setup Clang Tooling for LLVM see
+<a class="reference internal" href="HowToSetupToolingForLLVM.html"><em>How To Setup Clang Tooling For LLVM</em></a></p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Tools built with LibTooling, like Clang Plugins, run <tt class="docutils literal"><span class="pre">FrontendActions</span></tt> over
+code.</p>
+<p>In this tutorial, we’ll demonstrate the different ways of running Clang’s
+<tt class="docutils literal"><span class="pre">SyntaxOnlyAction</span></tt>, which runs a quick syntax check, over a bunch of code.</p>
+</div>
+<div class="section" id="parsing-a-code-snippet-in-memory">
+<h2>Parsing a code snippet in memory<a class="headerlink" href="#parsing-a-code-snippet-in-memory" title="Permalink to this headline">¶</a></h2>
+<p>If you ever wanted to run a <tt class="docutils literal"><span class="pre">FrontendAction</span></tt> over some sample code, for
+example to unit test parts of the Clang AST, <tt class="docutils literal"><span class="pre">runToolOnCode</span></tt> is what you
+looked for.  Let me give you an example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "clang/Tooling/Tooling.h"</span>
+
+<span class="n">TEST</span><span class="p">(</span><span class="n">runToolOnCode</span><span class="p">,</span> <span class="n">CanSyntaxCheckCode</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// runToolOnCode returns whether the action was correctly run over the</span>
+  <span class="c1">// given code.</span>
+  <span class="n">EXPECT_TRUE</span><span class="p">(</span><span class="n">runToolOnCode</span><span class="p">(</span><span class="k">new</span> <span class="n">clang</span><span class="o">::</span><span class="n">SyntaxOnlyAction</span><span class="p">,</span> <span class="s">"class X {};"</span><span class="p">));</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="writing-a-standalone-tool">
+<h2>Writing a standalone tool<a class="headerlink" href="#writing-a-standalone-tool" title="Permalink to this headline">¶</a></h2>
+<p>Once you unit tested your <tt class="docutils literal"><span class="pre">FrontendAction</span></tt> to the point where it cannot
+possibly break, it’s time to create a standalone tool.  For a standalone tool
+to run clang, it first needs to figure out what command line arguments to use
+for a specified file.  To that end we create a <tt class="docutils literal"><span class="pre">CompilationDatabase</span></tt>.  There
+are different ways to create a compilation database, and we need to support all
+of them depending on command-line options.  There’s the <tt class="docutils literal"><span class="pre">CommonOptionsParser</span></tt>
+class that takes the responsibility to parse command-line parameters related to
+compilation databases and inputs, so that all tools share the implementation.</p>
+<div class="section" id="parsing-common-tools-options">
+<h3>Parsing common tools options<a class="headerlink" href="#parsing-common-tools-options" title="Permalink to this headline">¶</a></h3>
+<p><tt class="docutils literal"><span class="pre">CompilationDatabase</span></tt> can be read from a build directory or the command line.
+Using <tt class="docutils literal"><span class="pre">CommonOptionsParser</span></tt> allows for explicit specification of a compile
+command line, specification of build path using the <tt class="docutils literal"><span class="pre">-p</span></tt> command-line option,
+and automatic location of the compilation database using source files paths.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "clang/Tooling/CommonOptionsParser.h"</span>
+<span class="cp">#include "llvm/Support/CommandLine.h"</span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">clang</span><span class="o">::</span><span class="n">tooling</span><span class="p">;</span>
+
+<span class="c1">// Apply a custom category to all command-line options so that they are the</span>
+<span class="c1">// only ones displayed.</span>
+<span class="k">static</span> <span class="n">llvm</span><span class="o">::</span><span class="n">cl</span><span class="o">::</span><span class="n">OptionCategory</span> <span class="n">MyToolCategory</span><span class="p">(</span><span class="s">"my-tool options"</span><span class="p">);</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// CommonOptionsParser constructor will parse arguments and create a</span>
+  <span class="c1">// CompilationDatabase.  In case of error it will terminate the program.</span>
+  <span class="n">CommonOptionsParser</span> <span class="n">OptionsParser</span><span class="p">(</span><span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">MyToolCategory</span><span class="p">);</span>
+
+  <span class="c1">// Use OptionsParser.getCompilations() and OptionsParser.getSourcePathList()</span>
+  <span class="c1">// to retrieve CompilationDatabase and the list of input file paths.</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="creating-and-running-a-clangtool">
+<h3>Creating and running a ClangTool<a class="headerlink" href="#creating-and-running-a-clangtool" title="Permalink to this headline">¶</a></h3>
+<p>Once we have a <tt class="docutils literal"><span class="pre">CompilationDatabase</span></tt>, we can create a <tt class="docutils literal"><span class="pre">ClangTool</span></tt> and run
+our <tt class="docutils literal"><span class="pre">FrontendAction</span></tt> over some code.  For example, to run the
+<tt class="docutils literal"><span class="pre">SyntaxOnlyAction</span></tt> over the files “a.cc” and “b.cc” one would write:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// A clang tool can run over a number of sources in the same process...</span>
+<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Sources</span><span class="p">;</span>
+<span class="n">Sources</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="s">"a.cc"</span><span class="p">);</span>
+<span class="n">Sources</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="s">"b.cc"</span><span class="p">);</span>
+
+<span class="c1">// We hand the CompilationDatabase we created and the sources to run over into</span>
+<span class="c1">// the tool constructor.</span>
+<span class="n">ClangTool</span> <span class="nf">Tool</span><span class="p">(</span><span class="n">OptionsParser</span><span class="p">.</span><span class="n">getCompilations</span><span class="p">(),</span> <span class="n">Sources</span><span class="p">);</span>
+
+<span class="c1">// The ClangTool needs a new FrontendAction for each translation unit we run</span>
+<span class="c1">// on.  Thus, it takes a FrontendActionFactory as parameter.  To create a</span>
+<span class="c1">// FrontendActionFactory from a given FrontendAction type, we call</span>
+<span class="c1">// newFrontendActionFactory<clang::SyntaxOnlyAction>().</span>
+<span class="kt">int</span> <span class="n">result</span> <span class="o">=</span> <span class="n">Tool</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="n">newFrontendActionFactory</span><span class="o"><</span><span class="n">clang</span><span class="o">::</span><span class="n">SyntaxOnlyAction</span><span class="o">></span><span class="p">().</span><span class="n">get</span><span class="p">());</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="putting-it-together-the-first-tool">
+<h3>Putting it together — the first tool<a class="headerlink" href="#putting-it-together-the-first-tool" title="Permalink to this headline">¶</a></h3>
+<p>Now we combine the two previous steps into our first real tool.  A more advanced
+version of this example tool is also checked into the clang tree at
+<tt class="docutils literal"><span class="pre">tools/clang-check/ClangCheck.cpp</span></tt>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Declares clang::SyntaxOnlyAction.</span>
+<span class="cp">#include "clang/Frontend/FrontendActions.h"</span>
+<span class="cp">#include "clang/Tooling/CommonOptionsParser.h"</span>
+<span class="cp">#include "clang/Tooling/Tooling.h"</span>
+<span class="c1">// Declares llvm::cl::extrahelp.</span>
+<span class="cp">#include "llvm/Support/CommandLine.h"</span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">clang</span><span class="o">::</span><span class="n">tooling</span><span class="p">;</span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">// Apply a custom category to all command-line options so that they are the</span>
+<span class="c1">// only ones displayed.</span>
+<span class="k">static</span> <span class="n">cl</span><span class="o">::</span><span class="n">OptionCategory</span> <span class="n">MyToolCategory</span><span class="p">(</span><span class="s">"my-tool options"</span><span class="p">);</span>
+
+<span class="c1">// CommonOptionsParser declares HelpMessage with a description of the common</span>
+<span class="c1">// command-line options related to the compilation database and input files.</span>
+<span class="c1">// It's nice to have this help message in all tools.</span>
+<span class="k">static</span> <span class="n">cl</span><span class="o">::</span><span class="n">extrahelp</span> <span class="n">CommonHelp</span><span class="p">(</span><span class="n">CommonOptionsParser</span><span class="o">::</span><span class="n">HelpMessage</span><span class="p">);</span>
+
+<span class="c1">// A help message for this specific tool can be added afterwards.</span>
+<span class="k">static</span> <span class="n">cl</span><span class="o">::</span><span class="n">extrahelp</span> <span class="n">MoreHelp</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">More help text..."</span><span class="p">);</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">CommonOptionsParser</span> <span class="n">OptionsParser</span><span class="p">(</span><span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">MyToolCategory</span><span class="p">);</span>
+  <span class="n">ClangTool</span> <span class="n">Tool</span><span class="p">(</span><span class="n">OptionsParser</span><span class="p">.</span><span class="n">getCompilations</span><span class="p">(),</span>
+                 <span class="n">OptionsParser</span><span class="p">.</span><span class="n">getSourcePathList</span><span class="p">());</span>
+  <span class="k">return</span> <span class="n">Tool</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="n">newFrontendActionFactory</span><span class="o"><</span><span class="n">clang</span><span class="o">::</span><span class="n">SyntaxOnlyAction</span><span class="o">></span><span class="p">().</span><span class="n">get</span><span class="p">());</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="running-the-tool-on-some-code">
+<h3>Running the tool on some code<a class="headerlink" href="#running-the-tool-on-some-code" title="Permalink to this headline">¶</a></h3>
+<p>When you check out and build clang, clang-check is already built and available
+to you in bin/clang-check inside your build directory.</p>
+<p>You can run clang-check on a file in the llvm repository by specifying all the
+needed parameters after a “<tt class="docutils literal"><span class="pre">--</span></tt>” separator:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /path/to/source/llvm
+<span class="nv">$ </span><span class="nb">export </span><span class="nv">BD</span><span class="o">=</span>/path/to/build/llvm
+<span class="nv">$ $BD</span>/bin/clang-check tools/clang/tools/clang-check/ClangCheck.cpp -- <span class="se">\</span>
+      clang++ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS <span class="se">\</span>
+      -Itools/clang/include -I<span class="nv">$BD</span>/include -Iinclude <span class="se">\</span>
+      -Itools/clang/lib/Headers -c
+</pre></div>
+</div>
+<p>As an alternative, you can also configure cmake to output a compile command
+database into its build directory:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Alternatively to calling cmake, use ccmake, toggle to advanced mode and</span>
+<span class="c"># set the parameter CMAKE_EXPORT_COMPILE_COMMANDS from the UI.</span>
+<span class="nv">$ </span>cmake -DCMAKE_EXPORT_COMPILE_COMMANDS<span class="o">=</span>ON .
+</pre></div>
+</div>
+<p>This creates a file called <tt class="docutils literal"><span class="pre">compile_commands.json</span></tt> in the build directory.
+Now you can run <strong class="program">clang-check</strong> over files in the project by specifying
+the build path as first argument and some source files as further positional
+arguments:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /path/to/source/llvm
+<span class="nv">$ </span><span class="nb">export </span><span class="nv">BD</span><span class="o">=</span>/path/to/build/llvm
+<span class="nv">$ $BD</span>/bin/clang-check -p <span class="nv">$BD</span> tools/clang/tools/clang-check/ClangCheck.cpp
+</pre></div>
+</div>
+</div>
+<div class="section" id="builtin-includes">
+<span id="libtooling-builtin-includes"></span><h3>Builtin includes<a class="headerlink" href="#builtin-includes" title="Permalink to this headline">¶</a></h3>
+<p>Clang tools need their builtin headers and search for them the same way Clang
+does.  Thus, the default location to look for builtin headers is in a path
+<tt class="docutils literal"><span class="pre">$(dirname</span> <span class="pre">/path/to/tool)/../lib/clang/3.3/include</span></tt> relative to the tool
+binary.  This works out-of-the-box for tools running from llvm’s toplevel
+binary directory after building clang-headers, or if the tool is running from
+the binary directory of a clang install next to the clang binary.</p>
+<p>Tips: if your tool fails to find <tt class="docutils literal"><span class="pre">stddef.h</span></tt> or similar headers, call the tool
+with <tt class="docutils literal"><span class="pre">-v</span></tt> and look at the search paths it looks through.</p>
+</div>
+<div class="section" id="linking">
+<h3>Linking<a class="headerlink" href="#linking" title="Permalink to this headline">¶</a></h3>
+<p>For a list of libraries to link, look at one of the tools’ Makefiles (for
+example <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/Makefile?view=markup">clang-check/Makefile</a>).</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="IntroductionToTheClangAST.html">Introduction to the Clang AST</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibFormat.html">LibFormat</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MSVCCompatibility.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MSVCCompatibility.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MSVCCompatibility.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MSVCCompatibility.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,182 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>MSVC compatibility — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="Frequently Asked Questions (FAQ)" href="FAQ.html" />
+    <link rel="prev" title="Modules" href="Modules.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>MSVC compatibility</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="Modules.html">Modules</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="FAQ.html">Frequently Asked Questions (FAQ)</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <style type="text/css">
+  .none { background-color: #FFCCCC }
+  .partial { background-color: #FFFF99 }
+  .good { background-color: #CCFF99 }
+</style><div class="section" id="msvc-compatibility">
+<h1>MSVC compatibility<a class="headerlink" href="#msvc-compatibility" title="Permalink to this headline">¶</a></h1>
+<p>When Clang compiles C++ code for Windows, it attempts to be compatible with
+MSVC.  There are multiple dimensions to compatibility.</p>
+<p>First, Clang attempts to be ABI-compatible, meaning that Clang-compiled code
+should be able to link against MSVC-compiled code successfully.  However, C++
+ABIs are particularly large and complicated, and Clang’s support for MSVC’s C++
+ABI is a work in progress.  If you don’t require MSVC ABI compatibility or don’t
+want to use Microsoft’s C and C++ runtimes, the mingw32 toolchain might be a
+better fit for your project.</p>
+<p>Second, Clang implements many MSVC language extensions, such as
+<tt class="docutils literal"><span class="pre">__declspec(dllexport)</span></tt> and a handful of pragmas.  These are typically
+controlled by <tt class="docutils literal"><span class="pre">-fms-extensions</span></tt>.</p>
+<p>Third, MSVC accepts some C++ code that Clang will typically diagnose as
+invalid.  When these constructs are present in widely included system headers,
+Clang attempts to recover and continue compiling the user’s program.  Most
+parsing and semantic compatibility tweaks are controlled by
+<tt class="docutils literal"><span class="pre">-fms-compatibility</span></tt> and <tt class="docutils literal"><span class="pre">-fdelayed-template-parsing</span></tt>, and they are a work
+in progress.</p>
+<p>Finally, there is <a class="reference internal" href="UsersManual.html#clang-cl"><em>clang-cl</em></a>, a driver program for clang that attempts to
+be compatible with MSVC’s cl.exe.</p>
+<div class="section" id="abi-features">
+<h2>ABI features<a class="headerlink" href="#abi-features" title="Permalink to this headline">¶</a></h2>
+<p>The status of major ABI-impacting C++ features:</p>
+<ul class="simple">
+<li>Record layout: <span class="good">Complete</span>.  We’ve tested this with a fuzzer and have
+fixed all known bugs.</li>
+<li>Class inheritance: <span class="good">Mostly complete</span>.  This covers all of the standard
+OO features you would expect: virtual method inheritance, multiple
+inheritance, and virtual inheritance.  Every so often we uncover a bug where
+our tables are incompatible, but this is pretty well in hand.  This feature
+has also been fuzz tested.</li>
+<li>Name mangling: <span class="good">Ongoing</span>.  Every new C++ feature generally needs its own
+mangling.  For example, member pointer template arguments have an interesting
+and distinct mangling.  Fortunately, incorrect manglings usually do not result
+in runtime errors.  Non-inline functions with incorrect manglings usually
+result in link errors, which are relatively easy to diagnose.  Incorrect
+manglings for inline functions and templates result in multiple copies in the
+final image.  The C++ standard requires that those addresses be equal, but few
+programs rely on this.</li>
+<li>Member pointers: <span class="good">Mostly complete</span>.  Standard C++ member pointers are
+fully implemented and should be ABI compatible.  Both <a class="reference external" href="http://msdn.microsoft.com/en-us/library/83cch5a6.aspx">#pragma
+pointers_to_members</a> and the <a class="reference external" href="http://msdn.microsoft.com/en-us/library/yad46a6z.aspx">/vm</a> flags are supported. However, MSVC
+supports an extension to allow creating a <a class="reference external" href="http://llvm.org/PR15713">pointer to a member of a virtual
+base class</a>.  Clang does not yet support this.</li>
+</ul>
+<ul class="simple">
+<li>Debug info: <span class="partial">Minimal</span>.  Clang emits CodeView line tables into the
+object file, similar to what MSVC emits when given the <tt class="docutils literal"><span class="pre">/Z7</span></tt> flag.
+Microsoft’s link.exe will read this information and use it to create a PDB,
+enabling stack traces in all modern Windows debuggers.  Clang does not emit
+any type info or description of variable layout.</li>
+<li>RTTI: <span class="good">Complete</span>.  Generation of RTTI data structures has been
+finished, along with support for the <tt class="docutils literal"><span class="pre">/GR</span></tt> flag.</li>
+<li>Exceptions and SEH: <span class="none">Unstarted</span>.  Clang can parse both constructs, but
+does not know how to emit compatible handlers.</li>
+<li>Thread-safe initialization of local statics: <span class="none">Unstarted</span>.  We are ABI
+compatible with MSVC 2013, which does not support thread-safe local statics.
+MSVC “14” changed the ABI to make initialization of local statics thread safe,
+and we have not yet implemented this.</li>
+<li>Lambdas: <span class="good">Mostly complete</span>.  Clang is compatible with Microsoft’s
+implementation of lambdas except for providing overloads for conversion to
+function pointer for different calling conventions.  However, Microsoft’s
+extension is non-conforming.</li>
+</ul>
+</div>
+<div class="section" id="template-instantiation-and-name-lookup">
+<h2>Template instantiation and name lookup<a class="headerlink" href="#template-instantiation-and-name-lookup" title="Permalink to this headline">¶</a></h2>
+<p>MSVC allows many invalid constructs in class templates that Clang has
+historically rejected.  In order to parse widely distributed headers for
+libraries such as the Active Template Library (ATL) and Windows Runtime Library
+(WRL), some template rules have been relaxed or extended in Clang on Windows.</p>
+<p>The first major semantic difference is that MSVC appears to defer all parsing
+an analysis of inline method bodies in class templates until instantiation
+time.  By default on Windows, Clang attempts to follow suit.  This behavior is
+controlled by the <tt class="docutils literal"><span class="pre">-fdelayed-template-parsing</span></tt> flag.  While Clang delays
+parsing of method bodies, it still parses the bodies <em>before</em> template argument
+substitution, which is not what MSVC does.  The following compatibility tweaks
+are necessary to parse the the template in those cases.</p>
+<p>MSVC allows some name lookup into dependent base classes.  Even on other
+platforms, this has been a <a class="reference external" href="http://clang.llvm.org/compatibility.html#dep_lookup">frequently asked question</a> for Clang users.  A
+dependent base class is a base class that depends on the value of a template
+parameter.  Clang cannot see any of the names inside dependent bases while it
+is parsing your template, so the user is sometimes required to use the
+<tt class="docutils literal"><span class="pre">typename</span></tt> keyword to assist the parser.  On Windows, Clang attempts to
+follow the normal lookup rules, but if lookup fails, it will assume that the
+user intended to find the name in a dependent base.  While parsing the
+following program, Clang will recover as if the user had written the
+commented-out code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span> <span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span>
+<span class="k">struct</span> <span class="n">Foo</span> <span class="o">:</span> <span class="n">T</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">()</span> <span class="p">{</span>
+    <span class="cm">/*typename*/</span> <span class="n">T</span><span class="o">::</span><span class="n">UnknownType</span> <span class="n">x</span> <span class="o">=</span>  <span class="cm">/*this->*/</span><span class="n">unknownMember</span><span class="p">;</span>
+  <span class="p">}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>After recovery, Clang warns the user that this code is non-standard and issues
+a hint suggesting how to fix the problem.</p>
+<p>As of this writing, Clang is able to compile a simple ATL hello world
+application.  There are still issues parsing WRL headers for modern Windows 8
+apps, but they should be addressed soon.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="Modules.html">Modules</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="FAQ.html">Frequently Asked Questions (FAQ)</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MemorySanitizer.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MemorySanitizer.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MemorySanitizer.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/MemorySanitizer.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,289 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>MemorySanitizer — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="DataFlowSanitizer" href="DataFlowSanitizer.html" />
+    <link rel="prev" title="ThreadSanitizer" href="ThreadSanitizer.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>MemorySanitizer</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="ThreadSanitizer.html">ThreadSanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DataFlowSanitizer.html">DataFlowSanitizer</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="memorysanitizer">
+<h1>MemorySanitizer<a class="headerlink" href="#memorysanitizer" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#how-to-build" id="id2">How to build</a></li>
+<li><a class="reference internal" href="#usage" id="id3">Usage</a><ul>
+<li><a class="reference internal" href="#has-feature-memory-sanitizer" id="id4"><tt class="docutils literal"><span class="pre">__has_feature(memory_sanitizer)</span></tt></a></li>
+<li><a class="reference internal" href="#attribute-no-sanitize-memory" id="id5"><tt class="docutils literal"><span class="pre">__attribute__((no_sanitize_memory))</span></tt></a></li>
+<li><a class="reference internal" href="#blacklist" id="id6">Blacklist</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#report-symbolization" id="id7">Report symbolization</a></li>
+<li><a class="reference internal" href="#origin-tracking" id="id8">Origin Tracking</a></li>
+<li><a class="reference internal" href="#handling-external-code" id="id9">Handling external code</a></li>
+<li><a class="reference internal" href="#supported-platforms" id="id10">Supported Platforms</a></li>
+<li><a class="reference internal" href="#limitations" id="id11">Limitations</a></li>
+<li><a class="reference internal" href="#current-status" id="id12">Current Status</a></li>
+<li><a class="reference internal" href="#more-information" id="id13">More Information</a></li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer is a detector of uninitialized reads. It consists of a
+compiler instrumentation module and a run-time library.</p>
+<p>Typical slowdown introduced by MemorySanitizer is <strong>3x</strong>.</p>
+</div>
+<div class="section" id="how-to-build">
+<h2><a class="toc-backref" href="#id2">How to build</a><a class="headerlink" href="#how-to-build" title="Permalink to this headline">¶</a></h2>
+<p>Follow the <a class="reference external" href="../get_started.html">clang build instructions</a>. CMake
+build is supported.</p>
+</div>
+<div class="section" id="usage">
+<h2><a class="toc-backref" href="#id3">Usage</a><a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
+<p>Simply compile and link your program with <tt class="docutils literal"><span class="pre">-fsanitize=memory</span></tt> flag.
+The MemorySanitizer run-time library should be linked to the final
+executable, so make sure to use <tt class="docutils literal"><span class="pre">clang</span></tt> (not <tt class="docutils literal"><span class="pre">ld</span></tt>) for the final
+link step. When linking shared libraries, the MemorySanitizer run-time
+is not linked, so <tt class="docutils literal"><span class="pre">-Wl,-z,defs</span></tt> may cause link errors (don’t use it
+with MemorySanitizer). To get a reasonable performance add <tt class="docutils literal"><span class="pre">-O1</span></tt> or
+higher. To get meaninful stack traces in error messages add
+<tt class="docutils literal"><span class="pre">-fno-omit-frame-pointer</span></tt>. To get perfect stack traces you may need
+to disable inlining (just use <tt class="docutils literal"><span class="pre">-O1</span></tt>) and tail call elimination
+(<tt class="docutils literal"><span class="pre">-fno-optimize-sibling-calls</span></tt>).</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cat umr.cc
+<span class="gp">#</span>include <stdio.h>
+
+<span class="go">int main(int argc, char** argv) {</span>
+<span class="go">  int* a = new int[10];</span>
+<span class="go">  a[5] = 0;</span>
+<span class="go">  if (a[argc])</span>
+<span class="go">    printf("xx\n");</span>
+<span class="go">  return 0;</span>
+<span class="go">}</span>
+
+<span class="gp">%</span> clang -fsanitize<span class="o">=</span>memory -fno-omit-frame-pointer -g -O2 umr.cc
+</pre></div>
+</div>
+<p>If a bug is detected, the program will print an error message to
+stderr and exit with a non-zero exit code. Currently, MemorySanitizer
+does not symbolize its output by default, so you may need to use a
+separate script to symbolize the result offline (this will be fixed in
+future).</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> ./a.out
+<span class="go">WARNING: MemorySanitizer: use-of-uninitialized-value</span>
+<span class="go">    #0 0x7f45944b418a in main umr.cc:6</span>
+<span class="go">    #1 0x7f45938b676c in __libc_start_main libc-start.c:226</span>
+</pre></div>
+</div>
+<p>By default, MemorySanitizer exits on the first detected error.</p>
+<div class="section" id="has-feature-memory-sanitizer">
+<h3><a class="toc-backref" href="#id4"><tt class="docutils literal"><span class="pre">__has_feature(memory_sanitizer)</span></tt></a><a class="headerlink" href="#has-feature-memory-sanitizer" title="Permalink to this headline">¶</a></h3>
+<p>In some cases one may need to execute different code depending on
+whether MemorySanitizer is enabled. <a class="reference internal" href="LanguageExtensions.html#langext-has-feature-has-extension"><em>__has_feature</em></a> can be used for this purpose.</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="cp">#if defined(__has_feature)</span>
+<span class="cp">#  if __has_feature(memory_sanitizer)</span>
+<span class="c1">// code that builds only under MemorySanitizer</span>
+<span class="cp">#  endif</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="attribute-no-sanitize-memory">
+<h3><a class="toc-backref" href="#id5"><tt class="docutils literal"><span class="pre">__attribute__((no_sanitize_memory))</span></tt></a><a class="headerlink" href="#attribute-no-sanitize-memory" title="Permalink to this headline">¶</a></h3>
+<p>Some code should not be checked by MemorySanitizer.
+One may use the function attribute
+<a class="reference internal" href="AttributeReference.html#langext-memory-sanitizer"><em>no_sanitize_memory</em></a>
+to disable uninitialized checks in a particular function.
+MemorySanitizer may still instrument such functions to avoid false positives.
+This attribute may not be
+supported by other compilers, so we suggest to use it together with
+<tt class="docutils literal"><span class="pre">__has_feature(memory_sanitizer)</span></tt>.</p>
+</div>
+<div class="section" id="blacklist">
+<h3><a class="toc-backref" href="#id6">Blacklist</a><a class="headerlink" href="#blacklist" title="Permalink to this headline">¶</a></h3>
+<p>MemorySanitizer supports <tt class="docutils literal"><span class="pre">src</span></tt> and <tt class="docutils literal"><span class="pre">fun</span></tt> entity types in
+<a class="reference internal" href="SanitizerSpecialCaseList.html"><em>Sanitizer special case list</em></a>, that can be used to relax MemorySanitizer
+checks for certain source files and functions. All “Use of uninitialized value”
+warnings will be suppressed and all values loaded from memory will be
+considered fully initialized.</p>
+</div>
+</div>
+<div class="section" id="report-symbolization">
+<h2><a class="toc-backref" href="#id7">Report symbolization</a><a class="headerlink" href="#report-symbolization" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer uses an external symbolizer to print files and line numbers in
+reports. Make sure that <tt class="docutils literal"><span class="pre">llvm-symbolizer</span></tt> binary is in <tt class="docutils literal"><span class="pre">PATH</span></tt>,
+or set environment variable <tt class="docutils literal"><span class="pre">MSAN_SYMBOLIZER_PATH</span></tt> to point to it.</p>
+</div>
+<div class="section" id="origin-tracking">
+<h2><a class="toc-backref" href="#id8">Origin Tracking</a><a class="headerlink" href="#origin-tracking" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer can track origins of unitialized values, similar to
+Valgrind’s –track-origins option. This feature is enabled by
+<tt class="docutils literal"><span class="pre">-fsanitize-memory-track-origins</span></tt> Clang option. With the code from
+the example above,</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> clang -fsanitize<span class="o">=</span>memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -g -O2 umr.cc
+<span class="gp">%</span> ./a.out
+<span class="go">WARNING: MemorySanitizer: use-of-uninitialized-value</span>
+<span class="go">    #0 0x7f7893912f0b in main umr2.cc:6</span>
+<span class="go">    #1 0x7f789249b76c in __libc_start_main libc-start.c:226</span>
+
+<span class="go">  Uninitialized value was created by a heap allocation</span>
+<span class="go">    #0 0x7f7893901cbd in operator new[](unsigned long) msan_new_delete.cc:44</span>
+<span class="go">    #1 0x7f7893912e06 in main umr2.cc:4</span>
+</pre></div>
+</div>
+<p>Origin tracking has proved to be very useful for debugging MemorySanitizer
+reports. It slows down program execution by a factor of 1.5x-2x on top
+of the usual MemorySanitizer slowdown.</p>
+<p>MemorySanitizer can provide even more information with
+<tt class="docutils literal"><span class="pre">-fsanitize-memory-track-origins=2</span></tt> flag. In this mode reports
+include information about intermediate stores the uninitialized value went
+through.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cat umr2.cc
+<span class="gp">#</span>include <stdio.h>
+
+<span class="go">int main(int argc, char** argv) {</span>
+<span class="go">  int* a = new int[10];</span>
+<span class="go">  a[5] = 0;</span>
+<span class="go">  volatile int b = a[argc];</span>
+<span class="go">  if (b)</span>
+<span class="go">    printf("xx\n");</span>
+<span class="go">  return 0;</span>
+<span class="go">}</span>
+
+<span class="gp">%</span> clang -fsanitize<span class="o">=</span>memory -fsanitize-memory-track-origins<span class="o">=</span>2 -fno-omit-frame-pointer -g -O2 umr2.cc
+<span class="gp">%</span> ./a.out
+<span class="go">WARNING: MemorySanitizer: use-of-uninitialized-value</span>
+<span class="go">    #0 0x7f7893912f0b in main umr2.cc:7</span>
+<span class="go">    #1 0x7f789249b76c in __libc_start_main libc-start.c:226</span>
+
+<span class="go">  Uninitialized value was stored to memory at</span>
+<span class="go">    #0 0x7f78938b5c25 in __msan_chain_origin msan.cc:484</span>
+<span class="go">    #1 0x7f7893912ecd in main umr2.cc:6</span>
+
+<span class="go">  Uninitialized value was created by a heap allocation</span>
+<span class="go">    #0 0x7f7893901cbd in operator new[](unsigned long) msan_new_delete.cc:44</span>
+<span class="go">    #1 0x7f7893912e06 in main umr2.cc:4</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="handling-external-code">
+<h2><a class="toc-backref" href="#id9">Handling external code</a><a class="headerlink" href="#handling-external-code" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer requires that all program code is instrumented. This
+also includes any libraries that the program depends on, even libc.
+Failing to achieve this may result in false reports.</p>
+<p>Full MemorySanitizer instrumentation is very difficult to achieve. To
+make it easier, MemorySanitizer runtime library includes 70+
+interceptors for the most common libc functions. They make it possible
+to run MemorySanitizer-instrumented programs linked with
+uninstrumented libc. For example, the authors were able to bootstrap
+MemorySanitizer-instrumented Clang compiler by linking it with
+self-built instrumented libcxx (as a replacement for libstdc++).</p>
+<p>In the case when rebuilding all program dependencies with
+MemorySanitizer is problematic, an experimental MSanDR tool can be
+used. It is a DynamoRio-based tool that uses dynamic instrumentation
+to avoid false positives due to uninstrumented code. The tool simply
+marks memory from instrumented libraries as fully initialized. See
+<cite>http://code.google.com/p/memory-sanitizer/wiki/Running#Running_with_the_dynamic_tool</cite>
+for more information.</p>
+</div>
+<div class="section" id="supported-platforms">
+<h2><a class="toc-backref" href="#id10">Supported Platforms</a><a class="headerlink" href="#supported-platforms" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer is supported on</p>
+<ul class="simple">
+<li>Linux x86_64 (tested on Ubuntu 12.04);</li>
+</ul>
+</div>
+<div class="section" id="limitations">
+<h2><a class="toc-backref" href="#id11">Limitations</a><a class="headerlink" href="#limitations" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li>MemorySanitizer uses 2x more real memory than a native run, 3x with
+origin tracking.</li>
+<li>MemorySanitizer maps (but not reserves) 64 Terabytes of virtual
+address space. This means that tools like <tt class="docutils literal"><span class="pre">ulimit</span></tt> may not work as
+usually expected.</li>
+<li>Static linking is not supported.</li>
+<li>Non-position-independent executables are not supported.  Therefore, the
+<tt class="docutils literal"><span class="pre">fsanitize=memory</span></tt> flag will cause Clang to act as though the <tt class="docutils literal"><span class="pre">-fPIE</span></tt>
+flag had been supplied if compiling without <tt class="docutils literal"><span class="pre">-fPIC</span></tt>, and as though the
+<tt class="docutils literal"><span class="pre">-pie</span></tt> flag had been supplied if linking an executable.</li>
+<li>Depending on the version of Linux kernel, running without ASLR may
+be not supported. Note that GDB disables ASLR by default. To debug
+instrumented programs, use “set disable-randomization off”.</li>
+</ul>
+</div>
+<div class="section" id="current-status">
+<h2><a class="toc-backref" href="#id12">Current Status</a><a class="headerlink" href="#current-status" title="Permalink to this headline">¶</a></h2>
+<p>MemorySanitizer is an experimental tool. It is known to work on large
+real-world programs, like Clang/LLVM itself.</p>
+</div>
+<div class="section" id="more-information">
+<h2><a class="toc-backref" href="#id13">More Information</a><a class="headerlink" href="#more-information" title="Permalink to this headline">¶</a></h2>
+<p><a class="reference external" href="http://code.google.com/p/memory-sanitizer/">http://code.google.com/p/memory-sanitizer</a></p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="ThreadSanitizer.html">ThreadSanitizer</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DataFlowSanitizer.html">DataFlowSanitizer</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.5.1/tools/clang/docs/_build/html/Modules.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.5.1/tools/clang/docs/_build/html/Modules.html?rev=225843&view=auto
==============================================================================
--- www-releases/trunk/3.5.1/tools/clang/docs/_build/html/Modules.html (added)
+++ www-releases/trunk/3.5.1/tools/clang/docs/_build/html/Modules.html Tue Jan 13 16:55:20 2015
@@ -0,0 +1,858 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Modules — Clang 3.5 documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '3.5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Clang 3.5 documentation" href="index.html" />
+    <link rel="next" title="MSVC compatibility" href="MSVCCompatibility.html" />
+    <link rel="prev" title="Sanitizer special case list" href="SanitizerSpecialCaseList.html" /> 
+  </head>
+  <body>
+      <div class="header"><h1 class="heading"><a href="index.html">
+          <span>Clang 3.5 documentation</span></a></h1>
+        <h2 class="heading"><span>Modules</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        «  <a href="SanitizerSpecialCaseList.html">Sanitizer special case list</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="MSVCCompatibility.html">MSVC compatibility</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="modules">
+<h1>Modules<a class="headerlink" href="#modules" title="Permalink to this headline">¶</a></h1>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">The functionality described on this page is supported for C and
+Objective-C. C++ support is experimental.</p>
+</div>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id11">Introduction</a><ul>
+<li><a class="reference internal" href="#problems-with-the-current-model" id="id12">Problems with the current model</a></li>
+<li><a class="reference internal" href="#semantic-import" id="id13">Semantic import</a></li>
+<li><a class="reference internal" href="#problems-modules-do-not-solve" id="id14">Problems modules do not solve</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#using-modules" id="id15">Using Modules</a><ul>
+<li><a class="reference internal" href="#objective-c-import-declaration" id="id16">Objective-C Import declaration</a></li>
+<li><a class="reference internal" href="#includes-as-imports" id="id17">Includes as imports</a></li>
+<li><a class="reference internal" href="#module-maps" id="id18">Module maps</a></li>
+<li><a class="reference internal" href="#compilation-model" id="id19">Compilation model</a></li>
+<li><a class="reference internal" href="#command-line-parameters" id="id20">Command-line parameters</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#module-semantics" id="id21">Module Semantics</a><ul>
+<li><a class="reference internal" href="#macros" id="id22">Macros</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#module-map-language" id="id23">Module Map Language</a><ul>
+<li><a class="reference internal" href="#lexical-structure" id="id24">Lexical structure</a></li>
+<li><a class="reference internal" href="#module-map-file" id="id25">Module map file</a></li>
+<li><a class="reference internal" href="#module-declaration" id="id26">Module declaration</a><ul>
+<li><a class="reference internal" href="#requires-declaration" id="id27">Requires declaration</a></li>
+<li><a class="reference internal" href="#header-declaration" id="id28">Header declaration</a></li>
+<li><a class="reference internal" href="#umbrella-directory-declaration" id="id29">Umbrella directory declaration</a></li>
+<li><a class="reference internal" href="#submodule-declaration" id="id30">Submodule declaration</a></li>
+<li><a class="reference internal" href="#export-declaration" id="id31">Export declaration</a></li>
+<li><a class="reference internal" href="#use-declaration" id="id32">Use declaration</a></li>
+<li><a class="reference internal" href="#link-declaration" id="id33">Link declaration</a></li>
+<li><a class="reference internal" href="#configuration-macros-declaration" id="id34">Configuration macros declaration</a></li>
+<li><a class="reference internal" href="#conflict-declarations" id="id35">Conflict declarations</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#attributes" id="id36">Attributes</a></li>
+<li><a class="reference internal" href="#private-module-map-files" id="id37">Private Module Map Files</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#modularizing-a-platform" id="id38">Modularizing a Platform</a></li>
+<li><a class="reference internal" href="#future-directions" id="id39">Future Directions</a></li>
+<li><a class="reference internal" href="#where-to-learn-more-about-modules" id="id40">Where To Learn More About Modules</a></li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id11">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Most software is built using a number of software libraries, including libraries supplied by the platform, internal libraries built as part of the software itself to provide structure, and third-party libraries. For each library, one needs to access both its interface (API) and its implementation. In the C family of languages, the interface to a library is accessed by including the appropriate header files(s):</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include <SomeLib.h></span>
+</pre></div>
+</div>
+<p>The implementation is handled separately by linking against the appropriate library. For example, by passing <tt class="docutils literal"><span class="pre">-lSomeLib</span></tt> to the linker.</p>
+<p>Modules provide an alternative, simpler way to use software libraries that provides better compile-time scalability and eliminates many of the problems inherent to using the C preprocessor to access the API of a library.</p>
+<div class="section" id="problems-with-the-current-model">
+<h3><a class="toc-backref" href="#id12">Problems with the current model</a><a class="headerlink" href="#problems-with-the-current-model" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">#include</span></tt> mechanism provided by the C preprocessor is a very poor way to access the API of a library, for a number of reasons:</p>
+<ul class="simple">
+<li><strong>Compile-time scalability</strong>: Each time a header is included, the
+compiler must preprocess and parse the text in that header and every
+header it includes, transitively. This process must be repeated for
+every translation unit in the application, which involves a huge
+amount of redundant work. In a project with <em>N</em> translation units
+and <em>M</em> headers included in each translation unit, the compiler is
+performing <em>M x N</em> work even though most of the <em>M</em> headers are
+shared among multiple translation units. C++ is particularly bad,
+because the compilation model for templates forces a huge amount of
+code into headers.</li>
+<li><strong>Fragility</strong>: <tt class="docutils literal"><span class="pre">#include</span></tt> directives are treated as textual
+inclusion by the preprocessor, and are therefore subject to any
+active macro definitions at the time of inclusion. If any of the
+active macro definitions happens to collide with a name in the
+library, it can break the library API or cause compilation failures
+in the library header itself. For an extreme example,
+<tt class="docutils literal"><span class="pre">#define</span> <span class="pre">std</span> <span class="pre">"The</span> <span class="pre">C++</span> <span class="pre">Standard"</span></tt> and then include a standard
+library header: the result is a horrific cascade of failures in the
+C++ Standard Library’s implementation. More subtle real-world
+problems occur when the headers for two different libraries interact
+due to macro collisions, and users are forced to reorder
+<tt class="docutils literal"><span class="pre">#include</span></tt> directives or introduce <tt class="docutils literal"><span class="pre">#undef</span></tt> directives to break
+the (unintended) dependency.</li>
+<li><strong>Conventional workarounds</strong>: C programmers have
+adopted a number of conventions to work around the fragility of the
+C preprocessor model. Include guards, for example, are required for
+the vast majority of headers to ensure that multiple inclusion
+doesn’t break the compile. Macro names are written with
+<tt class="docutils literal"><span class="pre">LONG_PREFIXED_UPPERCASE_IDENTIFIERS</span></tt> to avoid collisions, and some
+library/framework developers even use <tt class="docutils literal"><span class="pre">__underscored</span></tt> names
+in headers to avoid collisions with “normal” names that (by
+convention) shouldn’t even be macros. These conventions are a
+barrier to entry for developers coming from non-C languages, are
+boilerplate for more experienced developers, and make our headers
+far uglier than they should be.</li>
+<li><strong>Tool confusion</strong>: In a C-based language, it is hard to build tools
+that work well with software libraries, because the boundaries of
+the libraries are not clear. Which headers belong to a particular
+library, and in what order should those headers be included to
+guarantee that they compile correctly? Are the headers C, C++,
+Objective-C++, or one of the variants of these languages? What
+declarations in those headers are actually meant to be part of the
+API, and what declarations are present only because they had to be
+written as part of the header file?</li>
+</ul>
+</div>
+<div class="section" id="semantic-import">
+<h3><a class="toc-backref" href="#id13">Semantic import</a><a class="headerlink" href="#semantic-import" title="Permalink to this headline">¶</a></h3>
+<p>Modules improve access to the API of software libraries by replacing the textual preprocessor inclusion model with a more robust, more efficient semantic model. From the user’s perspective, the code looks only slightly different, because one uses an <tt class="docutils literal"><span class="pre">import</span></tt> declaration rather than a <tt class="docutils literal"><span class="pre">#include</span></tt> preprocessor directive:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="n">import</span> <span class="n">std</span><span class="p">.</span><span class="n">io</span><span class="p">;</span> <span class="c1">// pseudo-code; see below for syntax discussion</span>
+</pre></div>
+</div>
+<p>However, this module import behaves quite differently from the corresponding <tt class="docutils literal"><span class="pre">#include</span> <span class="pre"><stdio.h></span></tt>: when the compiler sees the module import above, it loads a binary representation of the <tt class="docutils literal"><span class="pre">std.io</span></tt> module and makes its API available to the application directly. Preprocessor definitions that precede the import declaration have no impact on the API provided by <tt class="docutils literal"><span class="pre">std.io</span></tt>, because the module itself was compiled as a separate, standalone module. Additionally, any linker flags required to use the <tt class="docutils literal"><span class="pre">std.io</span></tt> module will automatically be provided when the module is imported <a class="footnote-reference" href="#id6" id="id1">[1]</a>
+This semantic import model addresses many of the problems of the preprocessor inclusion model:</p>
+<ul class="simple">
+<li><strong>Compile-time scalability</strong>: The <tt class="docutils literal"><span class="pre">std.io</span></tt> module is only compiled once, and importing the module into a translation unit is a constant-time operation (independent of module system). Thus, the API of each software library is only parsed once, reducing the <em>M x N</em> compilation problem to an <em>M + N</em> problem.</li>
+<li><strong>Fragility</strong>: Each module is parsed as a standalone entity, so it has a consistent preprocessor environment. This completely eliminates the need for <tt class="docutils literal"><span class="pre">__underscored</span></tt> names and similarly defensive tricks. Moreover, the current preprocessor definitions when an import declaration is encountered are ignored, so one software library can not affect how another software library is compiled, eliminating include-order dependencies.</li>
+<li><strong>Tool confusion</strong>: Modules describe the API of software libraries, and tools can reason about and present a module as a representation of that API. Because modules can only be built standalone, tools can rely on the module definition to ensure that they get the complete API for the library. Moreover, modules can specify which languages they work with, so, e.g., one can not accidentally attempt to load a C++ module into a C program.</li>
+</ul>
+</div>
+<div class="section" id="problems-modules-do-not-solve">
+<h3><a class="toc-backref" href="#id14">Problems modules do not solve</a><a class="headerlink" href="#problems-modules-do-not-solve" title="Permalink to this headline">¶</a></h3>
+<p>Many programming languages have a module or package system, and because of the variety of features provided by these languages it is important to define what modules do <em>not</em> do. In particular, all of the following are considered out-of-scope for modules:</p>
+<ul class="simple">
+<li><strong>Rewrite the world’s code</strong>: It is not realistic to require applications or software libraries to make drastic or non-backward-compatible changes, nor is it feasible to completely eliminate headers. Modules must interoperate with existing software libraries and allow a gradual transition.</li>
+<li><strong>Versioning</strong>: Modules have no notion of version information. Programmers must still rely on the existing versioning mechanisms of the underlying language (if any exist) to version software libraries.</li>
+<li><strong>Namespaces</strong>: Unlike in some languages, modules do not imply any notion of namespaces. Thus, a struct declared in one module will still conflict with a struct of the same name declared in a different module, just as they would if declared in two different headers. This aspect is important for backward compatibility, because (for example) the mangled names of entities in software libraries must not change when introducing modules.</li>
+<li><strong>Binary distribution of modules</strong>: Headers (particularly C++ headers) expose the full complexity of the language. Maintaining a stable binary module format across architectures, compiler versions, and compiler vendors is technically infeasible.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="using-modules">
+<h2><a class="toc-backref" href="#id15">Using Modules</a><a class="headerlink" href="#using-modules" title="Permalink to this headline">¶</a></h2>
+<p>To enable modules, pass the command-line flag <tt class="docutils literal"><span class="pre">-fmodules</span></tt> <a class="footnote-reference" href="#id7" id="id2">[2]</a>. This will make any modules-enabled software libraries available as modules as well as introducing any modules-specific syntax. Additional <a class="reference internal" href="#command-line-parameters">command-line parameters</a> are described in a separate section later.</p>
+<div class="section" id="objective-c-import-declaration">
+<h3><a class="toc-backref" href="#id16">Objective-C Import declaration</a><a class="headerlink" href="#objective-c-import-declaration" title="Permalink to this headline">¶</a></h3>
+<p>Objective-C provides syntax for importing a module via an <em>@import declaration</em>, which imports the named module:</p>
+<div class="highlight-python"><pre>@import std;</pre>
+</div>
+<p>The @import declaration above imports the entire contents of the <tt class="docutils literal"><span class="pre">std</span></tt> module (which would contain, e.g., the entire C or C++ standard library) and make its API available within the current translation unit. To import only part of a module, one may use dot syntax to specific a particular submodule, e.g.,</p>
+<div class="highlight-python"><pre>@import std.io;</pre>
+</div>
+<p>Redundant import declarations are ignored, and one is free to import modules at any point within the translation unit, so long as the import declaration is at global scope.</p>
+<p>At present, there is no C or C++ syntax for import declarations. Clang
+will track the modules proposal in the C++ committee. See the section
+<a class="reference internal" href="#includes-as-imports">Includes as imports</a> to see how modules get imported today.</p>
+</div>
+<div class="section" id="includes-as-imports">
+<h3><a class="toc-backref" href="#id17">Includes as imports</a><a class="headerlink" href="#includes-as-imports" title="Permalink to this headline">¶</a></h3>
+<p>The primary user-level feature of modules is the import operation, which provides access to the API of software libraries. However, today’s programs make extensive use of <tt class="docutils literal"><span class="pre">#include</span></tt>, and it is unrealistic to assume that all of this code will change overnight. Instead, modules automatically translate <tt class="docutils literal"><span class="pre">#include</span></tt> directives into the corresponding module import. For example, the include directive</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include <stdio.h></span>
+</pre></div>
+</div>
+<p>will be automatically mapped to an import of the module <tt class="docutils literal"><span class="pre">std.io</span></tt>. Even with specific <tt class="docutils literal"><span class="pre">import</span></tt> syntax in the language, this particular feature is important for both adoption and backward compatibility: automatic translation of <tt class="docutils literal"><span class="pre">#include</span></tt> to <tt class="docutils literal"><span class="pre">import</span></tt> allows an application to get the benefits of modules (for all modules-enabled libraries) without any changes to the application itself. Thus, users can easily use modules with one compiler while falling back to the preprocessor-inclusion mechanism with other compilers.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">The automatic mapping of <tt class="docutils literal"><span class="pre">#include</span></tt> to <tt class="docutils literal"><span class="pre">import</span></tt> also solves an implementation problem: importing a module with a definition of some entity (say, a <tt class="docutils literal"><span class="pre">struct</span> <span class="pre">Point</span></tt>) and then parsing a header containing another definition of <tt class="docutils literal"><span class="pre">struct</span> <span class="pre">Point</span></tt> would cause a redefinition error, even if it is the same <tt class="docutils literal"><span class="pre">struct</span> <span class="pre">Point</span></tt>. By mapping <tt class="docutils literal"><span class="pre">#include</span></tt> to <tt class="docutils literal"><span class="pre">import</span></tt>, the compiler can guarantee that it always sees just the already-parsed definition from the module.</p>
+</div>
+</div>
+<div class="section" id="module-maps">
+<h3><a class="toc-backref" href="#id18">Module maps</a><a class="headerlink" href="#module-maps" title="Permalink to this headline">¶</a></h3>
+<p>The crucial link between modules and headers is described by a <em>module map</em>, which describes how a collection of existing headers maps on to the (logical) structure of a module. For example, one could imagine a module <tt class="docutils literal"><span class="pre">std</span></tt> covering the C standard library. Each of the C standard library headers (<tt class="docutils literal"><span class="pre"><stdio.h></span></tt>, <tt class="docutils literal"><span class="pre"><stdlib.h></span></tt>, <tt class="docutils literal"><span class="pre"><math.h></span></tt>, etc.) would contribute to the <tt class="docutils literal"><span class="pre">std</span></tt> module, by placing their respective APIs into the corresponding submodule (<tt class="docutils literal"><span class="pre">std.io</span></tt>, <tt class="docutils literal"><span class="pre">std.lib</span></tt>, <tt class="docutils literal"><span class="pre">std.math</span></tt>, etc.). Having a list of the headers that are part of the <tt class="docutils literal"><span class="pre">std</span></tt> module allows the compiler to build the <tt class="docutils literal"><span class="pre">std</span></tt> module as a standalone entity, and having the mapping from header names to (sub)modules allows the automatic translation of <tt class="docutils literal"><span class="pre">#include</span></tt> directives to module imports.</p>
+<p>Module maps are specified as separate files (each named <tt class="docutils literal"><span class="pre">module.modulemap</span></tt>) alongside the headers they describe, which allows them to be added to existing software libraries without having to change the library headers themselves (in most cases <a class="footnote-reference" href="#id8" id="id3">[3]</a>). The actual <a class="reference internal" href="#module-map-language">Module map language</a> is described in a later section.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">To actually see any benefits from modules, one first has to introduce module maps for the underlying C standard library and the libraries and headers on which it depends. The section <a class="reference internal" href="#modularizing-a-platform">Modularizing a Platform</a> describes the steps one must take to write these module maps.</p>
+</div>
+<p>One can use module maps without modules to check the integrity of the use of header files. To do this, use the <tt class="docutils literal"><span class="pre">-fmodule-maps</span></tt> option instead of the <tt class="docutils literal"><span class="pre">-fmodules</span></tt> option.</p>
+</div>
+<div class="section" id="compilation-model">
+<h3><a class="toc-backref" href="#id19">Compilation model</a><a class="headerlink" href="#compilation-model" title="Permalink to this headline">¶</a></h3>
+<p>The binary representation of modules is automatically generated by the compiler on an as-needed basis. When a module is imported (e.g., by an <tt class="docutils literal"><span class="pre">#include</span></tt> of one of the module’s headers), the compiler will spawn a second instance of itself <a class="footnote-reference" href="#id9" id="id4">[4]</a>, with a fresh preprocessing context <a class="footnote-reference" href="#id10" id="id5">[5]</a>, to parse just the headers in that module. The resulting Abstract Syntax Tree (AST) is then persisted into the binary representation of the module that is then loaded into translation unit where the module import was encountered.</p>
+<p>The binary representation of modules is persisted in the <em>module cache</em>. Imports of a module will first query the module cache and, if a binary representation of the required module is already available, will load that representation directly. Thus, a module’s headers will only be parsed once per language configuration, rather than once per translation unit that uses the module.</p>
+<p>Modules maintain references to each of the headers that were part of the module build. If any of those headers changes, or if any of the modules on which a module depends change, then the module will be (automatically) recompiled. The process should never require any user intervention.</p>
+</div>
+<div class="section" id="command-line-parameters">
+<h3><a class="toc-backref" href="#id20">Command-line parameters</a><a class="headerlink" href="#command-line-parameters" title="Permalink to this headline">¶</a></h3>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">-fmodules</span></tt></dt>
+<dd>Enable the modules feature (EXPERIMENTAL).</dd>
+<dt><tt class="docutils literal"><span class="pre">-fcxx-modules</span></tt></dt>
+<dd>Enable the modules feature for C++ (EXPERIMENTAL and VERY BROKEN).</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodule-maps</span></tt></dt>
+<dd>Enable interpretation of module maps (EXPERIMENTAL). This option is implied by <tt class="docutils literal"><span class="pre">-fmodules</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-cache-path=<directory></span></tt></dt>
+<dd>Specify the path to the modules cache. If not provided, Clang will select a system-appropriate default.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fno-autolink</span></tt></dt>
+<dd>Disable automatic linking against the libraries associated with imported modules.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-ignore-macro=macroname</span></tt></dt>
+<dd>Instruct modules to ignore the named macro when selecting an appropriate module variant. Use this for macros defined on the command line that don’t affect how modules are built, to improve sharing of compiled module files.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-prune-interval=seconds</span></tt></dt>
+<dd>Specify the minimum delay (in seconds) between attempts to prune the module cache. Module cache pruning attempts to clear out old, unused module files so that the module cache itself does not grow without bound. The default delay is large (604,800 seconds, or 7 days) because this is an expensive operation. Set this value to 0 to turn off pruning.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-prune-after=seconds</span></tt></dt>
+<dd>Specify the minimum time (in seconds) for which a file in the module cache must be unused (according to access time) before module pruning will remove it. The default delay is large (2,678,400 seconds, or 31 days) to avoid excessive module rebuilding.</dd>
+<dt><tt class="docutils literal"><span class="pre">-module-file-info</span> <span class="pre"><module</span> <span class="pre">file</span> <span class="pre">name></span></tt></dt>
+<dd>Debugging aid that prints information about a given module file (with a <tt class="docutils literal"><span class="pre">.pcm</span></tt> extension), including the language and preprocessor options that particular module variant was built with.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-decluse</span></tt></dt>
+<dd>Enable checking of module <tt class="docutils literal"><span class="pre">use</span></tt> declarations.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodule-name=module-id</span></tt></dt>
+<dd>Consider a source file as a part of the given module.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodule-map-file=<file></span></tt></dt>
+<dd>Load the given module map file if a header from its directory or one of its subdirectories is loaded.</dd>
+<dt><tt class="docutils literal"><span class="pre">-fmodules-search-all</span></tt></dt>
+<dd>If a symbol is not found, search modules referenced in the current module maps but not imported for symbols, so the error message can reference the module by name.  Note that if the global module index has not been built before, this might take some time as it needs to build all the modules.  Note that this option doesn’t apply in module builds, to avoid the recursion.</dd>
+</dl>
+</div>
+</div>
+<div class="section" id="module-semantics">
+<h2><a class="toc-backref" href="#id21">Module Semantics</a><a class="headerlink" href="#module-semantics" title="Permalink to this headline">¶</a></h2>
+<p>Modules are modeled as if each submodule were a separate translation unit, and a module import makes names from the other translation unit visible. Each submodule starts with a new preprocessor state and an empty translation unit.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This behavior is currently only approximated when building a module. Entities within a submodule that has already been built are visible when building later submodules in that module. This can lead to fragile modules that depend on the build order used for the submodules of the module, and should not be relied upon.</p>
+</div>
+<p>As an example, in C, this implies that if two structs are defined in different submodules with the same name, those two types are distinct types (but may be <em>compatible</em> types if their definitions match. In C++, two structs defined with the same name in different submodules are the <em>same</em> type, and must be equivalent under C++’s One Definition Rule.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Clang currently only performs minimal checking for violations of the One Definition Rule.</p>
+</div>
+<div class="section" id="macros">
+<h3><a class="toc-backref" href="#id22">Macros</a><a class="headerlink" href="#macros" title="Permalink to this headline">¶</a></h3>
+<p>The C and C++ preprocessor assumes that the input text is a single linear buffer, but with modules this is not the case. It is possible to import two modules that have conflicting definitions for a macro (or where one <tt class="docutils literal"><span class="pre">#define</span></tt>s a macro and the other <tt class="docutils literal"><span class="pre">#undef</span></tt>ines it). The rules for handling macro definitions in the presence of modules are as follows:</p>
+<ul class="simple">
+<li>Each definition and undefinition of a macro is considered to be a distinct entity.</li>
+<li>Such entities are <em>visible</em> if they are from the current submodule or translation unit, or if they were exported from a submodule that has been imported.</li>
+<li>A <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">X</span></tt> or <tt class="docutils literal"><span class="pre">#undef</span> <span class="pre">X</span></tt> directive <em>overrides</em> all definitions of <tt class="docutils literal"><span class="pre">X</span></tt> that are visible at the point of the directive.</li>
+<li>A <tt class="docutils literal"><span class="pre">#define</span></tt> or <tt class="docutils literal"><span class="pre">#undef</span></tt> directive is <em>active</em> if it is visible and no visible directive overrides it.</li>
+<li>A set of macro directives is <em>consistent</em> if it consists of only <tt class="docutils literal"><span class="pre">#undef</span></tt> directives, or if all <tt class="docutils literal"><span class="pre">#define</span></tt> directives in the set define the macro name to the same sequence of tokens (following the usual rules for macro redefinitions).</li>
+<li>If a macro name is used and the set of active directives is not consistent, the program is ill-formed. Otherwise, the (unique) meaning of the macro name is used.</li>
+</ul>
+<p>For example, suppose:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre"><stdio.h></span></tt> defines a macro <tt class="docutils literal"><span class="pre">getc</span></tt> (and exports its <tt class="docutils literal"><span class="pre">#define</span></tt>)</li>
+<li><tt class="docutils literal"><span class="pre"><cstdio></span></tt> imports the <tt class="docutils literal"><span class="pre"><stdio.h></span></tt> module and undefines the macro (and exports its <tt class="docutils literal"><span class="pre">#undef</span></tt>)</li>
+</ul>
+<p>The <tt class="docutils literal"><span class="pre">#undef</span></tt> overrides the <tt class="docutils literal"><span class="pre">#define</span></tt>, and a source file that imports both modules <em>in any order</em> will not see <tt class="docutils literal"><span class="pre">getc</span></tt> defined as a macro.</p>
+</div>
+</div>
+<div class="section" id="module-map-language">
+<h2><a class="toc-backref" href="#id23">Module Map Language</a><a class="headerlink" href="#module-map-language" title="Permalink to this headline">¶</a></h2>
+<p>The module map language describes the mapping from header files to the
+logical structure of modules. To enable support for using a library as
+a module, one must write a <tt class="docutils literal"><span class="pre">module.modulemap</span></tt> file for that library. The
+<tt class="docutils literal"><span class="pre">module.modulemap</span></tt> file is placed alongside the header files themselves,
+and is written in the module map language described below.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">For compatibility with previous releases, if a module map file named
+<tt class="docutils literal"><span class="pre">module.modulemap</span></tt> is not found, Clang will also search for a file named
+<tt class="docutils literal"><span class="pre">module.map</span></tt>. This behavior is deprecated and we plan to eventually
+remove it.</p>
+</div>
+<p>As an example, the module map file for the C standard library might look a bit like this:</p>
+<div class="highlight-python"><pre>module std [system] [extern_c] {
+  module complex {
+    header "complex.h"
+    export *
+  }
+
+  module ctype {
+    header "ctype.h"
+    export *
+  }
+
+  module errno {
+    header "errno.h"
+    header "sys/errno.h"
+    export *
+  }
+
+  module fenv {
+    header "fenv.h"
+    export *
+  }
+
+  // ...more headers follow...
+}</pre>
+</div>
+<p>Here, the top-level module <tt class="docutils literal"><span class="pre">std</span></tt> encompasses the whole C standard library. It has a number of submodules containing different parts of the standard library: <tt class="docutils literal"><span class="pre">complex</span></tt> for complex numbers, <tt class="docutils literal"><span class="pre">ctype</span></tt> for character types, etc. Each submodule lists one of more headers that provide the contents for that submodule. Finally, the <tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt> command specifies that anything included by that submodule will be automatically re-exported.</p>
+<div class="section" id="lexical-structure">
+<h3><a class="toc-backref" href="#id24">Lexical structure</a><a class="headerlink" href="#lexical-structure" title="Permalink to this headline">¶</a></h3>
+<p>Module map files use a simplified form of the C99 lexer, with the same rules for identifiers, tokens, string literals, <tt class="docutils literal"><span class="pre">/*</span> <span class="pre">*/</span></tt> and <tt class="docutils literal"><span class="pre">//</span></tt> comments. The module map language has the following reserved words; all other C identifiers are valid identifiers.</p>
+<pre class="literal-block">
+<tt class="docutils literal"><span class="pre">config_macros</span></tt> <tt class="docutils literal"><span class="pre">export</span></tt>     <tt class="docutils literal"><span class="pre">module</span></tt>
+<tt class="docutils literal"><span class="pre">conflict</span></tt>      <tt class="docutils literal"><span class="pre">framework</span></tt>  <tt class="docutils literal"><span class="pre">requires</span></tt>
+<tt class="docutils literal"><span class="pre">exclude</span></tt>       <tt class="docutils literal"><span class="pre">header</span></tt>     <tt class="docutils literal"><span class="pre">private</span></tt>
+<tt class="docutils literal"><span class="pre">explicit</span></tt>      <tt class="docutils literal"><span class="pre">link</span></tt>       <tt class="docutils literal"><span class="pre">umbrella</span></tt>
+<tt class="docutils literal"><span class="pre">extern</span></tt>        <tt class="docutils literal"><span class="pre">use</span></tt>
+</pre>
+</div>
+<div class="section" id="module-map-file">
+<h3><a class="toc-backref" href="#id25">Module map file</a><a class="headerlink" href="#module-map-file" title="Permalink to this headline">¶</a></h3>
+<p>A module map file consists of a series of module declarations:</p>
+<pre class="literal-block">
+<em>module-map-file</em>:
+  <em>module-declaration*</em>
+</pre>
+<p>Within a module map file, modules are referred to by a <em>module-id</em>, which uses periods to separate each part of a module’s name:</p>
+<pre class="literal-block">
+<em>module-id</em>:
+  <em>identifier</em> ('.' <em>identifier</em>)*
+</pre>
+</div>
+<div class="section" id="module-declaration">
+<h3><a class="toc-backref" href="#id26">Module declaration</a><a class="headerlink" href="#module-declaration" title="Permalink to this headline">¶</a></h3>
+<p>A module declaration describes a module, including the headers that contribute to that module, its submodules, and other aspects of the module.</p>
+<pre class="literal-block">
+<em>module-declaration</em>:
+  <tt class="docutils literal"><span class="pre">explicit</span></tt><sub>opt</sub> <tt class="docutils literal"><span class="pre">framework</span></tt><sub>opt</sub> <tt class="docutils literal"><span class="pre">module</span></tt> <em>module-id</em> <em>attributes</em><sub>opt</sub> '{' <em>module-member*</em> '}'
+  <tt class="docutils literal"><span class="pre">extern</span></tt> <tt class="docutils literal"><span class="pre">module</span></tt> <em>module-id</em> <em>string-literal</em>
+</pre>
+<p>The <em>module-id</em> should consist of only a single <em>identifier</em>, which provides the name of the module being defined. Each module shall have a single definition.</p>
+<p>The <tt class="docutils literal"><span class="pre">explicit</span></tt> qualifier can only be applied to a submodule, i.e., a module that is nested within another module. The contents of explicit submodules are only made available when the submodule itself was explicitly named in an import declaration or was re-exported from an imported module.</p>
+<p>The <tt class="docutils literal"><span class="pre">framework</span></tt> qualifier specifies that this module corresponds to a Darwin-style framework. A Darwin-style framework (used primarily on Mac OS X and iOS) is contained entirely in directory <tt class="docutils literal"><span class="pre">Name.framework</span></tt>, where <tt class="docutils literal"><span class="pre">Name</span></tt> is the name of the framework (and, therefore, the name of the module). That directory has the following layout:</p>
+<div class="highlight-python"><pre>Name.framework/
+  Modules/module.modulemap  Module map for the framework
+  Headers/                  Subdirectory containing framework headers
+  Frameworks/               Subdirectory containing embedded frameworks
+  Resources/                Subdirectory containing additional resources
+  Name                      Symbolic link to the shared library for the framework</pre>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">system</span></tt> attribute specifies that the module is a system module. When a system module is rebuilt, all of the module’s headers will be considered system headers, which suppresses warnings. This is equivalent to placing <tt class="docutils literal"><span class="pre">#pragma</span> <span class="pre">GCC</span> <span class="pre">system_header</span></tt> in each of the module’s headers. The form of attributes is described in the section <a class="reference internal" href="#attributes">Attributes</a>, below.</p>
+<p>The <tt class="docutils literal"><span class="pre">extern_c</span></tt> attribute specifies that the module contains C code that can be used from within C++. When such a module is built for use in C++ code, all of the module’s headers will be treated as if they were contained within an implicit <tt class="docutils literal"><span class="pre">extern</span> <span class="pre">"C"</span></tt> block. An import for a module with this attribute can appear within an <tt class="docutils literal"><span class="pre">extern</span> <span class="pre">"C"</span></tt> block. No other restrictions are lifted, however: the module currently cannot be imported within an <tt class="docutils literal"><span class="pre">extern</span> <span class="pre">"C"</span></tt> block in a namespace.</p>
+<p>Modules can have a number of different kinds of members, each of which is described below:</p>
+<pre class="literal-block">
+<em>module-member</em>:
+  <em>requires-declaration</em>
+  <em>header-declaration</em>
+  <em>umbrella-dir-declaration</em>
+  <em>submodule-declaration</em>
+  <em>export-declaration</em>
+  <em>use-declaration</em>
+  <em>link-declaration</em>
+  <em>config-macros-declaration</em>
+  <em>conflict-declaration</em>
+</pre>
+<p>An extern module references a module defined by the <em>module-id</em> in a file given by the <em>string-literal</em>. The file can be referenced either by an absolute path or by a path relative to the current map file.</p>
+<div class="section" id="requires-declaration">
+<h4><a class="toc-backref" href="#id27">Requires declaration</a><a class="headerlink" href="#requires-declaration" title="Permalink to this headline">¶</a></h4>
+<p>A <em>requires-declaration</em> specifies the requirements that an importing translation unit must satisfy to use the module.</p>
+<pre class="literal-block">
+<em>requires-declaration</em>:
+  <tt class="docutils literal"><span class="pre">requires</span></tt> <em>feature-list</em>
+
+<em>feature-list</em>:
+  <em>feature</em> (',' <em>feature</em>)*
+
+<em>feature</em>:
+  <tt class="docutils literal"><span class="pre">!</span></tt><sub>opt</sub> <em>identifier</em>
+</pre>
+<p>The requirements clause allows specific modules or submodules to specify that they are only accessible with certain language dialects or on certain platforms. The feature list is a set of identifiers, defined below. If any of the features is not available in a given translation unit, that translation unit shall not import the module. The optional <tt class="docutils literal"><span class="pre">!</span></tt> indicates that a feature is incompatible with the module.</p>
+<p>The following features are defined:</p>
+<dl class="docutils">
+<dt>altivec</dt>
+<dd>The target supports AltiVec.</dd>
+<dt>blocks</dt>
+<dd>The “blocks” language feature is available.</dd>
+<dt>cplusplus</dt>
+<dd>C++ support is available.</dd>
+<dt>cplusplus11</dt>
+<dd>C++11 support is available.</dd>
+<dt>objc</dt>
+<dd>Objective-C support is available.</dd>
+<dt>objc_arc</dt>
+<dd>Objective-C Automatic Reference Counting (ARC) is available</dd>
+<dt>opencl</dt>
+<dd>OpenCL is available</dd>
+<dt>tls</dt>
+<dd>Thread local storage is available.</dd>
+<dt><em>target feature</em></dt>
+<dd>A specific target feature (e.g., <tt class="docutils literal"><span class="pre">sse4</span></tt>, <tt class="docutils literal"><span class="pre">avx</span></tt>, <tt class="docutils literal"><span class="pre">neon</span></tt>) is available.</dd>
+</dl>
+<p><strong>Example</strong>: The <tt class="docutils literal"><span class="pre">std</span></tt> module can be extended to also include C++ and C++11 headers using a <em>requires-declaration</em>:</p>
+<div class="highlight-python"><pre>module std {
+   // C standard library...
+
+   module vector {
+     requires cplusplus
+     header "vector"
+   }
+
+   module type_traits {
+     requires cplusplus11
+     header "type_traits"
+   }
+ }</pre>
+</div>
+</div>
+<div class="section" id="header-declaration">
+<h4><a class="toc-backref" href="#id28">Header declaration</a><a class="headerlink" href="#header-declaration" title="Permalink to this headline">¶</a></h4>
+<p>A header declaration specifies that a particular header is associated with the enclosing module.</p>
+<pre class="literal-block">
+<em>header-declaration</em>:
+  <tt class="docutils literal"><span class="pre">umbrella</span></tt><sub>opt</sub> <tt class="docutils literal"><span class="pre">header</span></tt> <em>string-literal</em>
+  <tt class="docutils literal"><span class="pre">private</span></tt> <tt class="docutils literal"><span class="pre">header</span></tt> <em>string-literal</em>
+  <tt class="docutils literal"><span class="pre">exclude</span></tt> <tt class="docutils literal"><span class="pre">header</span></tt> <em>string-literal</em>
+</pre>
+<p>A header declaration that does not contain <tt class="docutils literal"><span class="pre">exclude</span></tt> specifies a header that contributes to the enclosing module. Specifically, when the module is built, the named header will be parsed and its declarations will be (logically) placed into the enclosing submodule.</p>
+<p>A header with the <tt class="docutils literal"><span class="pre">umbrella</span></tt> specifier is called an umbrella header. An umbrella header includes all of the headers within its directory (and any subdirectories), and is typically used (in the <tt class="docutils literal"><span class="pre">#include</span></tt> world) to easily access the full API provided by a particular library. With modules, an umbrella header is a convenient shortcut that eliminates the need to write out <tt class="docutils literal"><span class="pre">header</span></tt> declarations for every library header. A given directory can only contain a single umbrella header.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Any headers not included by the umbrella header should have
+explicit <tt class="docutils literal"><span class="pre">header</span></tt> declarations. Use the
+<tt class="docutils literal"><span class="pre">-Wincomplete-umbrella</span></tt> warning option to ask Clang to complain
+about headers not covered by the umbrella header or the module map.</p>
+</div>
+<p>A header with the <tt class="docutils literal"><span class="pre">private</span></tt> specifier may not be included from outside the module itself.</p>
+<p>A header with the <tt class="docutils literal"><span class="pre">exclude</span></tt> specifier is excluded from the module. It will not be included when the module is built, nor will it be considered to be part of the module.</p>
+<p><strong>Example</strong>: The C header <tt class="docutils literal"><span class="pre">assert.h</span></tt> is an excellent candidate for an excluded header, because it is meant to be included multiple times (possibly with different <tt class="docutils literal"><span class="pre">NDEBUG</span></tt> settings).</p>
+<div class="highlight-python"><pre>module std [system] {
+  exclude header "assert.h"
+}</pre>
+</div>
+<p>A given header shall not be referenced by more than one <em>header-declaration</em>.</p>
+</div>
+<div class="section" id="umbrella-directory-declaration">
+<h4><a class="toc-backref" href="#id29">Umbrella directory declaration</a><a class="headerlink" href="#umbrella-directory-declaration" title="Permalink to this headline">¶</a></h4>
+<p>An umbrella directory declaration specifies that all of the headers in the specified directory should be included within the module.</p>
+<pre class="literal-block">
+<em>umbrella-dir-declaration</em>:
+  <tt class="docutils literal"><span class="pre">umbrella</span></tt> <em>string-literal</em>
+</pre>
+<p>The <em>string-literal</em> refers to a directory. When the module is built, all of the header files in that directory (and its subdirectories) are included in the module.</p>
+<p>An <em>umbrella-dir-declaration</em> shall not refer to the same directory as the location of an umbrella <em>header-declaration</em>. In other words, only a single kind of umbrella can be specified for a given directory.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Umbrella directories are useful for libraries that have a large number of headers but do not have an umbrella header.</p>
+</div>
+</div>
+<div class="section" id="submodule-declaration">
+<h4><a class="toc-backref" href="#id30">Submodule declaration</a><a class="headerlink" href="#submodule-declaration" title="Permalink to this headline">¶</a></h4>
+<p>Submodule declarations describe modules that are nested within their enclosing module.</p>
+<pre class="literal-block">
+<em>submodule-declaration</em>:
+  <em>module-declaration</em>
+  <em>inferred-submodule-declaration</em>
+</pre>
+<p>A <em>submodule-declaration</em> that is a <em>module-declaration</em> is a nested module. If the <em>module-declaration</em> has a <tt class="docutils literal"><span class="pre">framework</span></tt> specifier, the enclosing module shall have a <tt class="docutils literal"><span class="pre">framework</span></tt> specifier; the submodule’s contents shall be contained within the subdirectory <tt class="docutils literal"><span class="pre">Frameworks/SubName.framework</span></tt>, where <tt class="docutils literal"><span class="pre">SubName</span></tt> is the name of the submodule.</p>
+<p>A <em>submodule-declaration</em> that is an <em>inferred-submodule-declaration</em> describes a set of submodules that correspond to any headers that are part of the module but are not explicitly described by a <em>header-declaration</em>.</p>
+<pre class="literal-block">
+<em>inferred-submodule-declaration</em>:
+  <tt class="docutils literal"><span class="pre">explicit</span></tt><sub>opt</sub> <tt class="docutils literal"><span class="pre">framework</span></tt><sub>opt</sub> <tt class="docutils literal"><span class="pre">module</span></tt> '*' <em>attributes</em><sub>opt</sub> '{' <em>inferred-submodule-member*</em> '}'
+
+<em>inferred-submodule-member</em>:
+  <tt class="docutils literal"><span class="pre">export</span></tt> '*'
+</pre>
+<p>A module containing an <em>inferred-submodule-declaration</em> shall have either an umbrella header or an umbrella directory. The headers to which the <em>inferred-submodule-declaration</em> applies are exactly those headers included by the umbrella header (transitively) or included in the module because they reside within the umbrella directory (or its subdirectories).</p>
+<p>For each header included by the umbrella header or in the umbrella directory that is not named by a <em>header-declaration</em>, a module declaration is implicitly generated from the <em>inferred-submodule-declaration</em>. The module will:</p>
+<ul class="simple">
+<li>Have the same name as the header (without the file extension)</li>
+<li>Have the <tt class="docutils literal"><span class="pre">explicit</span></tt> specifier, if the <em>inferred-submodule-declaration</em> has the <tt class="docutils literal"><span class="pre">explicit</span></tt> specifier</li>
+<li>Have the <tt class="docutils literal"><span class="pre">framework</span></tt> specifier, if the
+<em>inferred-submodule-declaration</em> has the <tt class="docutils literal"><span class="pre">framework</span></tt> specifier</li>
+<li>Have the attributes specified by the <em>inferred-submodule-declaration</em></li>
+<li>Contain a single <em>header-declaration</em> naming that header</li>
+<li>Contain a single <em>export-declaration</em> <tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt>, if the <em>inferred-submodule-declaration</em> contains the <em>inferred-submodule-member</em> <tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt></li>
+</ul>
+<p><strong>Example</strong>: If the subdirectory “MyLib” contains the headers <tt class="docutils literal"><span class="pre">A.h</span></tt> and <tt class="docutils literal"><span class="pre">B.h</span></tt>, then the following module map:</p>
+<div class="highlight-python"><pre>module MyLib {
+  umbrella "MyLib"
+  explicit module * {
+    export *
+  }
+}</pre>
+</div>
+<p>is equivalent to the (more verbose) module map:</p>
+<div class="highlight-python"><pre>module MyLib {
+  explicit module A {
+    header "A.h"
+    export *
+  }
+
+  explicit module B {
+    header "B.h"
+    export *
+  }
+}</pre>
+</div>
+</div>
+<div class="section" id="export-declaration">
+<h4><a class="toc-backref" href="#id31">Export declaration</a><a class="headerlink" href="#export-declaration" title="Permalink to this headline">¶</a></h4>
+<p>An <em>export-declaration</em> specifies which imported modules will automatically be re-exported as part of a given module’s API.</p>
+<pre class="literal-block">
+<em>export-declaration</em>:
+  <tt class="docutils literal"><span class="pre">export</span></tt> <em>wildcard-module-id</em>
+
+<em>wildcard-module-id</em>:
+  <em>identifier</em>
+  '*'
+  <em>identifier</em> '.' <em>wildcard-module-id</em>
+</pre>
+<p>The <em>export-declaration</em> names a module or a set of modules that will be re-exported to any translation unit that imports the enclosing module. Each imported module that matches the <em>wildcard-module-id</em> up to, but not including, the first <tt class="docutils literal"><span class="pre">*</span></tt> will be re-exported.</p>
+<p><strong>Example</strong>:: In the following example, importing <tt class="docutils literal"><span class="pre">MyLib.Derived</span></tt> also provides the API for <tt class="docutils literal"><span class="pre">MyLib.Base</span></tt>:</p>
+<div class="highlight-python"><pre>module MyLib {
+  module Base {
+    header "Base.h"
+  }
+
+  module Derived {
+    header "Derived.h"
+    export Base
+  }
+}</pre>
+</div>
+<p>Note that, if <tt class="docutils literal"><span class="pre">Derived.h</span></tt> includes <tt class="docutils literal"><span class="pre">Base.h</span></tt>, one can simply use a wildcard export to re-export everything <tt class="docutils literal"><span class="pre">Derived.h</span></tt> includes:</p>
+<div class="highlight-python"><pre>module MyLib {
+  module Base {
+    header "Base.h"
+  }
+
+  module Derived {
+    header "Derived.h"
+    export *
+  }
+}</pre>
+</div>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">The wildcard export syntax <tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt> re-exports all of the
+modules that were imported in the actual header file. Because
+<tt class="docutils literal"><span class="pre">#include</span></tt> directives are automatically mapped to module imports,
+<tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt> provides the same transitive-inclusion behavior
+provided by the C preprocessor, e.g., importing a given module
+implicitly imports all of the modules on which it depends.
+Therefore, liberal use of <tt class="docutils literal"><span class="pre">export</span> <span class="pre">*</span></tt> provides excellent backward
+compatibility for programs that rely on transitive inclusion (i.e.,
+all of them).</p>
+</div>
+</div>
+<div class="section" id="use-declaration">
+<h4><a class="toc-backref" href="#id32">Use declaration</a><a class="headerlink" href="#use-declaration" title="Permalink to this headline">¶</a></h4>
+<p>A <em>use-declaration</em> specifies one of the other modules that the module is allowed to use. An import or include not matching one of these is rejected when the option <em>-fmodules-decluse</em>.</p>
+<pre class="literal-block">
+<em>use-declaration</em>:
+  <tt class="docutils literal"><span class="pre">use</span></tt> <em>module-id</em>
+</pre>
+<p><strong>Example</strong>:: In the following example, use of A from C is not declared, so will trigger a warning.</p>
+<div class="highlight-python"><pre>module A {
+  header "a.h"
+}
+
+module B {
+  header "b.h"
+}
+
+module C {
+  header "c.h"
+  use B
+}</pre>
+</div>
+<p>When compiling a source file that implements a module, use the option <tt class="docutils literal"><span class="pre">-fmodule-name=module-id</span></tt> to indicate that the source file is logically part of that module.</p>
+<p>The compiler at present only applies restrictions to the module directly being built.</p>
+</div>
+<div class="section" id="link-declaration">
+<h4><a class="toc-backref" href="#id33">Link declaration</a><a class="headerlink" href="#link-declaration" title="Permalink to this headline">¶</a></h4>
+<p>A <em>link-declaration</em> specifies a library or framework against which a program should be linked if the enclosing module is imported in any translation unit in that program.</p>
+<pre class="literal-block">
+<em>link-declaration</em>:
+  <tt class="docutils literal"><span class="pre">link</span></tt> <tt class="docutils literal"><span class="pre">framework</span></tt><sub>opt</sub> <em>string-literal</em>
+</pre>
+<p>The <em>string-literal</em> specifies the name of the library or framework against which the program should be linked. For example, specifying “clangBasic” would instruct the linker to link with <tt class="docutils literal"><span class="pre">-lclangBasic</span></tt> for a Unix-style linker.</p>
+<p>A <em>link-declaration</em> with the <tt class="docutils literal"><span class="pre">framework</span></tt> specifies that the linker should link against the named framework, e.g., with <tt class="docutils literal"><span class="pre">-framework</span> <span class="pre">MyFramework</span></tt>.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Automatic linking with the <tt class="docutils literal"><span class="pre">link</span></tt> directive is not yet widely
+implemented, because it requires support from both the object file
+format and the linker. The notion is similar to Microsoft Visual
+Studio’s <tt class="docutils literal"><span class="pre">#pragma</span> <span class="pre">comment(lib...)</span></tt>.</p>
+</div>
+</div>
+<div class="section" id="configuration-macros-declaration">
+<h4><a class="toc-backref" href="#id34">Configuration macros declaration</a><a class="headerlink" href="#configuration-macros-declaration" title="Permalink to this headline">¶</a></h4>
+<p>The <em>config-macros-declaration</em> specifies the set of configuration macros that have an effect on the the API of the enclosing module.</p>
+<pre class="literal-block">
+<em>config-macros-declaration</em>:
+  <tt class="docutils literal"><span class="pre">config_macros</span></tt> <em>attributes</em><sub>opt</sub> <em>config-macro-list</em><sub>opt</sub>
+
+<em>config-macro-list</em>:
+  <em>identifier</em> (',' <em>identifier</em>)*
+</pre>
+<p>Each <em>identifier</em> in the <em>config-macro-list</em> specifies the name of a macro. The compiler is required to maintain different variants of the given module for differing definitions of any of the named macros.</p>
+<p>A <em>config-macros-declaration</em> shall only be present on a top-level module, i.e., a module that is not nested within an enclosing module.</p>
+<p>The <tt class="docutils literal"><span class="pre">exhaustive</span></tt> attribute specifies that the list of macros in the <em>config-macros-declaration</em> is exhaustive, meaning that no other macro definition is intended to have an effect on the API of that module.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">The <tt class="docutils literal"><span class="pre">exhaustive</span></tt> attribute implies that any macro definitions
+for macros not listed as configuration macros should be ignored
+completely when building the module. As an optimization, the
+compiler could reduce the number of unique module variants by not
+considering these non-configuration macros. This optimization is not
+yet implemented in Clang.</p>
+</div>
+<p>A translation unit shall not import the same module under different definitions of the configuration macros.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Clang implements a weak form of this requirement: the definitions
+used for configuration macros are fixed based on the definitions
+provided by the command line. If an import occurs and the definition
+of any configuration macro has changed, the compiler will produce a
+warning (under the control of <tt class="docutils literal"><span class="pre">-Wconfig-macros</span></tt>).</p>
+</div>
+<p><strong>Example:</strong> A logging library might provide different API (e.g., in the form of different definitions for a logging macro) based on the <tt class="docutils literal"><span class="pre">NDEBUG</span></tt> macro setting:</p>
+<div class="highlight-python"><pre>module MyLogger {
+  umbrella header "MyLogger.h"
+  config_macros [exhaustive] NDEBUG
+}</pre>
+</div>
+</div>
+<div class="section" id="conflict-declarations">
+<h4><a class="toc-backref" href="#id35">Conflict declarations</a><a class="headerlink" href="#conflict-declarations" title="Permalink to this headline">¶</a></h4>
+<p>A <em>conflict-declaration</em> describes a case where the presence of two different modules in the same translation unit is likely to cause a problem. For example, two modules may provide similar-but-incompatible functionality.</p>
+<pre class="literal-block">
+<em>conflict-declaration</em>:
+  <tt class="docutils literal"><span class="pre">conflict</span></tt> <em>module-id</em> ',' <em>string-literal</em>
+</pre>
+<p>The <em>module-id</em> of the <em>conflict-declaration</em> specifies the module with which the enclosing module conflicts. The specified module shall not have been imported in the translation unit when the enclosing module is imported.</p>
+<p>The <em>string-literal</em> provides a message to be provided as part of the compiler diagnostic when two modules conflict.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Clang emits a warning (under the control of <tt class="docutils literal"><span class="pre">-Wmodule-conflict</span></tt>)
+when a module conflict is discovered.</p>
+</div>
+<p><strong>Example:</strong></p>
+<div class="highlight-python"><pre>module Conflicts {
+  explicit module A {
+    header "conflict_a.h"
+    conflict B, "we just don't like B"
+  }
+
+  module B {
+    header "conflict_b.h"
+  }
+}</pre>
+</div>
+</div>
+</div>
+<div class="section" id="attributes">
+<h3><a class="toc-backref" href="#id36">Attributes</a><a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h3>
+<p>Attributes are used in a number of places in the grammar to describe specific behavior of other declarations. The format of attributes is fairly simple.</p>
+<pre class="literal-block">
+<em>attributes</em>:
+  <em>attribute</em> <em>attributes</em><sub>opt</sub>
+
+<em>attribute</em>:
+  '[' <em>identifier</em> ']'
+</pre>
+<p>Any <em>identifier</em> can be used as an attribute, and each declaration specifies what attributes can be applied to it.</p>
+</div>
+<div class="section" id="private-module-map-files">
+<h3><a class="toc-backref" href="#id37">Private Module Map Files</a><a class="headerlink" href="#private-module-map-files" title="Permalink to this headline">¶</a></h3>
+<p>Module map files are typically named <tt class="docutils literal"><span class="pre">module.modulemap</span></tt> and live
+either alongside the headers they describe or in a parent directory of
+the headers they describe. These module maps typically describe all of
+the API for the library.</p>
+<p>However, in some cases, the presence or absence of particular headers
+is used to distinguish between the “public” and “private” APIs of a
+particular library. For example, a library may contain the headers
+<tt class="docutils literal"><span class="pre">Foo.h</span></tt> and <tt class="docutils literal"><span class="pre">Foo_Private.h</span></tt>, providing public and private APIs,
+respectively. Additionally, <tt class="docutils literal"><span class="pre">Foo_Private.h</span></tt> may only be available on
+some versions of library, and absent in others. One cannot easily
+express this with a single module map file in the library:</p>
+<div class="highlight-python"><pre>module Foo {
+  header "Foo.h"
+
+  explicit module Private {
+    header "Foo_Private.h"
+  }
+}</pre>
+</div>
+<p>because the header <tt class="docutils literal"><span class="pre">Foo_Private.h</span></tt> won’t always be available. The
+module map file could be customized based on whether
+<tt class="docutils literal"><span class="pre">Foo_Private.h</span></tt> is available or not, but doing so requires custom
+build machinery.</p>
+<p>Private module map files, which are named <tt class="docutils literal"><span class="pre">module.private.modulemap</span></tt>
+(or, for backward compatibility, <tt class="docutils literal"><span class="pre">module_private.map</span></tt>), allow one to
+augment the primary module map file with an additional submodule. For
+example, we would split the module map file above into two module map
+files:</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="cm">/* module.modulemap */</span>
+<span class="n">module</span> <span class="n">Foo</span> <span class="p">{</span>
+  <span class="n">header</span> <span class="s">"Foo.h"</span>
+<span class="p">}</span>
+
+<span class="cm">/* module.private.modulemap */</span>
+<span class="n">explicit</span> <span class="n">module</span> <span class="n">Foo</span><span class="p">.</span><span class="n">Private</span> <span class="p">{</span>
+  <span class="n">header</span> <span class="s">"Foo_Private.h"</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>When a <tt class="docutils literal"><span class="pre">module.private.modulemap</span></tt> file is found alongside a
+<tt class="docutils literal"><span class="pre">module.modulemap</span></tt> file, it is loaded after the <tt class="docutils literal"><span class="pre">module.modulemap</span></tt>
+file. In our example library, the <tt class="docutils literal"><span class="pre">module.private.modulemap</span></tt> file
+would be available when <tt class="docutils literal"><span class="pre">Foo_Private.h</span></tt> is available, making it
+easier to split a library’s public and private APIs along header
+boundaries.</p>
+</div>
+</div>
+<div class="section" id="modularizing-a-platform">
+<h2><a class="toc-backref" href="#id38">Modularizing a Platform</a><a class="headerlink" href="#modularizing-a-platform" title="Permalink to this headline">¶</a></h2>
+<p>To get any benefit out of modules, one needs to introduce module maps for software libraries starting at the bottom of the stack. This typically means introducing a module map covering the operating system’s headers and the C standard library headers (in <tt class="docutils literal"><span class="pre">/usr/include</span></tt>, for a Unix system).</p>
+<p>The module maps will be written using the <a class="reference internal" href="#module-map-language">module map language</a>, which provides the tools necessary to describe the mapping between headers and modules. Because the set of headers differs from one system to the next, the module map will likely have to be somewhat customized for, e.g., a particular distribution and version of the operating system. Moreover, the system headers themselves may require some modification, if they exhibit any anti-patterns that break modules. Such common patterns are described below.</p>
+<dl class="docutils">
+<dt><strong>Macro-guarded copy-and-pasted definitions</strong></dt>
+<dd><p class="first">System headers vend core types such as <tt class="docutils literal"><span class="pre">size_t</span></tt> for users. These types are often needed in a number of system headers, and are almost trivial to write. Hence, it is fairly common to see a definition such as the following copy-and-pasted throughout the headers:</p>
+<div class="highlight-python"><pre>#ifndef _SIZE_T
+#define _SIZE_T
+typedef __SIZE_TYPE__ size_t;
+#endif</pre>
+</div>
+<p class="last">Unfortunately, when modules compiles all of the C library headers together into a single module, only the first actual type definition of <tt class="docutils literal"><span class="pre">size_t</span></tt> will be visible, and then only in the submodule corresponding to the lucky first header. Any other headers that have copy-and-pasted versions of this pattern will <em>not</em> have a definition of <tt class="docutils literal"><span class="pre">size_t</span></tt>. Importing the submodule corresponding to one of those headers will therefore not yield <tt class="docutils literal"><span class="pre">size_t</span></tt> as part of the API, because it wasn’t there when the header was parsed. The fix for this problem is either to pull the copied declarations into a common header that gets included everywhere <tt class="docutils literal"><span class="pre">size_t</span></tt> is part of the API, or to eliminate the <tt class="docutils literal"><span class="pre">#ifndef</span></tt> and redefine the <tt class="docutils literal"><span class="pre">size_t</span></tt> type. The latter works for C++ headers and C11, but will cause an error for non-modules C90/C99, where redefinition of <tt class="docutils literal"><span class="pre">typedefs</span></tt> is not permitted.</p>
+</dd>
+<dt><strong>Conflicting definitions</strong></dt>
+<dd>Different system headers may provide conflicting definitions for various macros, functions, or types. These conflicting definitions don’t tend to cause problems in a pre-modules world unless someone happens to include both headers in one translation unit. Since the fix is often simply “don’t do that”, such problems persist. Modules requires that the conflicting definitions be eliminated or that they be placed in separate modules (the former is generally the better answer).</dd>
+<dt><strong>Missing includes</strong></dt>
+<dd>Headers are often missing <tt class="docutils literal"><span class="pre">#include</span></tt> directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don’t happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.</dd>
+<dt><strong>Headers that vend multiple APIs at different times</strong></dt>
+<dd>Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend <tt class="docutils literal"><span class="pre">size_t</span></tt> only when the macro <tt class="docutils literal"><span class="pre">__need_size_t</span></tt> is defined before that header is included, and also vend <tt class="docutils literal"><span class="pre">wchar_t</span></tt> only when the macro <tt class="docutils literal"><span class="pre">__need_wchar_t</span></tt> is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply <tt class="docutils literal"><span class="pre">exclude</span></tt> it in the module map.</dd>
+</dl>
+<p>To detect and help address some of these problems, the <tt class="docutils literal"><span class="pre">clang-tools-extra</span></tt> repository contains a <tt class="docutils literal"><span class="pre">modularize</span></tt> tool that parses a set of given headers and attempts to detect these problems and produce a report. See the tool’s in-source documentation for information on how to check your system or library headers.</p>
+</div>
+<div class="section" id="future-directions">
+<h2><a class="toc-backref" href="#id39">Future Directions</a><a class="headerlink" href="#future-directions" title="Permalink to this headline">¶</a></h2>
+<p>Modules is an experimental feature, and there is much work left to do to make it both real and useful. Here are a few ideas:</p>
+<dl class="docutils">
+<dt><strong>Detect unused module imports</strong></dt>
+<dd>Unlike with <tt class="docutils literal"><span class="pre">#include</span></tt> directives, it should be fairly simple to track whether a directly-imported module has ever been used. By doing so, Clang can emit <tt class="docutils literal"><span class="pre">unused</span> <span class="pre">import</span></tt> or <tt class="docutils literal"><span class="pre">unused</span> <span class="pre">#include</span></tt> diagnostics, including Fix-Its to remove the useless imports/includes.</dd>
+<dt><strong>Fix-Its for missing imports</strong></dt>
+<dd>It’s fairly common for one to make use of some API while writing code, only to get a compiler error about “unknown type” or “no function named” because the corresponding header has not been included. Clang should detect such cases and auto-import the required module (with a Fix-It!).</dd>
+<dt><strong>Improve modularize</strong></dt>
+<dd>The modularize tool is both extremely important (for deployment) and extremely crude. It needs better UI, better detection of problems (especially for C++), and perhaps an assistant mode to help write module maps for you.</dd>
+<dt><strong>C++ Support</strong></dt>
+<dd>Modules clearly has to work for C++, or we’ll never get to use it for the Clang code base.</dd>
+</dl>
+</div>
+<div class="section" id="where-to-learn-more-about-modules">
+<h2><a class="toc-backref" href="#id40">Where To Learn More About Modules</a><a class="headerlink" href="#where-to-learn-more-about-modules" title="Permalink to this headline">¶</a></h2>
+<p>The Clang source code provides additional information about modules:</p>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">clang/lib/Headers/module.modulemap</span></tt></dt>
+<dd>Module map for Clang’s compiler-specific header files.</dd>
+<dt><tt class="docutils literal"><span class="pre">clang/test/Modules/</span></tt></dt>
+<dd>Tests specifically related to modules functionality.</dd>
+<dt><tt class="docutils literal"><span class="pre">clang/include/clang/Basic/Module.h</span></tt></dt>
+<dd>The <tt class="docutils literal"><span class="pre">Module</span></tt> class in this header describes a module, and is used throughout the compiler to implement modules.</dd>
+<dt><tt class="docutils literal"><span class="pre">clang/include/clang/Lex/ModuleMap.h</span></tt></dt>
+<dd>The <tt class="docutils literal"><span class="pre">ModuleMap</span></tt> class in this header describes the full module map, consisting of all of the module map files that have been parsed, and providing facilities for looking up module maps and mapping between modules and headers (in both directions).</dd>
+<dt><a class="reference external" href="PCHInternals.html">PCHInternals</a></dt>
+<dd>Information about the serialized AST format used for precompiled headers and modules. The actual implementation is in the <tt class="docutils literal"><span class="pre">clangSerialization</span></tt> library.</dd>
+</dl>
+<table class="docutils footnote" frame="void" id="id6" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>Automatic linking against the libraries of modules requires specific linker support, which is not widely available.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id7" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>Modules are only available in C and Objective-C; a separate flag <tt class="docutils literal"><span class="pre">-fcxx-modules</span></tt> enables modules support for C++, which is even more experimental and broken.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id8" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id3">[3]</a></td><td>There are certain anti-patterns that occur in headers, particularly system headers, that cause problems for modules. The section <a class="reference internal" href="#modularizing-a-platform">Modularizing a Platform</a> describes some of them.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id9" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id4">[4]</a></td><td>The second instance is actually a new thread within the current process, not a separate process. However, the original compiler instance is blocked on the execution of this thread.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id10" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id5">[5]</a></td><td>The preprocessing context in which the modules are parsed is actually dependent on the command-line options provided to the compiler, including the language dialect and any <tt class="docutils literal"><span class="pre">-D</span></tt> options. However, the compiled modules for different command-line options are kept distinct, and any preprocessor directives that occur within the translation unit are ignored. See the section on the <a class="reference internal" href="#configuration-macros-declaration">Configuration macros declaration</a> for more information.</td></tr>
+</tbody>
+</table>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        «  <a href="SanitizerSpecialCaseList.html">Sanitizer special case list</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="MSVCCompatibility.html">MSVC compatibility</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer">
+        © Copyright 2007-2014, The Clang Team.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file






More information about the llvm-commits mailing list