[www-releases] r349965 - Add 7.0.1 docs for clang, llvm, and lld

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 21 13:53:04 PST 2018


Added: www-releases/trunk/7.0.1/docs/GettingStarted.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/GettingStarted.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/GettingStarted.html (added)
+++ www-releases/trunk/7.0.1/docs/GettingStarted.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,1370 @@
+
+
+<!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>Getting Started with the LLVM System — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="Getting Started with the LLVM System using Microsoft Visual Studio" href="GettingStartedVS.html" />
+    <link rel="prev" title="llvm-readobj - LLVM Object Reader" href="CommandGuide/llvm-readobj.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="GettingStartedVS.html" title="Getting Started with the LLVM System using Microsoft Visual Studio"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="CommandGuide/llvm-readobj.html" title="llvm-readobj - LLVM Object Reader"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="getting-started-with-the-llvm-system">
+<h1>Getting Started with the LLVM System<a class="headerlink" href="#getting-started-with-the-llvm-system" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#overview" id="id4">Overview</a></li>
+<li><a class="reference internal" href="#getting-started-quickly-a-summary" id="id5">Getting Started Quickly (A Summary)</a></li>
+<li><a class="reference internal" href="#requirements" id="id6">Requirements</a><ul>
+<li><a class="reference internal" href="#hardware" id="id7">Hardware</a></li>
+<li><a class="reference internal" href="#software" id="id8">Software</a></li>
+<li><a class="reference internal" href="#host-c-toolchain-both-compiler-and-standard-library" id="id9">Host C++ Toolchain, both Compiler and Standard Library</a><ul>
+<li><a class="reference internal" href="#getting-a-modern-host-c-toolchain" id="id10">Getting a Modern Host C++ Toolchain</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference internal" href="#getting-started-with-llvm" id="id11">Getting Started with LLVM</a><ul>
+<li><a class="reference internal" href="#terminology-and-notation" id="id12">Terminology and Notation</a></li>
+<li><a class="reference internal" href="#unpacking-the-llvm-archives" id="id13">Unpacking the LLVM Archives</a></li>
+<li><a class="reference internal" href="#checkout-llvm-from-subversion" id="id14">Checkout LLVM from Subversion</a></li>
+<li><a class="reference internal" href="#git-mirror" id="id15">Git Mirror</a><ul>
+<li><a class="reference internal" href="#sending-patches-with-git" id="id16">Sending patches with Git</a></li>
+<li><a class="reference internal" href="#for-developers-to-work-with-git-svn" id="id17">For developers to work with git-svn</a></li>
+<li><a class="reference internal" href="#for-developers-to-work-with-a-git-monorepo" id="id18">For developers to work with a git monorepo</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#local-llvm-configuration" id="id19">Local LLVM Configuration</a></li>
+<li><a class="reference internal" href="#compiling-the-llvm-suite-source-code" id="id20">Compiling the LLVM Suite Source Code</a></li>
+<li><a class="reference internal" href="#cross-compiling-llvm" id="id21">Cross-Compiling LLVM</a></li>
+<li><a class="reference internal" href="#the-location-of-llvm-object-files" id="id22">The Location of LLVM Object Files</a></li>
+<li><a class="reference internal" href="#optional-configuration-items" id="id23">Optional Configuration Items</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#directory-layout" id="id24">Directory Layout</a><ul>
+<li><a class="reference internal" href="#llvm-examples" id="id25"><tt class="docutils literal"><span class="pre">llvm/examples</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-include" id="id26"><tt class="docutils literal"><span class="pre">llvm/include</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-lib" id="id27"><tt class="docutils literal"><span class="pre">llvm/lib</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-projects" id="id28"><tt class="docutils literal"><span class="pre">llvm/projects</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-test" id="id29"><tt class="docutils literal"><span class="pre">llvm/test</span></tt></a></li>
+<li><a class="reference internal" href="#test-suite" id="id30"><tt class="docutils literal"><span class="pre">test-suite</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-tools" id="id31"><tt class="docutils literal"><span class="pre">llvm/tools</span></tt></a></li>
+<li><a class="reference internal" href="#llvm-utils" id="id32"><tt class="docutils literal"><span class="pre">llvm/utils</span></tt></a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#an-example-using-the-llvm-tool-chain" id="id33">An Example Using the LLVM Tool Chain</a><ul>
+<li><a class="reference internal" href="#example-with-clang" id="id34">Example with clang</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#common-problems" id="id35">Common Problems</a></li>
+<li><a class="reference internal" href="#links" id="id36">Links</a></li>
+</ul>
+</div>
+<div class="section" id="overview">
+<h2><a class="toc-backref" href="#id4">Overview</a><a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to LLVM! In order to get started, you first need to know some basic
+information.</p>
+<p>First, LLVM comes in three pieces. The first piece is the LLVM suite. This
+contains all of the tools, libraries, and header files needed to use LLVM.  It
+contains an assembler, disassembler, bitcode analyzer and bitcode optimizer.  It
+also contains basic regression tests that can be used to test the LLVM tools and
+the Clang front end.</p>
+<p>The second piece is the <a class="reference external" href="http://clang.llvm.org/">Clang</a> front end.  This
+component compiles C, C++, Objective C, and Objective C++ code into LLVM
+bitcode. Once compiled into LLVM bitcode, a program can be manipulated with the
+LLVM tools from the LLVM suite.</p>
+<p>There is a third, optional piece called Test Suite.  It is a suite of programs
+with a testing harness that can be used to further test LLVM’s functionality
+and performance.</p>
+</div>
+<div class="section" id="getting-started-quickly-a-summary">
+<h2><a class="toc-backref" href="#id5">Getting Started Quickly (A Summary)</a><a class="headerlink" href="#getting-started-quickly-a-summary" title="Permalink to this headline">¶</a></h2>
+<p>The LLVM Getting Started documentation may be out of date.  So, the <a class="reference external" href="http://clang.llvm.org/get_started.html">Clang
+Getting Started</a> page might also be a
+good place to start.</p>
+<p>Here’s the short story for getting up and running quickly with LLVM:</p>
+<ol class="arabic">
+<li><p class="first">Read the documentation.</p>
+</li>
+<li><p class="first">Read the documentation.</p>
+</li>
+<li><p class="first">Remember that you were warned twice about reading the documentation.</p>
+<ul class="simple">
+<li>In particular, the <em>relative paths specified are important</em>.</li>
+</ul>
+</li>
+<li><p class="first">Checkout LLVM:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</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/llvm/trunk</span> <span class="pre">llvm</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout Clang:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/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/cfe/trunk</span> <span class="pre">clang</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout Extra Clang Tools <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<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><p class="first">Checkout LLD linker <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/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/lld/trunk</span> <span class="pre">lld</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout Polly Loop Optimizer <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/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/polly/trunk</span> <span class="pre">polly</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout Compiler-RT (required to build the sanitizers) <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/projects</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/compiler-rt/trunk</span> <span class="pre">compiler-rt</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout Libomp (required for OpenMP support) <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/projects</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/openmp/trunk</span> <span class="pre">openmp</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Checkout libcxx and libcxxabi <strong>[Optional]</strong>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/projects</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/libcxx/trunk</span> <span class="pre">libcxx</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/libcxxabi/trunk</span> <span class="pre">libcxxabi</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Get the Test Suite Source Code <strong>[Optional]</strong></p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm/projects</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/test-suite/trunk</span> <span class="pre">test-suite</span></tt></li>
+</ul>
+</li>
+<li><p class="first">Configure and build LLVM and Clang:</p>
+<p><em>Warning:</em> Make sure you’ve checked out <em>all of</em> the source code
+before trying to configure with cmake.  cmake does not pickup newly
+added source directories in incremental builds.</p>
+<p>The build uses <a class="reference external" href="CMake.html">CMake</a>. LLVM requires CMake 3.4.3 to build. It
+is generally recommended to use a recent CMake, especially if you’re
+generating Ninja build files. This is because the CMake project is constantly
+improving the quality of the generators, and the Ninja generator gets a lot
+of attention.</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where</span> <span class="pre">you</span> <span class="pre">want</span> <span class="pre">to</span> <span class="pre">build</span> <span class="pre">llvm</span></tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">mkdir</span> <span class="pre">build</span></tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">build</span></tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">cmake</span> <span class="pre">-G</span> <span class="pre"><generator></span> <span class="pre">[options]</span> <span class="pre"><path</span> <span class="pre">to</span> <span class="pre">llvm</span> <span class="pre">sources></span></tt></p>
+<p>Some common generators are:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">Unix</span> <span class="pre">Makefiles</span></tt> — for generating make-compatible parallel makefiles.</li>
+<li><tt class="docutils literal"><span class="pre">Ninja</span></tt> — for generating <a class="reference external" href="https://ninja-build.org">Ninja</a>
+build files. Most llvm developers use Ninja.</li>
+<li><tt class="docutils literal"><span class="pre">Visual</span> <span class="pre">Studio</span></tt> — for generating Visual Studio projects and
+solutions.</li>
+<li><tt class="docutils literal"><span class="pre">Xcode</span></tt> — for generating Xcode projects.</li>
+</ul>
+<p>Some Common options:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX=directory</span></tt> — Specify for <em>directory</em> the full
+pathname of where you want the LLVM tools and libraries to be installed
+(default <tt class="docutils literal"><span class="pre">/usr/local</span></tt>).</li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_BUILD_TYPE=type</span></tt> — Valid options for <em>type</em> are Debug,
+Release, RelWithDebInfo, and MinSizeRel. Default is Debug.</li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_ENABLE_ASSERTIONS=On</span></tt> — Compile with assertion checks enabled
+(default is Yes for Debug builds, No for all other build types).</li>
+</ul>
+</li>
+<li><p class="first">Run your build tool of choice!</p>
+<ul class="simple">
+<li>The default target (i.e. <tt class="docutils literal"><span class="pre">make</span></tt>) will build all of LLVM</li>
+<li>The <tt class="docutils literal"><span class="pre">check-all</span></tt> target (i.e. <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check-all</span></tt>) will run the
+regression tests to ensure everything is in working order.</li>
+<li>CMake will generate build targets for each tool and library, and most
+LLVM sub-projects generate their own <tt class="docutils literal"><span class="pre">check-<project></span></tt> target.</li>
+<li>Running a serial build will be <em>slow</em>.  Make sure you run a
+parallel build; for <tt class="docutils literal"><span class="pre">make</span></tt>, use <tt class="docutils literal"><span class="pre">make</span> <span class="pre">-j</span></tt>.</li>
+</ul>
+</li>
+<li><p class="first">For more information see <a class="reference external" href="CMake.html">CMake</a></p>
+</li>
+<li><p class="first">If you get an “internal compiler error (ICE)” or test failures, see
+<a class="reference internal" href="#below">below</a>.</p>
+</li>
+</ul>
+</li>
+</ol>
+<p>Consult the <a class="reference internal" href="#getting-started-with-llvm">Getting Started with LLVM</a> section for detailed information on
+configuring and compiling LLVM.  Go to <a class="reference internal" href="#directory-layout">Directory Layout</a> to learn about the
+layout of the source code tree.</p>
+</div>
+<div class="section" id="requirements">
+<h2><a class="toc-backref" href="#id6">Requirements</a><a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
+<p>Before you begin to use the LLVM system, review the requirements given below.
+This may save you some trouble by knowing ahead of time what hardware and
+software you will need.</p>
+<div class="section" id="hardware">
+<h3><a class="toc-backref" href="#id7">Hardware</a><a class="headerlink" href="#hardware" title="Permalink to this headline">¶</a></h3>
+<p>LLVM is known to work on the following host platforms:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="35%" />
+<col width="40%" />
+<col width="25%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">OS</th>
+<th class="head">Arch</th>
+<th class="head">Compilers</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>Linux</td>
+<td>x86<sup>1</sup></td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-odd"><td>Linux</td>
+<td>amd64</td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-even"><td>Linux</td>
+<td>ARM<sup>4</sup></td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-odd"><td>Linux</td>
+<td>PowerPC</td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-even"><td>Solaris</td>
+<td>V9 (Ultrasparc)</td>
+<td>GCC</td>
+</tr>
+<tr class="row-odd"><td>FreeBSD</td>
+<td>x86<sup>1</sup></td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-even"><td>FreeBSD</td>
+<td>amd64</td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-odd"><td>NetBSD</td>
+<td>x86<sup>1</sup></td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-even"><td>NetBSD</td>
+<td>amd64</td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-odd"><td>MacOS X<sup>2</sup></td>
+<td>PowerPC</td>
+<td>GCC</td>
+</tr>
+<tr class="row-even"><td>MacOS X</td>
+<td>x86</td>
+<td>GCC, Clang</td>
+</tr>
+<tr class="row-odd"><td>Cygwin/Win32</td>
+<td>x86<sup>1, 3</sup></td>
+<td>GCC</td>
+</tr>
+<tr class="row-even"><td>Windows</td>
+<td>x86<sup>1</sup></td>
+<td>Visual Studio</td>
+</tr>
+<tr class="row-odd"><td>Windows x64</td>
+<td>x86-64</td>
+<td>Visual Studio</td>
+</tr>
+</tbody>
+</table>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<ol class="last arabic simple">
+<li>Code generation supported for Pentium processors and up</li>
+<li>Code generation supported for 32-bit ABI only</li>
+<li>To use LLVM modules on Win32-based system, you may configure LLVM
+with <tt class="docutils literal"><span class="pre">-DBUILD_SHARED_LIBS=On</span></tt>.</li>
+<li>MCJIT not working well pre-v7, old JIT engine not supported any more.</li>
+</ol>
+</div>
+<p>Note that Debug builds require a lot of time and disk space.  An LLVM-only build
+will need about 1-3 GB of space.  A full build of LLVM and Clang will need around
+15-20 GB of disk space.  The exact space requirements will vary by system.  (It
+is so large because of all the debugging information and the fact that the
+libraries are statically linked into multiple tools).</p>
+<p>If you are space-constrained, you can build only selected tools or only
+selected targets.  The Release build requires considerably less space.</p>
+<p>The LLVM suite <em>may</em> compile on other platforms, but it is not guaranteed to do
+so.  If compilation is successful, the LLVM utilities should be able to
+assemble, disassemble, analyze, and optimize LLVM bitcode.  Code generation
+should work as well, although the generated native code may not work on your
+platform.</p>
+</div>
+<div class="section" id="software">
+<h3><a class="toc-backref" href="#id8">Software</a><a class="headerlink" href="#software" title="Permalink to this headline">¶</a></h3>
+<p>Compiling LLVM requires that you have several software packages installed. The
+table below lists those required packages. The Package column is the usual name
+for the software package that LLVM depends on. The Version column provides
+“known to work” versions of the package. The Notes column describes how LLVM
+uses the package and provides other details.</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="52%" />
+<col width="11%" />
+<col width="37%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Package</th>
+<th class="head">Version</th>
+<th class="head">Notes</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td><a class="reference external" href="http://savannah.gnu.org/projects/make">GNU Make</a></td>
+<td>3.79, 3.79.1</td>
+<td>Makefile/build processor</td>
+</tr>
+<tr class="row-odd"><td><a class="reference external" href="http://gcc.gnu.org/">GCC</a></td>
+<td>>=4.8.0</td>
+<td>C/C++ compiler<sup>1</sup></td>
+</tr>
+<tr class="row-even"><td><a class="reference external" href="http://www.python.org/">python</a></td>
+<td>>=2.7</td>
+<td>Automated test suite<sup>2</sup></td>
+</tr>
+<tr class="row-odd"><td><a class="reference external" href="http://zlib.net">zlib</a></td>
+<td>>=1.2.3.4</td>
+<td>Compression library<sup>3</sup></td>
+</tr>
+</tbody>
+</table>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<ol class="last arabic simple">
+<li>Only the C and C++ languages are needed so there’s no need to build the
+other languages for LLVM’s purposes. See <cite>below</cite> for specific version
+info.</li>
+<li>Only needed if you want to run the automated test suite in the
+<tt class="docutils literal"><span class="pre">llvm/test</span></tt> directory.</li>
+<li>Optional, adds compression / uncompression capabilities to selected LLVM
+tools.</li>
+</ol>
+</div>
+<p>Additionally, your compilation host is expected to have the usual plethora of
+Unix utilities. Specifically:</p>
+<ul class="simple">
+<li><strong>ar</strong> — archive library builder</li>
+<li><strong>bzip2</strong> — bzip2 command for distribution generation</li>
+<li><strong>bunzip2</strong> — bunzip2 command for distribution checking</li>
+<li><strong>chmod</strong> — change permissions on a file</li>
+<li><strong>cat</strong> — output concatenation utility</li>
+<li><strong>cp</strong> — copy files</li>
+<li><strong>date</strong> — print the current date/time</li>
+<li><strong>echo</strong> — print to standard output</li>
+<li><strong>egrep</strong> — extended regular expression search utility</li>
+<li><strong>find</strong> — find files/dirs in a file system</li>
+<li><strong>grep</strong> — regular expression search utility</li>
+<li><strong>gzip</strong> — gzip command for distribution generation</li>
+<li><strong>gunzip</strong> — gunzip command for distribution checking</li>
+<li><strong>install</strong> — install directories/files</li>
+<li><strong>mkdir</strong> — create a directory</li>
+<li><strong>mv</strong> — move (rename) files</li>
+<li><strong>ranlib</strong> — symbol table builder for archive libraries</li>
+<li><strong>rm</strong> — remove (delete) files and directories</li>
+<li><strong>sed</strong> — stream editor for transforming output</li>
+<li><strong>sh</strong> — Bourne shell for make build scripts</li>
+<li><strong>tar</strong> — tape archive for distribution generation</li>
+<li><strong>test</strong> — test things in file system</li>
+<li><strong>unzip</strong> — unzip command for distribution checking</li>
+<li><strong>zip</strong> — zip command for distribution generation</li>
+</ul>
+</div>
+<div class="section" id="host-c-toolchain-both-compiler-and-standard-library">
+<span id="check-here"></span><span id="below"></span><h3><a class="toc-backref" href="#id9">Host C++ Toolchain, both Compiler and Standard Library</a><a class="headerlink" href="#host-c-toolchain-both-compiler-and-standard-library" title="Permalink to this headline">¶</a></h3>
+<p>LLVM is very demanding of the host C++ compiler, and as such tends to expose
+bugs in the compiler. We are also planning to follow improvements and
+developments in the C++ language and library reasonably closely. As such, we
+require a modern host C++ toolchain, both compiler and standard library, in
+order to build LLVM.</p>
+<p>For the most popular host toolchains we check for specific minimum versions in
+our build systems:</p>
+<ul class="simple">
+<li>Clang 3.1</li>
+<li>GCC 4.8</li>
+<li>Visual Studio 2015 (Update 3)</li>
+</ul>
+<p>Anything older than these toolchains <em>may</em> work, but will require forcing the
+build system with a special option and is not really a supported host platform.
+Also note that older versions of these compilers have often crashed or
+miscompiled LLVM.</p>
+<p>For less widely used host toolchains such as ICC or xlC, be aware that a very
+recent version may be required to support all of the C++ features used in LLVM.</p>
+<p>We track certain versions of software that are <em>known</em> to fail when used as
+part of the host toolchain. These even include linkers at times.</p>
+<p><strong>GNU ld 2.16.X</strong>. Some 2.16.X versions of the ld linker will produce very long
+warning messages complaining that some “<tt class="docutils literal"><span class="pre">.gnu.linkonce.t.*</span></tt>” symbol was
+defined in a discarded section. You can safely ignore these messages as they are
+erroneous and the linkage is correct.  These messages disappear using ld 2.17.</p>
+<p><strong>GNU binutils 2.17</strong>: Binutils 2.17 contains <a class="reference external" href="http://sourceware.org/bugzilla/show_bug.cgi?id=3111">a bug</a> which causes huge link
+times (minutes instead of seconds) when building LLVM.  We recommend upgrading
+to a newer version (2.17.50.0.4 or later).</p>
+<p><strong>GNU Binutils 2.19.1 Gold</strong>: This version of Gold contained <a class="reference external" href="http://sourceware.org/bugzilla/show_bug.cgi?id=9836">a bug</a> which causes
+intermittent failures when building LLVM with position independent code.  The
+symptom is an error about cyclic dependencies.  We recommend upgrading to a
+newer version of Gold.</p>
+<div class="section" id="getting-a-modern-host-c-toolchain">
+<h4><a class="toc-backref" href="#id10">Getting a Modern Host C++ Toolchain</a><a class="headerlink" href="#getting-a-modern-host-c-toolchain" title="Permalink to this headline">¶</a></h4>
+<p>This section mostly applies to Linux and older BSDs. On Mac OS X, you should
+have a sufficiently modern Xcode, or you will likely need to upgrade until you
+do. Windows does not have a “system compiler”, so you must install either Visual
+Studio 2015 or a recent version of mingw64. FreeBSD 10.0 and newer have a modern
+Clang as the system compiler.</p>
+<p>However, some Linux distributions and some other or older BSDs sometimes have
+extremely old versions of GCC. These steps attempt to help you upgrade you
+compiler even on such a system. However, if at all possible, we encourage you
+to use a recent version of a distribution with a modern system compiler that
+meets these requirements. Note that it is tempting to install a prior
+version of Clang and libc++ to be the host compiler, however libc++ was not
+well tested or set up to build on Linux until relatively recently. As
+a consequence, this guide suggests just using libstdc++ and a modern GCC as the
+initial host in a bootstrap, and then using Clang (and potentially libc++).</p>
+<p>The first step is to get a recent GCC toolchain installed. The most common
+distribution on which users have struggled with the version requirements is
+Ubuntu Precise, 12.04 LTS. For this distribution, one easy option is to install
+the <a class="reference external" href="https://launchpad.net/~ubuntu-toolchain-r/+archive/test">toolchain testing PPA</a> and use it to install a modern GCC. There is
+a really nice discussions of this on the <a class="reference external" href="http://askubuntu.com/questions/271388/how-to-install-gcc-4-8-in-ubuntu-12-04-from-the-terminal">ask ubuntu stack exchange</a>. However,
+not all users can use PPAs and there are many other distributions, so it may be
+necessary (or just useful, if you’re here you <em>are</em> doing compiler development
+after all) to build and install GCC from source. It is also quite easy to do
+these days.</p>
+<p>Easy steps for installing GCC 4.8.2:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
+<span class="gp">%</span> wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2.sig
+<span class="gp">%</span> wget https://ftp.gnu.org/gnu/gnu-keyring.gpg
+<span class="gp">%</span> <span class="nv">signature_invalid</span><span class="o">=</span><span class="sb">`</span>gpg --verify --no-default-keyring --keyring ./gnu-keyring.gpg gcc-4.8.2.tar.bz2.sig<span class="sb">`</span>
+<span class="gp">%</span> <span class="k">if</span> <span class="o">[</span> <span class="nv">$signature_invalid</span> <span class="o">]</span>; <span class="k">then </span><span class="nb">echo</span> <span class="s2">"Invalid signature"</span> ; <span class="nb">exit </span>1 ; <span class="k">fi</span>
+<span class="gp">%</span><span class="k"> </span>tar -xvjf gcc-4.8.2.tar.bz2
+<span class="gp">%</span> <span class="nb">cd </span>gcc-4.8.2
+<span class="gp">%</span> ./contrib/download_prerequisites
+<span class="gp">%</span> <span class="nb">cd</span> ..
+<span class="gp">%</span> mkdir gcc-4.8.2-build
+<span class="gp">%</span> <span class="nb">cd </span>gcc-4.8.2-build
+<span class="gp">%</span> <span class="nv">$PWD</span>/../gcc-4.8.2/configure --prefix<span class="o">=</span><span class="nv">$HOME</span>/toolchains --enable-languages<span class="o">=</span>c,c++
+<span class="gp">%</span> make -j<span class="k">$(</span>nproc<span class="k">)</span>
+<span class="gp">%</span> make install
+</pre></div>
+</div>
+<p>For more details, check out the excellent <a class="reference external" href="http://gcc.gnu.org/wiki/InstallingGCC">GCC wiki entry</a>, where I got most
+of this information from.</p>
+<p>Once you have a GCC toolchain, configure your build of LLVM to use the new
+toolchain for your host compiler and C++ standard library. Because the new
+version of libstdc++ is not on the system library search path, you need to pass
+extra linker flags so that it can be found at link time (<tt class="docutils literal"><span class="pre">-L</span></tt>) and at runtime
+(<tt class="docutils literal"><span class="pre">-rpath</span></tt>). If you are using CMake, this invocation should produce working
+binaries:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> mkdir build
+<span class="gp">%</span> <span class="nb">cd </span>build
+<span class="gp">%</span> <span class="nv">CC</span><span class="o">=</span><span class="nv">$HOME</span>/toolchains/bin/gcc <span class="nv">CXX</span><span class="o">=</span><span class="nv">$HOME</span>/toolchains/bin/g++ <span class="se">\</span>
+<span class="go">  cmake .. -DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$HOME/toolchains/lib64 -L$HOME/toolchains/lib64"</span>
+</pre></div>
+</div>
+<p>If you fail to set rpath, most LLVM binaries will fail on startup with a message
+from the loader similar to <tt class="docutils literal"><span class="pre">libstdc++.so.6:</span> <span class="pre">version</span> <span class="pre">`GLIBCXX_3.4.20'</span> <span class="pre">not</span>
+<span class="pre">found</span></tt>. This means you need to tweak the -rpath linker flag.</p>
+<p>When you build Clang, you will need to give <em>it</em> access to modern C++11
+standard library in order to use it as your new host in part of a bootstrap.
+There are two easy ways to do this, either build (and install) libc++ along
+with Clang and then use it with the <tt class="docutils literal"><span class="pre">-stdlib=libc++</span></tt> compile and link flag,
+or install Clang into the same prefix (<tt class="docutils literal"><span class="pre">$HOME/toolchains</span></tt> above) as GCC.
+Clang will look within its own prefix for libstdc++ and use it if found. You
+can also add an explicit prefix for Clang to look in for a GCC toolchain with
+the <tt class="docutils literal"><span class="pre">--gcc-toolchain=/opt/my/gcc/prefix</span></tt> flag, passing it to both compile and
+link commands when using your just-built-Clang to bootstrap.</p>
+</div>
+</div>
+</div>
+<div class="section" id="getting-started-with-llvm">
+<span id="id2"></span><h2><a class="toc-backref" href="#id11">Getting Started with LLVM</a><a class="headerlink" href="#getting-started-with-llvm" title="Permalink to this headline">¶</a></h2>
+<p>The remainder of this guide is meant to get you up and running with LLVM and to
+give you some basic information about the LLVM environment.</p>
+<p>The later sections of this guide describe the <a class="reference internal" href="#general-layout">general layout</a> of the LLVM
+source tree, a <a class="reference internal" href="#simple-example">simple example</a> using the LLVM tool chain, and <a class="reference internal" href="#links">links</a> to find
+more information about LLVM or to get help via e-mail.</p>
+<div class="section" id="terminology-and-notation">
+<h3><a class="toc-backref" href="#id12">Terminology and Notation</a><a class="headerlink" href="#terminology-and-notation" title="Permalink to this headline">¶</a></h3>
+<p>Throughout this manual, the following names are used to denote paths specific to
+the local system and working environment.  <em>These are not environment variables
+you need to set but just strings used in the rest of this document below</em>.  In
+any of the examples below, simply replace each of these names with the
+appropriate pathname on your local system.  All these paths are absolute:</p>
+<p><tt class="docutils literal"><span class="pre">SRC_ROOT</span></tt></p>
+<blockquote>
+<div>This is the top level directory of the LLVM source tree.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">OBJ_ROOT</span></tt></p>
+<blockquote>
+<div>This is the top level directory of the LLVM object tree (i.e. the tree where
+object files and compiled programs will be placed.  It can be the same as
+SRC_ROOT).</div></blockquote>
+</div>
+<div class="section" id="unpacking-the-llvm-archives">
+<h3><a class="toc-backref" href="#id13">Unpacking the LLVM Archives</a><a class="headerlink" href="#unpacking-the-llvm-archives" title="Permalink to this headline">¶</a></h3>
+<p>If you have the LLVM distribution, you will need to unpack it before you can
+begin to compile it.  LLVM is distributed as a set of two files: the LLVM suite
+and the LLVM GCC front end compiled for your platform.  There is an additional
+test suite that is optional.  Each file is a TAR archive that is compressed with
+the gzip program.</p>
+<p>The files are as follows, with <em>x.y</em> marking the version number:</p>
+<p><tt class="docutils literal"><span class="pre">llvm-x.y.tar.gz</span></tt></p>
+<blockquote>
+<div>Source release for the LLVM libraries and tools.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm-test-x.y.tar.gz</span></tt></p>
+<blockquote>
+<div>Source release for the LLVM test-suite.</div></blockquote>
+</div>
+<div class="section" id="checkout-llvm-from-subversion">
+<span id="checkout"></span><h3><a class="toc-backref" href="#id14">Checkout LLVM from Subversion</a><a class="headerlink" href="#checkout-llvm-from-subversion" title="Permalink to this headline">¶</a></h3>
+<p>If you have access to our Subversion repository, you can get a fresh copy of the
+entire source code.  All you need to do is check it out from Subversion as
+follows:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">where-you-want-llvm-to-live</span></tt></li>
+<li>Read-Only: <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">co</span> <span class="pre">http://llvm.org/svn/llvm-project/llvm/trunk</span> <span class="pre">llvm</span></tt></li>
+<li>Read-Write: <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">co</span> <span class="pre">https://user@llvm.org/svn/llvm-project/llvm/trunk</span> <span class="pre">llvm</span></tt></li>
+</ul>
+<p>This will create an ‘<tt class="docutils literal"><span class="pre">llvm</span></tt>‘ directory in the current directory and fully
+populate it with the LLVM source code, Makefiles, test directories, and local
+copies of documentation files.</p>
+<p>If you want to get a specific release (as opposed to the most recent revision),
+you can check it out from the ‘<tt class="docutils literal"><span class="pre">tags</span></tt>‘ directory (instead of ‘<tt class="docutils literal"><span class="pre">trunk</span></tt>‘). The
+following releases are located in the following subdirectories of the ‘<tt class="docutils literal"><span class="pre">tags</span></tt>‘
+directory:</p>
+<ul class="simple">
+<li>Release 3.5.0 and later: <strong>RELEASE_350/final</strong> and so on</li>
+<li>Release 2.9 through 3.4: <strong>RELEASE_29/final</strong> and so on</li>
+<li>Release 1.1 through 2.8: <strong>RELEASE_11</strong> and so on</li>
+<li>Release 1.0: <strong>RELEASE_1</strong></li>
+</ul>
+<p>If you would like to get the LLVM test suite (a separate package as of 1.4), you
+get it from the Subversion repository:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/projects
+<span class="gp">%</span> svn co http://llvm.org/svn/llvm-project/test-suite/trunk <span class="nb">test</span>-suite
+</pre></div>
+</div>
+<p>By placing it in the <tt class="docutils literal"><span class="pre">llvm/projects</span></tt>, it will be automatically configured by
+the LLVM cmake configuration.</p>
+</div>
+<div class="section" id="git-mirror">
+<h3><a class="toc-backref" href="#id15">Git Mirror</a><a class="headerlink" href="#git-mirror" title="Permalink to this headline">¶</a></h3>
+<p>Git mirrors are available for a number of LLVM subprojects. These mirrors sync
+automatically with each Subversion commit and contain all necessary git-svn
+marks (so, you can recreate git-svn metadata locally). Note that right now
+mirrors reflect only <tt class="docutils literal"><span class="pre">trunk</span></tt> for each project.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">On Windows, first you will want to do <tt class="docutils literal"><span class="pre">git</span> <span class="pre">config</span> <span class="pre">--global</span> <span class="pre">core.autocrlf</span>
+<span class="pre">false</span></tt> before you clone. This goes a long way toward ensuring that
+line-endings will be handled correctly (the LLVM project mostly uses Linux
+line-endings).</p>
+</div>
+<p>You can do the read-only Git clone of LLVM via:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git clone https://git.llvm.org/git/llvm.git/
+</pre></div>
+</div>
+<p>If you want to check out clang too, run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/tools
+<span class="gp">%</span> git clone https://git.llvm.org/git/clang.git/
+</pre></div>
+</div>
+<p>If you want to check out compiler-rt (required to build the sanitizers), run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/projects
+<span class="gp">%</span> git clone https://git.llvm.org/git/compiler-rt.git/
+</pre></div>
+</div>
+<p>If you want to check out libomp (required for OpenMP support), run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/projects
+<span class="gp">%</span> git clone https://git.llvm.org/git/openmp.git/
+</pre></div>
+</div>
+<p>If you want to check out libcxx and libcxxabi (optional), run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/projects
+<span class="gp">%</span> git clone https://git.llvm.org/git/libcxx.git/
+<span class="gp">%</span> git clone https://git.llvm.org/git/libcxxabi.git/
+</pre></div>
+</div>
+<p>If you want to check out the Test Suite Source Code (optional), run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm/projects
+<span class="gp">%</span> git clone https://git.llvm.org/git/test-suite.git/
+</pre></div>
+</div>
+<p>Since the upstream repository is in Subversion, you should use <tt class="docutils literal"><span class="pre">git</span>
+<span class="pre">pull</span> <span class="pre">--rebase</span></tt> instead of <tt class="docutils literal"><span class="pre">git</span> <span class="pre">pull</span></tt> to avoid generating a non-linear history
+in your clone.  To configure <tt class="docutils literal"><span class="pre">git</span> <span class="pre">pull</span></tt> to pass <tt class="docutils literal"><span class="pre">--rebase</span></tt> by default on the
+master branch, run the following command:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git config branch.master.rebase <span class="nb">true</span>
+</pre></div>
+</div>
+<div class="section" id="sending-patches-with-git">
+<h4><a class="toc-backref" href="#id16">Sending patches with Git</a><a class="headerlink" href="#sending-patches-with-git" title="Permalink to this headline">¶</a></h4>
+<p>Please read <a class="reference external" href="DeveloperPolicy.html#one-off-patches">Developer Policy</a>, too.</p>
+<p>Assume <tt class="docutils literal"><span class="pre">master</span></tt> points the upstream and <tt class="docutils literal"><span class="pre">mybranch</span></tt> points your working
+branch, and <tt class="docutils literal"><span class="pre">mybranch</span></tt> is rebased onto <tt class="docutils literal"><span class="pre">master</span></tt>.  At first you may check
+sanity of whitespaces:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git diff --check master..mybranch
+</pre></div>
+</div>
+<p>The easiest way to generate a patch is as below:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git diff master..mybranch > /path/to/mybranch.diff
+</pre></div>
+</div>
+<p>It is a little different from svn-generated diff. git-diff-generated diff has
+prefixes like <tt class="docutils literal"><span class="pre">a/</span></tt> and <tt class="docutils literal"><span class="pre">b/</span></tt>. Don’t worry, most developers might know it
+could be accepted with <tt class="docutils literal"><span class="pre">patch</span> <span class="pre">-p1</span> <span class="pre">-N</span></tt>.</p>
+<p>But you may generate patchset with git-format-patch. It generates by-each-commit
+patchset. To generate patch files to attach to your article:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git format-patch --no-attach master..mybranch -o /path/to/your/patchset
+</pre></div>
+</div>
+<p>If you would like to send patches directly, you may use git-send-email or
+git-imap-send. Here is an example to generate the patchset in Gmail’s [Drafts].</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git format-patch --attach master..mybranch --stdout | git imap-send
+</pre></div>
+</div>
+<p>Then, your .git/config should have [imap] sections.</p>
+<div class="highlight-ini"><div class="highlight"><pre><span class="k">[imap]</span>
+      <span class="na">host</span> <span class="o">=</span> <span class="s">imaps://imap.gmail.com</span>
+<span class="s">      user = your.gmail.account at gmail.com</span>
+<span class="s">      pass = himitsu!</span>
+<span class="s">      port = 993</span>
+<span class="s">      sslverify = false</span>
+<span class="c">; in English</span>
+      <span class="na">folder</span> <span class="o">=</span> <span class="s">"[Gmail]/Drafts"</span>
+<span class="c">; example for Japanese, "Modified UTF-7" encoded.</span>
+      <span class="na">folder</span> <span class="o">=</span> <span class="s">"[Gmail]/&Tgtm+DBN-"</span>
+<span class="c">; example for Traditional Chinese</span>
+      <span class="na">folder</span> <span class="o">=</span> <span class="s">"[Gmail]/&g0l6Pw-"</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="for-developers-to-work-with-git-svn">
+<span id="developers-work-with-git-svn"></span><h4><a class="toc-backref" href="#id17">For developers to work with git-svn</a><a class="headerlink" href="#for-developers-to-work-with-git-svn" title="Permalink to this headline">¶</a></h4>
+<p>To set up clone from which you can submit code using <tt class="docutils literal"><span class="pre">git-svn</span></tt>, run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git clone https://git.llvm.org/git/llvm.git/
+<span class="gp">%</span> <span class="nb">cd </span>llvm
+<span class="gp">%</span> git svn init https://llvm.org/svn/llvm-project/llvm/trunk --username<span class="o">=</span><username>
+<span class="gp">%</span> git config svn-remote.svn.fetch :refs/remotes/origin/master
+<span class="gp">%</span> git svn rebase -l  <span class="c"># -l avoids fetching ahead of the git mirror.</span>
+
+<span class="gp">#</span> If you have clang too:
+<span class="gp">%</span> <span class="nb">cd </span>tools
+<span class="gp">%</span> git clone https://git.llvm.org/git/clang.git/
+<span class="gp">%</span> <span class="nb">cd </span>clang
+<span class="gp">%</span> git svn init https://llvm.org/svn/llvm-project/cfe/trunk --username<span class="o">=</span><username>
+<span class="gp">%</span> git config svn-remote.svn.fetch :refs/remotes/origin/master
+<span class="gp">%</span> git svn rebase -l
+</pre></div>
+</div>
+<p>Likewise for compiler-rt, libomp and test-suite.</p>
+<p>To update this clone without generating git-svn tags that conflict with the
+upstream Git repo, run:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git fetch <span class="o">&&</span> <span class="o">(</span><span class="nb">cd </span>tools/clang <span class="o">&&</span> git fetch<span class="o">)</span>  <span class="c"># Get matching revisions of both trees.</span>
+<span class="gp">%</span> git checkout master
+<span class="gp">%</span> git svn rebase -l
+<span class="gp">%</span> <span class="o">(</span><span class="nb">cd </span>tools/clang <span class="o">&&</span>
+<span class="go">   git checkout master &&</span>
+<span class="go">   git svn rebase -l)</span>
+</pre></div>
+</div>
+<p>Likewise for compiler-rt, libomp and test-suite.</p>
+<p>This leaves your working directories on their master branches, so you’ll need to
+<tt class="docutils literal"><span class="pre">checkout</span></tt> each working branch individually and <tt class="docutils literal"><span class="pre">rebase</span></tt> it on top of its
+parent branch.</p>
+<p>For those who wish to be able to update an llvm repo/revert patches easily using
+git-svn, please look in the directory for the scripts <tt class="docutils literal"><span class="pre">git-svnup</span></tt> and
+<tt class="docutils literal"><span class="pre">git-svnrevert</span></tt>.</p>
+<p>To perform the aforementioned update steps go into your source directory and
+just type <tt class="docutils literal"><span class="pre">git-svnup</span></tt> or <tt class="docutils literal"><span class="pre">git</span> <span class="pre">svnup</span></tt> and everything will just work.</p>
+<p>If one wishes to revert a commit with git-svn, but do not want the git hash to
+escape into the commit message, one can use the script <tt class="docutils literal"><span class="pre">git-svnrevert</span></tt> or
+<tt class="docutils literal"><span class="pre">git</span> <span class="pre">svnrevert</span></tt> which will take in the git hash for the commit you want to
+revert, look up the appropriate svn revision, and output a message where all
+references to the git hash have been replaced with the svn revision.</p>
+<p>To commit back changes via git-svn, use <tt class="docutils literal"><span class="pre">git</span> <span class="pre">svn</span> <span class="pre">dcommit</span></tt>:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git svn dcommit
+</pre></div>
+</div>
+<p>Note that git-svn will create one SVN commit for each Git commit you have pending,
+so squash and edit each commit before executing <tt class="docutils literal"><span class="pre">dcommit</span></tt> to make sure they all
+conform to the coding standards and the developers’ policy.</p>
+<p>On success, <tt class="docutils literal"><span class="pre">dcommit</span></tt> will rebase against the HEAD of SVN, so to avoid conflict,
+please make sure your current branch is up-to-date (via fetch/rebase) before
+proceeding.</p>
+<p>The git-svn metadata can get out of sync after you mess around with branches and
+<tt class="docutils literal"><span class="pre">dcommit</span></tt>. When that happens, <tt class="docutils literal"><span class="pre">git</span> <span class="pre">svn</span> <span class="pre">dcommit</span></tt> stops working, complaining
+about files with uncommitted changes. The fix is to rebuild the metadata:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> rm -rf .git/svn
+<span class="gp">%</span> git svn rebase -l
+</pre></div>
+</div>
+<p>Please, refer to the Git-SVN manual (<tt class="docutils literal"><span class="pre">man</span> <span class="pre">git-svn</span></tt>) for more information.</p>
+</div>
+<div class="section" id="for-developers-to-work-with-a-git-monorepo">
+<h4><a class="toc-backref" href="#id18">For developers to work with a git monorepo</a><a class="headerlink" href="#for-developers-to-work-with-a-git-monorepo" title="Permalink to this headline">¶</a></h4>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This set-up is using an unofficial mirror hosted on GitHub, use with caution.</p>
+</div>
+<p>To set up a clone of all the llvm projects using a unified repository:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">export </span><span class="nv">TOP_LEVEL_DIR</span><span class="o">=</span><span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span>
+<span class="gp">%</span> git clone https://github.com/llvm-project/llvm-project-20170507/ llvm-project
+<span class="gp">%</span> <span class="nb">cd </span>llvm-project
+<span class="gp">%</span> git config branch.master.rebase <span class="nb">true</span>
+</pre></div>
+</div>
+<p>You can configure various build directory from this clone, starting with a build
+of LLVM alone:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd</span> <span class="nv">$TOP_LEVEL_DIR</span>
+<span class="gp">%</span> mkdir llvm-build <span class="o">&&</span> <span class="nb">cd </span>llvm-build
+<span class="gp">%</span> cmake -GNinja ../llvm-project/llvm
+</pre></div>
+</div>
+<p>Or lldb:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd</span> <span class="nv">$TOP_LEVEL_DIR</span>
+<span class="gp">%</span> mkdir lldb-build <span class="o">&&</span> <span class="nb">cd </span>lldb-build
+<span class="gp">%</span> cmake -GNinja ../llvm-project/llvm -DLLVM_ENABLE_PROJECTS<span class="o">=</span>lldb
+</pre></div>
+</div>
+<p>Or a combination of multiple projects:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd</span> <span class="nv">$TOP_LEVEL_DIR</span>
+<span class="gp">%</span> mkdir clang-build <span class="o">&&</span> <span class="nb">cd </span>clang-build
+<span class="gp">%</span> cmake -GNinja ../llvm-project/llvm -DLLVM_ENABLE_PROJECTS<span class="o">=</span><span class="s2">"clang;libcxx;libcxxabi"</span>
+</pre></div>
+</div>
+<p>A helper script is provided in <tt class="docutils literal"><span class="pre">llvm/utils/git-svn/git-llvm</span></tt>. After you add it
+to your path, you can push committed changes upstream with <tt class="docutils literal"><span class="pre">git</span> <span class="pre">llvm</span> <span class="pre">push</span></tt>.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:<span class="nv">$TOP_LEVEL_DIR</span>/llvm-project/llvm/utils/git-svn/
+<span class="gp">%</span> git llvm push
+</pre></div>
+</div>
+<p>While this is using SVN under the hood, it does not require any interaction from
+you with git-svn.
+After a few minutes, <tt class="docutils literal"><span class="pre">git</span> <span class="pre">pull</span></tt> should get back the changes as they were
+committed. Note that a current limitation is that <tt class="docutils literal"><span class="pre">git</span></tt> does not directly
+record file rename, and thus it is propagated to SVN as a combination of
+delete-add instead of a file rename.</p>
+<p>The SVN revision of each monorepo commit can be found in the commit notes.  git
+does not fetch notes by default. The following commands will fetch the notes and
+configure git to fetch future notes. Use <tt class="docutils literal"><span class="pre">git</span> <span class="pre">notes</span> <span class="pre">show</span> <span class="pre">$commit</span></tt> to look up
+the SVN revision of a git commit. The notes show up <tt class="docutils literal"><span class="pre">git</span> <span class="pre">log</span></tt>, and searching
+the log is currently the recommended way to look up the git commit for a given
+SVN revision.</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> git config --add remote.origin.fetch +refs/notes/commits:refs/notes/commits
+<span class="gp">%</span> git fetch
+</pre></div>
+</div>
+<p>If you are using <cite>arc</cite> to interact with Phabricator, you need to manually put it
+at the root of the checkout:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd</span> <span class="nv">$TOP_LEVEL_DIR</span>
+<span class="gp">%</span> cp llvm/.arcconfig ./
+<span class="gp">%</span> mkdir -p .git/info/
+<span class="gp">%</span> <span class="nb">echo</span> .arcconfig >> .git/info/exclude
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="local-llvm-configuration">
+<h3><a class="toc-backref" href="#id19">Local LLVM Configuration</a><a class="headerlink" href="#local-llvm-configuration" title="Permalink to this headline">¶</a></h3>
+<p>Once checked out from the Subversion repository, the LLVM suite source code must
+be configured before being built. This process uses CMake.
+Unlinke the normal <tt class="docutils literal"><span class="pre">configure</span></tt> script, CMake
+generates the build files in whatever format you request as well as various
+<tt class="docutils literal"><span class="pre">*.inc</span></tt> files, and <tt class="docutils literal"><span class="pre">llvm/include/Config/config.h</span></tt>.</p>
+<p>Variables are passed to <tt class="docutils literal"><span class="pre">cmake</span></tt> on the command line using the format
+<tt class="docutils literal"><span class="pre">-D<variable</span> <span class="pre">name>=<value></span></tt>. The following variables are some common options
+used by people developing LLVM.</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="32%" />
+<col width="68%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Variable</th>
+<th class="head">Purpose</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>CMAKE_C_COMPILER</td>
+<td>Tells <tt class="docutils literal"><span class="pre">cmake</span></tt> which C compiler to use. By
+default, this will be /usr/bin/cc.</td>
+</tr>
+<tr class="row-odd"><td>CMAKE_CXX_COMPILER</td>
+<td>Tells <tt class="docutils literal"><span class="pre">cmake</span></tt> which C++ compiler to use. By
+default, this will be /usr/bin/c++.</td>
+</tr>
+<tr class="row-even"><td>CMAKE_BUILD_TYPE</td>
+<td>Tells <tt class="docutils literal"><span class="pre">cmake</span></tt> what type of build you are trying
+to generate files for. Valid options are Debug,
+Release, RelWithDebInfo, and MinSizeRel. Default
+is Debug.</td>
+</tr>
+<tr class="row-odd"><td>CMAKE_INSTALL_PREFIX</td>
+<td>Specifies the install directory to target when
+running the install action of the build files.</td>
+</tr>
+<tr class="row-even"><td>LLVM_TARGETS_TO_BUILD</td>
+<td>A semicolon delimited list controlling which
+targets will be built and linked into llc. This is
+equivalent to the <tt class="docutils literal"><span class="pre">--enable-targets</span></tt> option in
+the configure script. The default list is defined
+as <tt class="docutils literal"><span class="pre">LLVM_ALL_TARGETS</span></tt>, and can be set to include
+out-of-tree targets. The default value includes:
+<tt class="docutils literal"><span class="pre">AArch64,</span> <span class="pre">AMDGPU,</span> <span class="pre">ARM,</span> <span class="pre">BPF,</span> <span class="pre">Hexagon,</span> <span class="pre">Mips,</span>
+<span class="pre">MSP430,</span> <span class="pre">NVPTX,</span> <span class="pre">PowerPC,</span> <span class="pre">Sparc,</span> <span class="pre">SystemZ,</span> <span class="pre">X86,</span>
+<span class="pre">XCore</span></tt>.</td>
+</tr>
+<tr class="row-odd"><td>LLVM_ENABLE_DOXYGEN</td>
+<td>Build doxygen-based documentation from the source
+code This is disabled by default because it is
+slow and generates a lot of output.</td>
+</tr>
+<tr class="row-even"><td>LLVM_ENABLE_SPHINX</td>
+<td>Build sphinx-based documentation from the source
+code. This is disabled by default because it is
+slow and generates a lot of output. Sphinx version
+1.5 or later recommended.</td>
+</tr>
+<tr class="row-odd"><td>LLVM_BUILD_LLVM_DYLIB</td>
+<td>Generate libLLVM.so. This library contains a
+default set of LLVM components that can be
+overridden with <tt class="docutils literal"><span class="pre">LLVM_DYLIB_COMPONENTS</span></tt>. The
+default contains most of LLVM and is defined in
+<tt class="docutils literal"><span class="pre">tools/llvm-shlib/CMakelists.txt</span></tt>.</td>
+</tr>
+<tr class="row-even"><td>LLVM_OPTIMIZED_TABLEGEN</td>
+<td>Builds a release tablegen that gets used during
+the LLVM build. This can dramatically speed up
+debug builds.</td>
+</tr>
+</tbody>
+</table>
+<p>To configure LLVM, follow these steps:</p>
+<ol class="arabic">
+<li><p class="first">Change directory into the object root directory:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>OBJ_ROOT
+</pre></div>
+</div>
+</li>
+<li><p class="first">Run the <tt class="docutils literal"><span class="pre">cmake</span></tt>:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cmake -G <span class="s2">"Unix Makefiles"</span> -DCMAKE_INSTALL_PREFIX<span class="o">=</span>/install/path
+<span class="go">  [other options] SRC_ROOT</span>
+</pre></div>
+</div>
+</li>
+</ol>
+</div>
+<div class="section" id="compiling-the-llvm-suite-source-code">
+<h3><a class="toc-backref" href="#id20">Compiling the LLVM Suite Source Code</a><a class="headerlink" href="#compiling-the-llvm-suite-source-code" title="Permalink to this headline">¶</a></h3>
+<p>Unlike with autotools, with CMake your build type is defined at configuration.
+If you want to change your build type, you can re-run cmake with the following
+invocation:</p>
+<blockquote>
+<div><div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cmake -G <span class="s2">"Unix Makefiles"</span> -DCMAKE_BUILD_TYPE<span class="o">=</span><span class="nb">type </span>SRC_ROOT
+</pre></div>
+</div>
+</div></blockquote>
+<p>Between runs, CMake preserves the values set for all options. CMake has the
+following build types defined:</p>
+<p>Debug</p>
+<blockquote>
+<div>These builds are the default. The build system will compile the tools and
+libraries unoptimized, with debugging information, and asserts enabled.</div></blockquote>
+<p>Release</p>
+<blockquote>
+<div>For these builds, the build system will compile the tools and libraries
+with optimizations enabled and not generate debug info. CMakes default
+optimization level is -O3. This can be configured by setting the
+<tt class="docutils literal"><span class="pre">CMAKE_CXX_FLAGS_RELEASE</span></tt> variable on the CMake command line.</div></blockquote>
+<p>RelWithDebInfo</p>
+<blockquote>
+<div>These builds are useful when debugging. They generate optimized binaries with
+debug information. CMakes default optimization level is -O2. This can be
+configured by setting the <tt class="docutils literal"><span class="pre">CMAKE_CXX_FLAGS_RELWITHDEBINFO</span></tt> variable on the
+CMake command line.</div></blockquote>
+<p>Once you have LLVM configured, you can build it by entering the <em>OBJ_ROOT</em>
+directory and issuing the following command:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> make
+</pre></div>
+</div>
+<p>If the build fails, please <a class="reference internal" href="#check-here">check here</a> to see if you are using a version of
+GCC that is known not to compile LLVM.</p>
+<p>If you have multiple processors in your machine, you may wish to use some of the
+parallel build options provided by GNU Make.  For example, you could use the
+command:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> make -j2
+</pre></div>
+</div>
+<p>There are several special targets which are useful when working with the LLVM
+source code:</p>
+<p><tt class="docutils literal"><span class="pre">make</span> <span class="pre">clean</span></tt></p>
+<blockquote>
+<div>Removes all files generated by the build.  This includes object files,
+generated C/C++ files, libraries, and executables.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></tt></p>
+<blockquote>
+<div>Installs LLVM header files, libraries, tools, and documentation in a hierarchy
+under <tt class="docutils literal"><span class="pre">$PREFIX</span></tt>, specified with <tt class="docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></tt>, which
+defaults to <tt class="docutils literal"><span class="pre">/usr/local</span></tt>.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">make</span> <span class="pre">docs-llvm-html</span></tt></p>
+<blockquote>
+<div>If configured with <tt class="docutils literal"><span class="pre">-DLLVM_ENABLE_SPHINX=On</span></tt>, this will generate a directory
+at <tt class="docutils literal"><span class="pre">OBJ_ROOT/docs/html</span></tt> which contains the HTML formatted documentation.</div></blockquote>
+</div>
+<div class="section" id="cross-compiling-llvm">
+<h3><a class="toc-backref" href="#id21">Cross-Compiling LLVM</a><a class="headerlink" href="#cross-compiling-llvm" title="Permalink to this headline">¶</a></h3>
+<p>It is possible to cross-compile LLVM itself. That is, you can create LLVM
+executables and libraries to be hosted on a platform different from the platform
+where they are built (a Canadian Cross build). To generate build files for
+cross-compiling CMake provides a variable <tt class="docutils literal"><span class="pre">CMAKE_TOOLCHAIN_FILE</span></tt> which can
+define compiler flags and variables used during the CMake test operations.</p>
+<p>The result of such a build is executables that are not runnable on the build
+host but can be executed on the target. As an example the following CMake
+invocation can generate build files targeting iOS. This will work on Mac OS X
+with the latest Xcode:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cmake -G <span class="s2">"Ninja"</span> -DCMAKE_OSX_ARCHITECTURES<span class="o">=</span><span class="s2">"armv7;armv7s;arm64"</span>
+<span class="go">  -DCMAKE_TOOLCHAIN_FILE=<PATH_TO_LLVM>/cmake/platforms/iOS.cmake</span>
+<span class="go">  -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_RUNTIME=Off -DLLVM_INCLUDE_TESTS=Off</span>
+<span class="go">  -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_ENABLE_BACKTRACES=Off [options]</span>
+<span class="go">  <PATH_TO_LLVM></span>
+</pre></div>
+</div>
+<p>Note: There are some additional flags that need to be passed when building for
+iOS due to limitations in the iOS SDK.</p>
+<p>Check <a class="reference internal" href="HowToCrossCompileLLVM.html"><em>How To Cross-Compile Clang/LLVM using Clang/LLVM</em></a> and <a class="reference external" href="http://clang.llvm.org/docs/CrossCompilation.html">Clang docs on how to cross-compile in general</a> for more information
+about cross-compiling.</p>
+</div>
+<div class="section" id="the-location-of-llvm-object-files">
+<h3><a class="toc-backref" href="#id22">The Location of LLVM Object Files</a><a class="headerlink" href="#the-location-of-llvm-object-files" title="Permalink to this headline">¶</a></h3>
+<p>The LLVM build system is capable of sharing a single LLVM source tree among
+several LLVM builds.  Hence, it is possible to build LLVM for several different
+platforms or configurations using the same source tree.</p>
+<ul>
+<li><p class="first">Change directory to where the LLVM object files should live:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>OBJ_ROOT
+</pre></div>
+</div>
+</li>
+<li><p class="first">Run <tt class="docutils literal"><span class="pre">cmake</span></tt>:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> cmake -G <span class="s2">"Unix Makefiles"</span> SRC_ROOT
+</pre></div>
+</div>
+</li>
+</ul>
+<p>The LLVM build will create a structure underneath <em>OBJ_ROOT</em> that matches the
+LLVM source tree. At each level where source files are present in the source
+tree there will be a corresponding <tt class="docutils literal"><span class="pre">CMakeFiles</span></tt> directory in the <em>OBJ_ROOT</em>.
+Underneath that directory there is another directory with a name ending in
+<tt class="docutils literal"><span class="pre">.dir</span></tt> under which you’ll find object files for each source.</p>
+<p>For example:</p>
+<blockquote>
+<div><div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> <span class="nb">cd </span>llvm_build_dir
+<span class="gp">%</span> find lib/Support/ -name APFloat*
+<span class="go">lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o</span>
+</pre></div>
+</div>
+</div></blockquote>
+</div>
+<div class="section" id="optional-configuration-items">
+<h3><a class="toc-backref" href="#id23">Optional Configuration Items</a><a class="headerlink" href="#optional-configuration-items" title="Permalink to this headline">¶</a></h3>
+<p>If you’re running on a Linux system that supports the <a class="reference external" href="http://en.wikipedia.org/wiki/binfmt_misc">binfmt_misc</a>
+module, and you have root access on the system, you can set your system up to
+execute LLVM bitcode files directly. To do this, use commands like this (the
+first command may not be required if you are already using the module):</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
+<span class="gp">%</span> <span class="nb">echo</span> <span class="s1">':llvm:M::BC::/path/to/lli:'</span> > /proc/sys/fs/binfmt_misc/register
+<span class="gp">%</span> chmod u+x hello.bc   <span class="o">(</span><span class="k">if </span>needed<span class="o">)</span>
+<span class="gp">%</span> ./hello.bc
+</pre></div>
+</div>
+<p>This allows you to execute LLVM bitcode files directly.  On Debian, you can also
+use this command instead of the ‘echo’ command above:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> sudo update-binfmts --install llvm /path/to/lli --magic <span class="s1">'BC'</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="directory-layout">
+<span id="general-layout"></span><span id="program-layout"></span><h2><a class="toc-backref" href="#id24">Directory Layout</a><a class="headerlink" href="#directory-layout" title="Permalink to this headline">¶</a></h2>
+<p>One useful source of information about the LLVM source base is the LLVM <a class="reference external" href="http://www.doxygen.org/">doxygen</a> documentation available at
+<a class="reference external" href="http://llvm.org/doxygen/">http://llvm.org/doxygen/</a>.  The following is a brief introduction to code
+layout:</p>
+<div class="section" id="llvm-examples">
+<h3><a class="toc-backref" href="#id25"><tt class="docutils literal"><span class="pre">llvm/examples</span></tt></a><a class="headerlink" href="#llvm-examples" title="Permalink to this headline">¶</a></h3>
+<p>Simple examples using the LLVM IR and JIT.</p>
+</div>
+<div class="section" id="llvm-include">
+<h3><a class="toc-backref" href="#id26"><tt class="docutils literal"><span class="pre">llvm/include</span></tt></a><a class="headerlink" href="#llvm-include" title="Permalink to this headline">¶</a></h3>
+<p>Public header files exported from the LLVM library. The three main subdirectories:</p>
+<p><tt class="docutils literal"><span class="pre">llvm/include/llvm</span></tt></p>
+<blockquote>
+<div>All LLVM-specific header files, and  subdirectories for different portions of
+LLVM: <tt class="docutils literal"><span class="pre">Analysis</span></tt>, <tt class="docutils literal"><span class="pre">CodeGen</span></tt>, <tt class="docutils literal"><span class="pre">Target</span></tt>, <tt class="docutils literal"><span class="pre">Transforms</span></tt>, etc...</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/include/llvm/Support</span></tt></p>
+<blockquote>
+<div>Generic support libraries provided with LLVM but not necessarily specific to
+LLVM. For example, some C++ STL utilities and a Command Line option processing
+library store header files here.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/include/llvm/Config</span></tt></p>
+<blockquote>
+<div>Header files configured by the <tt class="docutils literal"><span class="pre">configure</span></tt> script.
+They wrap “standard” UNIX and C header files.  Source code can include these
+header files which automatically take care of the conditional #includes that
+the <tt class="docutils literal"><span class="pre">configure</span></tt> script generates.</div></blockquote>
+</div>
+<div class="section" id="llvm-lib">
+<h3><a class="toc-backref" href="#id27"><tt class="docutils literal"><span class="pre">llvm/lib</span></tt></a><a class="headerlink" href="#llvm-lib" title="Permalink to this headline">¶</a></h3>
+<p>Most source files are here. By putting code in libraries, LLVM makes it easy to
+share code among the <a class="reference internal" href="#tools">tools</a>.</p>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/IR/</span></tt></p>
+<blockquote>
+<div>Core LLVM source files that implement core classes like Instruction and
+BasicBlock.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/AsmParser/</span></tt></p>
+<blockquote>
+<div>Source code for the LLVM assembly language parser library.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/Bitcode/</span></tt></p>
+<blockquote>
+<div>Code for reading and writing bitcode.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/Analysis/</span></tt></p>
+<blockquote>
+<div>A variety of program analyses, such as Call Graphs, Induction Variables,
+Natural Loop Identification, etc.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/Transforms/</span></tt></p>
+<blockquote>
+<div>IR-to-IR program transformations, such as Aggressive Dead Code Elimination,
+Sparse Conditional Constant Propagation, Inlining, Loop Invariant Code Motion,
+Dead Global Elimination, and many others.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/Target/</span></tt></p>
+<blockquote>
+<div>Files describing target architectures for code generation.  For example,
+<tt class="docutils literal"><span class="pre">llvm/lib/Target/X86</span></tt> holds the X86 machine description.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/CodeGen/</span></tt></p>
+<blockquote>
+<div>The major parts of the code generator: Instruction Selector, Instruction
+Scheduling, and Register Allocation.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/MC/</span></tt></p>
+<blockquote>
+<div>(FIXME: T.B.D.)  ....?</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/ExecutionEngine/</span></tt></p>
+<blockquote>
+<div>Libraries for directly executing bitcode at runtime in interpreted and
+JIT-compiled scenarios.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm/lib/Support/</span></tt></p>
+<blockquote>
+<div>Source code that corresponding to the header files in <tt class="docutils literal"><span class="pre">llvm/include/ADT/</span></tt>
+and <tt class="docutils literal"><span class="pre">llvm/include/Support/</span></tt>.</div></blockquote>
+</div>
+<div class="section" id="llvm-projects">
+<h3><a class="toc-backref" href="#id28"><tt class="docutils literal"><span class="pre">llvm/projects</span></tt></a><a class="headerlink" href="#llvm-projects" title="Permalink to this headline">¶</a></h3>
+<p>Projects not strictly part of LLVM but shipped with LLVM. This is also the
+directory for creating your own LLVM-based projects which leverage the LLVM
+build system.</p>
+</div>
+<div class="section" id="llvm-test">
+<h3><a class="toc-backref" href="#id29"><tt class="docutils literal"><span class="pre">llvm/test</span></tt></a><a class="headerlink" href="#llvm-test" title="Permalink to this headline">¶</a></h3>
+<p>Feature and regression tests and other sanity checks on LLVM infrastructure. These
+are intended to run quickly and cover a lot of territory without being exhaustive.</p>
+</div>
+<div class="section" id="test-suite">
+<h3><a class="toc-backref" href="#id30"><tt class="docutils literal"><span class="pre">test-suite</span></tt></a><a class="headerlink" href="#test-suite" title="Permalink to this headline">¶</a></h3>
+<p>A comprehensive correctness, performance, and benchmarking test suite for LLVM.
+Comes in a separate Subversion module because not every LLVM user is interested
+in such a comprehensive suite. For details see the <a class="reference internal" href="TestingGuide.html"><em>Testing Guide</em></a> document.</p>
+</div>
+<div class="section" id="llvm-tools">
+<span id="tools"></span><h3><a class="toc-backref" href="#id31"><tt class="docutils literal"><span class="pre">llvm/tools</span></tt></a><a class="headerlink" href="#llvm-tools" title="Permalink to this headline">¶</a></h3>
+<p>Executables built out of the libraries
+above, which form the main part of the user interface.  You can always get help
+for a tool by typing <tt class="docutils literal"><span class="pre">tool_name</span> <span class="pre">-help</span></tt>.  The following is a brief introduction
+to the most important tools.  More detailed information is in
+the <a class="reference external" href="CommandGuide/index.html">Command Guide</a>.</p>
+<p><tt class="docutils literal"><span class="pre">bugpoint</span></tt></p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">bugpoint</span></tt> is used to debug optimization passes or code generation backends
+by narrowing down the given test case to the minimum number of passes and/or
+instructions that still cause a problem, whether it is a crash or
+miscompilation. See <a class="reference external" href="HowToSubmitABug.html">HowToSubmitABug.html</a> for more information on using
+<tt class="docutils literal"><span class="pre">bugpoint</span></tt>.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm-ar</span></tt></p>
+<blockquote>
+<div>The archiver produces an archive containing the given LLVM bitcode files,
+optionally with an index for faster lookup.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm-as</span></tt></p>
+<blockquote>
+<div>The assembler transforms the human readable LLVM assembly to LLVM bitcode.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm-dis</span></tt></p>
+<blockquote>
+<div>The disassembler transforms the LLVM bitcode to human readable LLVM assembly.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvm-link</span></tt></p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">llvm-link</span></tt>, not surprisingly, links multiple LLVM modules into a single
+program.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">lli</span></tt></p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">lli</span></tt> is the LLVM interpreter, which can directly execute LLVM bitcode
+(although very slowly...). For architectures that support it (currently x86,
+Sparc, and PowerPC), by default, <tt class="docutils literal"><span class="pre">lli</span></tt> will function as a Just-In-Time
+compiler (if the functionality was compiled in), and will execute the code
+<em>much</em> faster than the interpreter.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llc</span></tt></p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">llc</span></tt> is the LLVM backend compiler, which translates LLVM bitcode to a
+native code assembly file.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">opt</span></tt></p>
+<blockquote>
+<div><p><tt class="docutils literal"><span class="pre">opt</span></tt> reads LLVM bitcode, applies a series of LLVM to LLVM transformations
+(which are specified on the command line), and outputs the resultant
+bitcode.   ‘<tt class="docutils literal"><span class="pre">opt</span> <span class="pre">-help</span></tt>‘  is a good way to get a list of the
+program transformations available in LLVM.</p>
+<p><tt class="docutils literal"><span class="pre">opt</span></tt> can also  run a specific analysis on an input LLVM bitcode
+file and print  the results.  Primarily useful for debugging
+analyses, or familiarizing yourself with what an analysis does.</p>
+</div></blockquote>
+</div>
+<div class="section" id="llvm-utils">
+<h3><a class="toc-backref" href="#id32"><tt class="docutils literal"><span class="pre">llvm/utils</span></tt></a><a class="headerlink" href="#llvm-utils" title="Permalink to this headline">¶</a></h3>
+<p>Utilities for working with LLVM source code; some are part of the build process
+because they are code generators for parts of the infrastructure.</p>
+<p><tt class="docutils literal"><span class="pre">codegen-diff</span></tt></p>
+<blockquote>
+<div><tt class="docutils literal"><span class="pre">codegen-diff</span></tt> finds differences between code that LLC
+generates and code that LLI generates. This is useful if you are
+debugging one of them, assuming that the other generates correct output. For
+the full user manual, run <tt class="docutils literal"><span class="pre">`perldoc</span> <span class="pre">codegen-diff'</span></tt>.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">emacs/</span></tt></p>
+<blockquote>
+<div>Emacs and XEmacs syntax highlighting  for LLVM   assembly files and TableGen
+description files.  See the <tt class="docutils literal"><span class="pre">README</span></tt> for information on using them.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">getsrcs.sh</span></tt></p>
+<blockquote>
+<div>Finds and outputs all non-generated source files,
+useful if one wishes to do a lot of development across directories
+and does not want to find each file. One way to use it is to run,
+for example: <tt class="docutils literal"><span class="pre">xemacs</span> <span class="pre">`utils/getsources.sh`</span></tt> from the top of the LLVM source
+tree.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">llvmgrep</span></tt></p>
+<blockquote>
+<div>Performs an <tt class="docutils literal"><span class="pre">egrep</span> <span class="pre">-H</span> <span class="pre">-n</span></tt> on each source file in LLVM and
+passes to it a regular expression provided on <tt class="docutils literal"><span class="pre">llvmgrep</span></tt>‘s command
+line. This is an efficient way of searching the source base for a
+particular regular expression.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">makellvm</span></tt></p>
+<blockquote>
+<div>Compiles all files in the current directory, then
+compiles and links the tool that is the first argument. For example, assuming
+you are in  <tt class="docutils literal"><span class="pre">llvm/lib/Target/Sparc</span></tt>, if <tt class="docutils literal"><span class="pre">makellvm</span></tt> is in your
+path,  running <tt class="docutils literal"><span class="pre">makellvm</span> <span class="pre">llc</span></tt> will make a build of the current
+directory, switch to directory <tt class="docutils literal"><span class="pre">llvm/tools/llc</span></tt> and build it, causing a
+re-linking of LLC.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">TableGen/</span></tt></p>
+<blockquote>
+<div>Contains the tool used to generate register
+descriptions, instruction set descriptions, and even assemblers from common
+TableGen description files.</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">vim/</span></tt></p>
+<blockquote>
+<div>vim syntax-highlighting for LLVM assembly files
+and TableGen description files. See the    <tt class="docutils literal"><span class="pre">README</span></tt> for how to use them.</div></blockquote>
+</div>
+</div>
+<div class="section" id="an-example-using-the-llvm-tool-chain">
+<span id="simple-example"></span><h2><a class="toc-backref" href="#id33">An Example Using the LLVM Tool Chain</a><a class="headerlink" href="#an-example-using-the-llvm-tool-chain" title="Permalink to this headline">¶</a></h2>
+<p>This section gives an example of using LLVM with the Clang front end.</p>
+<div class="section" id="example-with-clang">
+<h3><a class="toc-backref" href="#id34">Example with clang</a><a class="headerlink" href="#example-with-clang" title="Permalink to this headline">¶</a></h3>
+<ol class="arabic">
+<li><p class="first">First, create a simple C file, name it ‘hello.c’:</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="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Next, compile the C file into a native executable:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> clang hello.c -o hello
+</pre></div>
+</div>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Clang works just like GCC by default.  The standard -S and -c arguments
+work as usual (producing a native .s or .o file, respectively).</p>
+</div>
+</li>
+<li><p class="first">Next, compile the C file into an LLVM bitcode file:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> clang -O3 -emit-llvm hello.c -c -o hello.bc
+</pre></div>
+</div>
+<p>The -emit-llvm option can be used with the -S or -c options to emit an LLVM
+<tt class="docutils literal"><span class="pre">.ll</span></tt> or <tt class="docutils literal"><span class="pre">.bc</span></tt> file (respectively) for the code.  This allows you to use
+the <a class="reference external" href="CommandGuide/index.html">standard LLVM tools</a> on the bitcode file.</p>
+</li>
+<li><p class="first">Run the program in both forms. To run the program, use:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> ./hello
+</pre></div>
+</div>
+<p>and</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> lli hello.bc
+</pre></div>
+</div>
+<p>The second examples shows how to invoke the LLVM JIT, <a class="reference internal" href="CommandGuide/lli.html"><em>lli</em></a>.</p>
+</li>
+<li><p class="first">Use the <tt class="docutils literal"><span class="pre">llvm-dis</span></tt> utility to take a look at the LLVM assembly code:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> llvm-dis < hello.bc | less
+</pre></div>
+</div>
+</li>
+<li><p class="first">Compile the program to native assembly using the LLC code generator:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> llc hello.bc -o hello.s
+</pre></div>
+</div>
+</li>
+<li><p class="first">Assemble the native assembly language file into a program:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> /opt/SUNWspro/bin/cc -xarch<span class="o">=</span>v9 hello.s -o hello.native   <span class="c"># On Solaris</span>
+
+<span class="gp">%</span> gcc hello.s -o hello.native                              <span class="c"># On others</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Execute the native code program:</p>
+<div class="highlight-console"><div class="highlight"><pre><span class="gp">%</span> ./hello.native
+</pre></div>
+</div>
+<p>Note that using clang to compile directly to native code (i.e. when the
+<tt class="docutils literal"><span class="pre">-emit-llvm</span></tt> option is not present) does steps 6/7/8 for you.</p>
+</li>
+</ol>
+</div>
+</div>
+<div class="section" id="common-problems">
+<h2><a class="toc-backref" href="#id35">Common Problems</a><a class="headerlink" href="#common-problems" title="Permalink to this headline">¶</a></h2>
+<p>If you are having problems building or using LLVM, or if you have any other
+general questions about LLVM, please consult the <a class="reference external" href="FAQ.html">Frequently Asked
+Questions</a> page.</p>
+</div>
+<div class="section" id="links">
+<span id="id3"></span><h2><a class="toc-backref" href="#id36">Links</a><a class="headerlink" href="#links" title="Permalink to this headline">¶</a></h2>
+<p>This document is just an <strong>introduction</strong> on how to use LLVM to do some simple
+things... there are many more interesting and complicated things that you can do
+that aren’t documented here (but we’ll gladly accept a patch if you want to
+write something up!).  For more information about LLVM, check out:</p>
+<ul class="simple">
+<li><a class="reference external" href="http://llvm.org/">LLVM Homepage</a></li>
+<li><a class="reference external" href="http://llvm.org/doxygen/">LLVM Doxygen Tree</a></li>
+<li><a class="reference external" href="http://llvm.org/docs/Projects.html">Starting a Project that Uses LLVM</a></li>
+</ul>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="GettingStartedVS.html" title="Getting Started with the LLVM System using Microsoft Visual Studio"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="CommandGuide/llvm-readobj.html" title="llvm-readobj - LLVM Object Reader"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/GettingStartedVS.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/GettingStartedVS.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/GettingStartedVS.html (added)
+++ www-releases/trunk/7.0.1/docs/GettingStartedVS.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,338 @@
+
+
+<!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>Getting Started with the LLVM System using Microsoft Visual Studio — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="Frequently Asked Questions (FAQ)" href="FAQ.html" />
+    <link rel="prev" title="Getting Started with the LLVM System" href="GettingStarted.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="FAQ.html" title="Frequently Asked Questions (FAQ)"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="GettingStarted.html" title="Getting Started with the LLVM System"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="getting-started-with-the-llvm-system-using-microsoft-visual-studio">
+<h1>Getting Started with the LLVM System using Microsoft Visual Studio<a class="headerlink" href="#getting-started-with-the-llvm-system-using-microsoft-visual-studio" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#overview" id="id2">Overview</a></li>
+<li><a class="reference internal" href="#requirements" id="id3">Requirements</a><ul>
+<li><a class="reference internal" href="#hardware" id="id4">Hardware</a></li>
+<li><a class="reference internal" href="#software" id="id5">Software</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#getting-started" id="id6">Getting Started</a></li>
+<li><a class="reference internal" href="#an-example-using-the-llvm-tool-chain" id="id7">An Example Using the LLVM Tool Chain</a></li>
+<li><a class="reference internal" href="#common-problems" id="id8">Common Problems</a></li>
+<li><a class="reference internal" href="#links" id="id9">Links</a></li>
+</ul>
+</div>
+<div class="section" id="overview">
+<h2><a class="toc-backref" href="#id2">Overview</a><a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to LLVM on Windows! This document only covers LLVM on Windows using
+Visual Studio, not mingw or cygwin. In order to get started, you first need to
+know some basic information.</p>
+<p>There are many different projects that compose LLVM. The first piece is the
+LLVM suite. This contains all of the tools, libraries, and header files needed
+to use LLVM. It contains an assembler, disassembler, bitcode analyzer and
+bitcode optimizer. It also contains basic regression tests that can be used to
+test the LLVM tools and the Clang front end.</p>
+<p>The second piece is the <a class="reference external" href="http://clang.llvm.org/">Clang</a> front end.  This
+component compiles C, C++, Objective C, and Objective C++ code into LLVM
+bitcode. Clang typically uses LLVM libraries to optimize the bitcode and emit
+machine code. LLVM fully supports the COFF object file format, which is
+compatible with all other existing Windows toolchains.</p>
+<p>The last major part of LLVM, the execution Test Suite, does not run on Windows,
+and this document does not discuss it.</p>
+<p>Additional information about the LLVM directory structure and tool chain
+can be found on the main <a class="reference internal" href="GettingStarted.html"><em>Getting Started with the LLVM System</em></a> page.</p>
+</div>
+<div class="section" id="requirements">
+<h2><a class="toc-backref" href="#id3">Requirements</a><a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
+<p>Before you begin to use the LLVM system, review the requirements given
+below.  This may save you some trouble by knowing ahead of time what hardware
+and software you will need.</p>
+<div class="section" id="hardware">
+<h3><a class="toc-backref" href="#id4">Hardware</a><a class="headerlink" href="#hardware" title="Permalink to this headline">¶</a></h3>
+<p>Any system that can adequately run Visual Studio 2015 is fine. The LLVM
+source tree and object files, libraries and executables will consume
+approximately 3GB.</p>
+</div>
+<div class="section" id="software">
+<h3><a class="toc-backref" href="#id5">Software</a><a class="headerlink" href="#software" title="Permalink to this headline">¶</a></h3>
+<p>You will need Visual Studio 2015 or higher, with the latest Update installed.</p>
+<p>You will also need the <a class="reference external" href="http://www.cmake.org/">CMake</a> build system since it
+generates the project files you will use to build with.</p>
+<p>If you would like to run the LLVM tests you will need <a class="reference external" href="http://www.python.org/">Python</a>. Version 2.7 and newer are known to work. You will
+need <a class="reference external" href="http://gnuwin32.sourceforge.net/">GnuWin32</a> tools, too.</p>
+<p>Do not install the LLVM directory tree into a path containing spaces (e.g.
+<tt class="docutils literal"><span class="pre">C:\Documents</span> <span class="pre">and</span> <span class="pre">Settings\...</span></tt>) as the configure step will fail.</p>
+</div>
+</div>
+<div class="section" id="getting-started">
+<h2><a class="toc-backref" href="#id6">Getting Started</a><a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
+<p>Here’s the short story for getting up and running quickly with LLVM:</p>
+<ol class="arabic">
+<li><p class="first">Read the documentation.</p>
+</li>
+<li><p class="first">Seriously, read the documentation.</p>
+</li>
+<li><p class="first">Remember that you were warned twice about reading the documentation.</p>
+</li>
+<li><p class="first">Get the Source Code</p>
+<ul>
+<li><p class="first">With the distributed files:</p>
+<blockquote>
+<div><ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre"><where-you-want-llvm-to-live></span></tt></li>
+<li><tt class="docutils literal"><span class="pre">gunzip</span> <span class="pre">--stdout</span> <span class="pre">llvm-VERSION.tar.gz</span> <span class="pre">|</span> <span class="pre">tar</span> <span class="pre">-xvf</span> <span class="pre">-</span></tt>
+(<em>or use WinZip</em>)</li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm</span></tt></li>
+</ol>
+</div></blockquote>
+</li>
+<li><p class="first">With anonymous Subversion access:</p>
+<p><em>Note:</em> some regression tests require Unix-style line ending (<tt class="docutils literal"><span class="pre">\n</span></tt>). To
+pass all regression tests, please add two lines <em>enable-auto-props = yes</em>
+and <em>* = svn:mime-type=application/octet-stream</em> to
+<tt class="docutils literal"><span class="pre">C:\Users\<username>\AppData\Roaming\Subversion\config</span></tt>.</p>
+<blockquote>
+<div><ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre"><where-you-want-llvm-to-live></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/llvm/trunk</span> <span class="pre">llvm</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">llvm</span></tt></li>
+</ol>
+</div></blockquote>
+</li>
+</ul>
+</li>
+<li><p class="first">Use <a class="reference external" href="http://www.cmake.org/">CMake</a> to generate up-to-date project files:</p>
+<ul class="simple">
+<li>Once CMake is installed then the simplest way is to just start the
+CMake GUI, select the directory where you have LLVM extracted to, and
+the default options should all be fine.  One option you may really
+want to change, regardless of anything else, might be the
+<tt class="docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></tt> setting to select a directory to INSTALL to
+once compiling is complete, although installation is not mandatory for
+using LLVM.  Another important option is <tt class="docutils literal"><span class="pre">LLVM_TARGETS_TO_BUILD</span></tt>,
+which controls the LLVM target architectures that are included on the
+build.</li>
+<li>If CMake complains that it cannot find the compiler, make sure that
+you have the Visual Studio C++ Tools installed, not just Visual Studio
+itself (trying to create a C++ project in Visual Studio will generally
+download the C++ tools if they haven’t already been).</li>
+<li>See the <a class="reference internal" href="CMake.html"><em>LLVM CMake guide</em></a> for detailed information about
+how to configure the LLVM build.</li>
+<li>CMake generates project files for all build types. To select a specific
+build type, use the Configuration manager from the VS IDE or the
+<tt class="docutils literal"><span class="pre">/property:Configuration</span></tt> command line option when using MSBuild.</li>
+<li>By default, the Visual Studio project files generated by CMake use the
+32-bit toolset. If you are developing on a 64-bit version of Windows and
+want to use the 64-bit toolset, pass the <tt class="docutils literal"><span class="pre">-Thost=x64</span></tt> flag when
+generating the Visual Studio solution. This requires CMake 3.8.0 or later.</li>
+</ul>
+</li>
+<li><p class="first">Start Visual Studio</p>
+<ul class="simple">
+<li>In the directory you created the project files will have an <tt class="docutils literal"><span class="pre">llvm.sln</span></tt>
+file, just double-click on that to open Visual Studio.</li>
+</ul>
+</li>
+<li><p class="first">Build the LLVM Suite:</p>
+<ul class="simple">
+<li>The projects may still be built individually, but to build them all do
+not just select all of them in batch build (as some are meant as
+configuration projects), but rather select and build just the
+<tt class="docutils literal"><span class="pre">ALL_BUILD</span></tt> project to build everything, or the <tt class="docutils literal"><span class="pre">INSTALL</span></tt> project,
+which first builds the <tt class="docutils literal"><span class="pre">ALL_BUILD</span></tt> project, then installs the LLVM
+headers, libs, and other useful things to the directory set by the
+<tt class="docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></tt> setting when you first configured CMake.</li>
+<li>The Fibonacci project is a sample program that uses the JIT. Modify the
+project’s debugging properties to provide a numeric command line argument
+or run it from the command line.  The program will print the
+corresponding fibonacci value.</li>
+</ul>
+</li>
+<li><p class="first">Test LLVM in Visual Studio:</p>
+<ul class="simple">
+<li>If <tt class="docutils literal"><span class="pre">%PATH%</span></tt> does not contain GnuWin32, you may specify
+<tt class="docutils literal"><span class="pre">LLVM_LIT_TOOLS_DIR</span></tt> on CMake for the path to GnuWin32.</li>
+<li>You can run LLVM tests by merely building the project “check”. The test
+results will be shown in the VS output window.</li>
+</ul>
+</li>
+<li><p class="first">Test LLVM on the command line:</p>
+<ul>
+<li><p class="first">The LLVM tests can be run by changing directory to the llvm source
+directory and running:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..\llvm<span class="p">></span> <span class="n">python</span> ..\build\bin\llvm-lit --param build_config<span class="o">=</span>Win<span class="m">32</span> --param build_mode<span class="o">=</span>Debug --param llvm_site_config<span class="o">=</span>..<span class="n">/build/test/lit.site.cfg</span> test
+</pre></div>
+</div>
+<p>This example assumes that Python is in your PATH variable, you
+have built a Win32 Debug version of llvm with a standard out of
+line build. You should not see any unexpected failures, but will
+see many unsupported tests and expected failures.</p>
+<p>A specific test or test directory can be run with:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..\llvm<span class="p">></span> <span class="n">python</span> ..\build\bin\llvm-lit --param build_config<span class="o">=</span>Win<span class="m">32</span> --param build_mode<span class="o">=</span>Debug --param llvm_site_config<span class="o">=</span>..<span class="n">/build/test/lit.site.cfg</span> test<span class="n">/path/to/test</span>
+</pre></div>
+</div>
+</li>
+</ul>
+</li>
+</ol>
+</div>
+<div class="section" id="an-example-using-the-llvm-tool-chain">
+<h2><a class="toc-backref" href="#id7">An Example Using the LLVM Tool Chain</a><a class="headerlink" href="#an-example-using-the-llvm-tool-chain" title="Permalink to this headline">¶</a></h2>
+<ol class="arabic">
+<li><p class="first">First, create a simple C file, name it ‘<tt class="docutils literal"><span class="pre">hello.c</span></tt>‘:</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="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Next, compile the C file into an LLVM bitcode file:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">clang</span> -c hello.c -emit-llvm -o hello.bc
+</pre></div>
+</div>
+<p>This will create the result file <tt class="docutils literal"><span class="pre">hello.bc</span></tt> which is the LLVM bitcode
+that corresponds the compiled program and the library facilities that
+it required.  You can execute this file directly using <tt class="docutils literal"><span class="pre">lli</span></tt> tool,
+compile it to native assembly with the <tt class="docutils literal"><span class="pre">llc</span></tt>, optimize or analyze it
+further with the <tt class="docutils literal"><span class="pre">opt</span></tt> tool, etc.</p>
+<p>Alternatively you can directly output an executable with clang with:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">clang</span> hello.c -o hello.exe
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">-o</span> <span class="pre">hello.exe</span></tt> is required because clang currently outputs <tt class="docutils literal"><span class="pre">a.out</span></tt>
+when neither <tt class="docutils literal"><span class="pre">-o</span></tt> nor <tt class="docutils literal"><span class="pre">-c</span></tt> are given.</p>
+</li>
+<li><p class="first">Run the program using the just-in-time compiler:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">lli</span> hello.bc
+</pre></div>
+</div>
+</li>
+<li><p class="first">Use the <tt class="docutils literal"><span class="pre">llvm-dis</span></tt> utility to take a look at the LLVM assembly code:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">llvm</span>-dis <span class="p"><</span> <span class="n">hello</span>.bc <span class="p">|</span> <span class="n">more</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Compile the program to object code using the LLC code generator:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">llc</span> -filetype<span class="o">=</span>obj hello.bc
+</pre></div>
+</div>
+</li>
+<li><p class="first">Link to binary using Microsoft link:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">link</span> hello.obj -defaultlib:libcmt
+</pre></div>
+</div>
+</li>
+<li><p class="first">Execute the native code program:</p>
+<div class="highlight-bat"><div class="highlight"><pre>C:\..<span class="p">></span> <span class="n">hello</span>.exe
+</pre></div>
+</div>
+</li>
+</ol>
+</div>
+<div class="section" id="common-problems">
+<h2><a class="toc-backref" href="#id8">Common Problems</a><a class="headerlink" href="#common-problems" title="Permalink to this headline">¶</a></h2>
+<p>If you are having problems building or using LLVM, or if you have any other
+general questions about LLVM, please consult the <a class="reference internal" href="FAQ.html"><em>Frequently Asked Questions</em></a> page.</p>
+</div>
+<div class="section" id="links">
+<h2><a class="toc-backref" href="#id9">Links</a><a class="headerlink" href="#links" title="Permalink to this headline">¶</a></h2>
+<p>This document is just an <strong>introduction</strong> to how to use LLVM to do some simple
+things... there are many more interesting and complicated things that you can
+do that aren’t documented here (but we’ll gladly accept a patch if you want to
+write something up!).  For more information about LLVM, check out:</p>
+<ul class="simple">
+<li><a class="reference external" href="http://llvm.org/">LLVM homepage</a></li>
+<li><a class="reference external" href="http://llvm.org/doxygen/">LLVM doxygen tree</a></li>
+</ul>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="FAQ.html" title="Frequently Asked Questions (FAQ)"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="GettingStarted.html" title="Getting Started with the LLVM System"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/GlobalISel.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/GlobalISel.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/GlobalISel.html (added)
+++ www-releases/trunk/7.0.1/docs/GlobalISel.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,737 @@
+
+
+<!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>Global Instruction Selection — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="XRay Instrumentation" href="XRay.html" />
+    <link rel="prev" title="Coroutines in LLVM" href="Coroutines.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="XRay.html" title="XRay Instrumentation"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="Coroutines.html" title="Coroutines in LLVM"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="global-instruction-selection">
+<h1>Global Instruction Selection<a class="headerlink" href="#global-instruction-selection" 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="id12">Introduction</a></li>
+<li><a class="reference internal" href="#generic-machine-ir" id="id13">Generic Machine IR</a></li>
+<li><a class="reference internal" href="#core-pipeline" id="id14">Core Pipeline</a></li>
+<li><a class="reference internal" href="#maintainability" id="id15">Maintainability</a></li>
+<li><a class="reference internal" href="#progress-and-future-work" id="id16">Progress and Future Work</a></li>
+<li><a class="reference internal" href="#porting-globalisel-to-a-new-target" id="id17">Porting GlobalISel to A New Target</a></li>
+<li><a class="reference internal" href="#resources" id="id18">Resources</a></li>
+</ul>
+</div>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">This document is a work in progress.  It reflects the current state of the
+implementation, as well as open design and implementation issues.</p>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id12">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>GlobalISel is a framework that provides a set of reusable passes and utilities
+for instruction selection — translation from LLVM IR to target-specific
+Machine IR (MIR).</p>
+<p>GlobalISel is intended to be a replacement for SelectionDAG and FastISel, to
+solve three major problems:</p>
+<ul>
+<li><p class="first"><strong>Performance</strong> — SelectionDAG introduces a dedicated intermediate
+representation, which has a compile-time cost.</p>
+<p>GlobalISel directly operates on the post-isel representation used by the
+rest of the code generator, MIR.
+It does require extensions to that representation to support arbitrary
+incoming IR: <a class="reference internal" href="#gmir"><em>Generic Machine IR</em></a>.</p>
+</li>
+<li><p class="first"><strong>Granularity</strong> — SelectionDAG and FastISel operate on individual basic
+blocks, losing some global optimization opportunities.</p>
+<p>GlobalISel operates on the whole function.</p>
+</li>
+<li><p class="first"><strong>Modularity</strong> — SelectionDAG and FastISel are radically different and share
+very little code.</p>
+<p>GlobalISel is built in a way that enables code reuse. For instance, both the
+optimized and fast selectors share the <a class="reference internal" href="#pipeline"><em>Core Pipeline</em></a>, and targets can
+configure that pipeline to better suit their needs.</p>
+</li>
+</ul>
+</div>
+<div class="section" id="generic-machine-ir">
+<span id="gmir"></span><h2><a class="toc-backref" href="#id13">Generic Machine IR</a><a class="headerlink" href="#generic-machine-ir" title="Permalink to this headline">¶</a></h2>
+<p>Machine IR operates on physical registers, register classes, and (mostly)
+target-specific instructions.</p>
+<p>To bridge the gap with LLVM IR, GlobalISel introduces “generic” extensions to
+Machine IR:</p>
+<div class="contents local topic" id="id1">
+<ul class="simple">
+<li><a class="reference internal" href="#generic-instructions" id="id19">Generic Instructions</a></li>
+<li><a class="reference internal" href="#generic-virtual-registers" id="id20">Generic Virtual Registers</a></li>
+<li><a class="reference internal" href="#register-bank" id="id21">Register Bank</a></li>
+<li><a class="reference internal" href="#low-level-type" id="id22">Low Level Type</a></li>
+</ul>
+</div>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+The generic MIR (GMIR) representation still contains references to IR
+constructs (such as <tt class="docutils literal"><span class="pre">GlobalValue</span></tt>).  Removing those should let us write more
+accurate tests, or delete IR after building the initial MIR.  However, it is
+not part of the GlobalISel effort.</p>
+<div class="section" id="generic-instructions">
+<span id="gmir-instructions"></span><h3><a class="toc-backref" href="#id19">Generic Instructions</a><a class="headerlink" href="#generic-instructions" title="Permalink to this headline">¶</a></h3>
+<p>The main addition is support for pre-isel generic machine instructions (e.g.,
+<tt class="docutils literal"><span class="pre">G_ADD</span></tt>).  Like other target-independent instructions (e.g., <tt class="docutils literal"><span class="pre">COPY</span></tt> or
+<tt class="docutils literal"><span class="pre">PHI</span></tt>), these are available on all targets.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+While we’re progressively adding instructions, one kind in particular exposes
+interesting problems: compares and how to represent condition codes.
+Some targets (x86, ARM) have generic comparisons setting multiple flags,
+which are then used by predicated variants.
+Others (IR) specify the predicate in the comparison and users just get a single
+bit.  SelectionDAG uses SETCC/CONDBR vs BR_CC (and similar for select) to
+represent this.</p>
+<p>The <tt class="docutils literal"><span class="pre">MachineIRBuilder</span></tt> class wraps the <tt class="docutils literal"><span class="pre">MachineInstrBuilder</span></tt> and provides
+a convenient way to create these generic instructions.</p>
+</div>
+<div class="section" id="generic-virtual-registers">
+<span id="gmir-gvregs"></span><h3><a class="toc-backref" href="#id20">Generic Virtual Registers</a><a class="headerlink" href="#generic-virtual-registers" title="Permalink to this headline">¶</a></h3>
+<p>Generic instructions operate on a new kind of register: “generic” virtual
+registers.  As opposed to non-generic vregs, they are not assigned a Register
+Class.  Instead, generic vregs have a <a class="reference internal" href="#gmir-llt"><em>Low Level Type</em></a>, and can be assigned
+a <a class="reference internal" href="#gmir-regbank"><em>Register Bank</em></a>.</p>
+<p><tt class="docutils literal"><span class="pre">MachineRegisterInfo</span></tt> tracks the same information that it does for
+non-generic vregs (e.g., use-def chains).  Additionally, it also tracks the
+<a class="reference internal" href="#gmir-llt"><em>Low Level Type</em></a> of the register, and, instead of the <tt class="docutils literal"><span class="pre">TargetRegisterClass</span></tt>,
+its <a class="reference internal" href="#gmir-regbank"><em>Register Bank</em></a>, if any.</p>
+<p>For simplicity, most generic instructions only accept generic vregs:</p>
+<ul class="simple">
+<li>instead of immediates, they use a gvreg defined by an instruction
+materializing the immediate value (see <a class="reference internal" href="#irtranslator-constants"><em>Constant Lowering</em></a>).</li>
+<li>instead of physical register, they use a gvreg defined by a <tt class="docutils literal"><span class="pre">COPY</span></tt>.</li>
+</ul>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+We started with an alternative representation, where MRI tracks a size for
+each gvreg, and instructions have lists of types.
+That had two flaws: the type and size are redundant, and there was no generic
+way of getting a given operand’s type (as there was no 1:1 mapping between
+instruction types and operands).
+We considered putting the type in some variant of MCInstrDesc instead:
+See <a class="reference external" href="http://llvm.org/PR26576">PR26576</a>: [GlobalISel] Generic MachineInstrs
+need a type but this increases the memory footprint of the related objects</p>
+</div>
+<div class="section" id="register-bank">
+<span id="gmir-regbank"></span><h3><a class="toc-backref" href="#id21">Register Bank</a><a class="headerlink" href="#register-bank" title="Permalink to this headline">¶</a></h3>
+<p>A Register Bank is a set of register classes defined by the target.
+A bank has a size, which is the maximum store size of all covered classes.</p>
+<p>In general, cross-class copies inside a bank are expected to be cheaper than
+copies across banks.  They are also coalesceable by the register coalescer,
+whereas cross-bank copies are not.</p>
+<p>Also, equivalent operations can be performed on different banks using different
+instructions.</p>
+<p>For example, X86 can be seen as having 3 main banks: general-purpose, x87, and
+vector (which could be further split into a bank per domain for single vs
+double precision instructions).</p>
+<p>Register banks are described by a target-provided API,
+<a class="reference internal" href="#api-registerbankinfo"><em>RegisterBankInfo</em></a>.</p>
+</div>
+<div class="section" id="low-level-type">
+<span id="gmir-llt"></span><h3><a class="toc-backref" href="#id22">Low Level Type</a><a class="headerlink" href="#low-level-type" title="Permalink to this headline">¶</a></h3>
+<p>Additionally, every generic virtual register has a type, represented by an
+instance of the <tt class="docutils literal"><span class="pre">LLT</span></tt> class.</p>
+<p>Like <tt class="docutils literal"><span class="pre">EVT</span></tt>/<tt class="docutils literal"><span class="pre">MVT</span></tt>/<tt class="docutils literal"><span class="pre">Type</span></tt>, it has no distinction between unsigned and signed
+integer types.  Furthermore, it also has no distinction between integer and
+floating-point types: it mainly conveys absolutely necessary information, such
+as size and number of vector lanes:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">sN</span></tt> for scalars</li>
+<li><tt class="docutils literal"><span class="pre">pN</span></tt> for pointers</li>
+<li><tt class="docutils literal"><span class="pre"><N</span> <span class="pre">x</span> <span class="pre">sM></span></tt> for vectors</li>
+<li><tt class="docutils literal"><span class="pre">unsized</span></tt> for labels, etc..</li>
+</ul>
+<p><tt class="docutils literal"><span class="pre">LLT</span></tt> is intended to replace the usage of <tt class="docutils literal"><span class="pre">EVT</span></tt> in SelectionDAG.</p>
+<p>Here are some LLT examples and their <tt class="docutils literal"><span class="pre">EVT</span></tt> and <tt class="docutils literal"><span class="pre">Type</span></tt> equivalents:</p>
+<blockquote>
+<div><table border="1" class="docutils">
+<colgroup>
+<col width="22%" />
+<col width="15%" />
+<col width="63%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">LLT</th>
+<th class="head">EVT</th>
+<th class="head">IR Type</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">s1</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i1</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i1</span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">s8</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i8</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i8</span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">s32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i32</span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">s32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">f32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">float</span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">s17</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i17</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i17</span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">s16</span></tt></td>
+<td>N/A</td>
+<td><tt class="docutils literal"><span class="pre">{i8,</span> <span class="pre">i8}</span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">s32</span></tt></td>
+<td>N/A</td>
+<td><tt class="docutils literal"><span class="pre">[4</span> <span class="pre">x</span> <span class="pre">i8]</span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">p0</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">iPTR</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i8*</span></tt>, <tt class="docutils literal"><span class="pre">i32*</span></tt>, <tt class="docutils literal"><span class="pre">%opaque*</span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">p2</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">iPTR</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">i8</span> <span class="pre">addrspace(2)*</span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre"><4</span> <span class="pre">x</span> <span class="pre">s32></span></tt></td>
+<td><tt class="docutils literal"><span class="pre">v4f32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre"><4</span> <span class="pre">x</span> <span class="pre">float></span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">s64</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">v1f64</span></tt></td>
+<td><tt class="docutils literal"><span class="pre"><1</span> <span class="pre">x</span> <span class="pre">double></span></tt></td>
+</tr>
+<tr class="row-odd"><td><tt class="docutils literal"><span class="pre"><3</span> <span class="pre">x</span> <span class="pre">s32></span></tt></td>
+<td><tt class="docutils literal"><span class="pre">v3i32</span></tt></td>
+<td><tt class="docutils literal"><span class="pre"><3</span> <span class="pre">x</span> <span class="pre">i32></span></tt></td>
+</tr>
+<tr class="row-even"><td><tt class="docutils literal"><span class="pre">unsized</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">Other</span></tt></td>
+<td><tt class="docutils literal"><span class="pre">label</span></tt></td>
+</tr>
+</tbody>
+</table>
+</div></blockquote>
+<p>Rationale: instructions already encode a specific interpretation of types
+(e.g., <tt class="docutils literal"><span class="pre">add</span></tt> vs. <tt class="docutils literal"><span class="pre">fadd</span></tt>, or <tt class="docutils literal"><span class="pre">sdiv</span></tt> vs. <tt class="docutils literal"><span class="pre">udiv</span></tt>).  Also encoding that
+information in the type system requires introducing bitcast with no real
+advantage for the selector.</p>
+<p>Pointer types are distinguished by address space.  This matches IR, as opposed
+to SelectionDAG where address space is an attribute on operations.
+This representation better supports pointers having different sizes depending
+on their addressspace.</p>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+Currently, LLT requires at least 2 elements in vectors, but some targets have
+the concept of a ‘1-element vector’.  Representing them as their underlying
+scalar type is a nice simplification.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+Currently, non-generic virtual registers, defined by non-pre-isel-generic
+instructions, cannot have a type, and thus cannot be used by a pre-isel generic
+instruction.  Instead, they are given a type using a COPY.  We could relax that
+and allow types on all vregs: this would reduce the number of MI required when
+emitting target-specific MIR early in the pipeline.  This should purely be
+a compile-time optimization.</p>
+</div>
+</div>
+<div class="section" id="core-pipeline">
+<span id="pipeline"></span><h2><a class="toc-backref" href="#id14">Core Pipeline</a><a class="headerlink" href="#core-pipeline" title="Permalink to this headline">¶</a></h2>
+<p>There are four required passes, regardless of the optimization mode:</p>
+<div class="contents local topic" id="id2">
+<ul class="simple">
+<li><a class="reference internal" href="#irtranslator" id="id23">IRTranslator</a><ul>
+<li><a class="reference internal" href="#api-calllowering" id="id24">API: CallLowering</a></li>
+<li><a class="reference internal" href="#aggregates" id="id25">Aggregates</a></li>
+<li><a class="reference internal" href="#constant-lowering" id="id26">Constant Lowering</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#legalizer" id="id27">Legalizer</a><ul>
+<li><a class="reference internal" href="#api-legalizerinfo" id="id28">API: LegalizerInfo</a></li>
+<li><a class="reference internal" href="#non-power-of-2-types" id="id29">Non-power of 2 types</a></li>
+<li><a class="reference internal" href="#vector-types" id="id30">Vector types</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#regbankselect" id="id31">RegBankSelect</a><ul>
+<li><a class="reference internal" href="#api-registerbankinfo" id="id32">API: RegisterBankInfo</a></li>
+<li><a class="reference internal" href="#regbankselect-modes" id="id33">RegBankSelect Modes</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#instructionselect" id="id34">InstructionSelect</a><ul>
+<li><a class="reference internal" href="#api-instructionselector" id="id35">API: InstructionSelector</a></li>
+<li><a class="reference internal" href="#selectiondag-rule-imports" id="id36">SelectionDAG Rule Imports</a></li>
+<li><a class="reference internal" href="#patleaf-predicates" id="id37">PatLeaf Predicates</a></li>
+<li><a class="reference internal" href="#custom-sdnodes" id="id38">Custom SDNodes</a></li>
+<li><a class="reference internal" href="#complexpatterns" id="id39">ComplexPatterns</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<p>Additional passes can then be inserted at higher optimization levels or for
+specific targets. For example, to match the current SelectionDAG set of
+transformations: MachineCSE and a better MachineCombiner between every pass.</p>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+In theory, not all passes are always necessary.
+As an additional compile-time optimization, we could skip some of the passes by
+setting the relevant MachineFunction properties.  For instance, if the
+IRTranslator did not encounter any illegal instruction, it would set the
+<tt class="docutils literal"><span class="pre">legalized</span></tt> property to avoid running the <a class="reference internal" href="#milegalizer"><em>Legalizer</em></a>.
+Similarly, we considered specializing the IRTranslator per-target to directly
+emit target-specific MI.
+However, we instead decided to keep the core pipeline simple, and focus on
+minimizing the overhead of the passes in the no-op cases.</p>
+<div class="section" id="irtranslator">
+<span id="id3"></span><h3><a class="toc-backref" href="#id23">IRTranslator</a><a class="headerlink" href="#irtranslator" title="Permalink to this headline">¶</a></h3>
+<p>This pass translates the input LLVM IR <tt class="docutils literal"><span class="pre">Function</span></tt> to a GMIR
+<tt class="docutils literal"><span class="pre">MachineFunction</span></tt>.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+This currently doesn’t support the more complex instructions, in particular
+those involving control flow (<tt class="docutils literal"><span class="pre">switch</span></tt>, <tt class="docutils literal"><span class="pre">invoke</span></tt>, ...).
+For <tt class="docutils literal"><span class="pre">switch</span></tt> in particular, we can initially use the <tt class="docutils literal"><span class="pre">LowerSwitch</span></tt> pass.</p>
+<div class="section" id="api-calllowering">
+<span id="id4"></span><h4><a class="toc-backref" href="#id24">API: CallLowering</a><a class="headerlink" href="#api-calllowering" title="Permalink to this headline">¶</a></h4>
+<p>The <tt class="docutils literal"><span class="pre">IRTranslator</span></tt> (using the <tt class="docutils literal"><span class="pre">CallLowering</span></tt> target-provided utility) also
+implements the ABI’s calling convention by lowering calls, returns, and
+arguments to the appropriate physical register usage and instruction sequences.</p>
+</div>
+<div class="section" id="aggregates">
+<span id="irtranslator-aggregates"></span><h4><a class="toc-backref" href="#id25">Aggregates</a><a class="headerlink" href="#aggregates" title="Permalink to this headline">¶</a></h4>
+<p>Aggregates are lowered to a single scalar vreg.
+This differs from SelectionDAG’s multiple vregs via <tt class="docutils literal"><span class="pre">GetValueVTs</span></tt>.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+As some of the bits are undef (padding), we should consider augmenting the
+representation with additional metadata (in effect, caching computeKnownBits
+information on vregs).
+See <a class="reference external" href="http://llvm.org/PR26161">PR26161</a>: [GlobalISel] Value to vreg during
+IR to MachineInstr translation for aggregate type</p>
+</div>
+<div class="section" id="constant-lowering">
+<span id="irtranslator-constants"></span><h4><a class="toc-backref" href="#id26">Constant Lowering</a><a class="headerlink" href="#constant-lowering" title="Permalink to this headline">¶</a></h4>
+<p>The <tt class="docutils literal"><span class="pre">IRTranslator</span></tt> lowers <tt class="docutils literal"><span class="pre">Constant</span></tt> operands into uses of gvregs defined
+by <tt class="docutils literal"><span class="pre">G_CONSTANT</span></tt> or <tt class="docutils literal"><span class="pre">G_FCONSTANT</span></tt> instructions.
+Currently, these instructions are always emitted in the entry basic block.
+In a <tt class="docutils literal"><span class="pre">MachineFunction</span></tt>, each <tt class="docutils literal"><span class="pre">Constant</span></tt> is materialized by a single gvreg.</p>
+<p>This is beneficial as it allows us to fold constants into immediate operands
+during <a class="reference internal" href="#instructionselect"><em>InstructionSelect</em></a>, while still avoiding redundant materializations
+for expensive non-foldable constants.
+However, this can lead to unnecessary spills and reloads in an -O0 pipeline, as
+these vregs can have long live ranges.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+We’re investigating better placement of these instructions, in fast and
+optimized modes.</p>
+</div>
+</div>
+<div class="section" id="legalizer">
+<span id="milegalizer"></span><h3><a class="toc-backref" href="#id27">Legalizer</a><a class="headerlink" href="#legalizer" title="Permalink to this headline">¶</a></h3>
+<p>This pass transforms the generic machine instructions such that they are legal.</p>
+<p>A legal instruction is defined as:</p>
+<ul class="simple">
+<li><strong>selectable</strong> — the target will later be able to select it to a
+target-specific (non-generic) instruction.</li>
+<li>operating on <strong>vregs that can be loaded and stored</strong> – if necessary, the
+target can select a <tt class="docutils literal"><span class="pre">G_LOAD</span></tt>/<tt class="docutils literal"><span class="pre">G_STORE</span></tt> of each gvreg operand.</li>
+</ul>
+<p>As opposed to SelectionDAG, there are no legalization phases.  In particular,
+‘type’ and ‘operation’ legalization are not separate.</p>
+<p>Legalization is iterative, and all state is contained in GMIR.  To maintain the
+validity of the intermediate code, instructions are introduced:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">G_MERGE_VALUES</span></tt> — concatenate multiple registers of the same
+size into a single wider register.</li>
+<li><tt class="docutils literal"><span class="pre">G_UNMERGE_VALUES</span></tt> — extract multiple registers of the same size
+from a single wider register.</li>
+<li><tt class="docutils literal"><span class="pre">G_EXTRACT</span></tt> — extract a simple register (as contiguous sequences of bits)
+from a single wider register.</li>
+</ul>
+<p>As they are expected to be temporary byproducts of the legalization process,
+they are combined at the end of the <a class="reference internal" href="#milegalizer"><em>Legalizer</em></a> pass.
+If any remain, they are expected to always be selectable, using loads and stores
+if necessary.</p>
+<div class="section" id="api-legalizerinfo">
+<span id="id5"></span><h4><a class="toc-backref" href="#id28">API: LegalizerInfo</a><a class="headerlink" href="#api-legalizerinfo" title="Permalink to this headline">¶</a></h4>
+<p>Currently the API is broadly similar to SelectionDAG/TargetLowering, but
+extended in two ways:</p>
+<ul class="simple">
+<li>The set of available actions is wider, avoiding the currently very
+overloaded <tt class="docutils literal"><span class="pre">Expand</span></tt> (which can cover everything from libcalls to
+scalarization depending on the node’s opcode).</li>
+<li>Since there’s no separate type legalization, independently varying
+types on an instruction can have independent actions. For example a
+<tt class="docutils literal"><span class="pre">G_ICMP</span></tt> has 2 independent types: the result and the inputs; we need
+to be able to say that comparing 2 s32s is OK, but the s1 result
+must be dealt with in another way.</li>
+</ul>
+<p>As such, the primary key when deciding what to do is the <tt class="docutils literal"><span class="pre">InstrAspect</span></tt>,
+essentially a tuple consisting of <tt class="docutils literal"><span class="pre">(Opcode,</span> <span class="pre">TypeIdx,</span> <span class="pre">Type)</span></tt> and mapping to a
+suggested course of action.</p>
+<p>An example use might be:</p>
+<blockquote>
+<div><div class="highlight-c++"><div class="highlight"><pre><span class="c1">// The CPU can't deal with an s1 result, do something about it.</span>
+<span class="n">setAction</span><span class="p">({</span><span class="n">G_ICMP</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">s1</span><span class="p">},</span> <span class="n">WidenScalar</span><span class="p">);</span>
+<span class="c1">// An s32 input (the second type) is fine though.</span>
+<span class="n">setAction</span><span class="p">({</span><span class="n">G_ICMP</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s32</span><span class="p">},</span> <span class="n">Legal</span><span class="p">);</span>
+</pre></div>
+</div>
+</div></blockquote>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+An alternative worth investigating is to generalize the API to represent
+actions using <tt class="docutils literal"><span class="pre">std::function</span></tt> that implements the action, instead of explicit
+enum tokens (<tt class="docutils literal"><span class="pre">Legal</span></tt>, <tt class="docutils literal"><span class="pre">WidenScalar</span></tt>, ...).</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+Moreover, we could use TableGen to initially infer legality of operation from
+existing patterns (as any pattern we can select is by definition legal).
+Expanding that to describe legalization actions is a much larger but
+potentially useful project.</p>
+</div>
+<div class="section" id="non-power-of-2-types">
+<span id="milegalizer-non-power-of-2"></span><h4><a class="toc-backref" href="#id29">Non-power of 2 types</a><a class="headerlink" href="#non-power-of-2-types" title="Permalink to this headline">¶</a></h4>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+Types which have a size that isn’t a power of 2 aren’t currently supported.
+The setAction API will probably require changes to support them.
+Even notionally explicitly specified operations only make suggestions
+like “Widen” or “Narrow”. The eventual type is still unspecified and a
+search is performed by repeated doubling/halving of the type’s
+size.
+This is incorrect for types that aren’t a power of 2.  It’s reasonable to
+expect we could construct an efficient set of side-tables for more general
+lookups though, encoding a map from the integers (i.e. the size of the current
+type) to types (the legal size).</p>
+</div>
+<div class="section" id="vector-types">
+<span id="milegalizer-vector"></span><h4><a class="toc-backref" href="#id30">Vector types</a><a class="headerlink" href="#vector-types" title="Permalink to this headline">¶</a></h4>
+<p>Vectors first get their element type legalized: <tt class="docutils literal"><span class="pre"><A</span> <span class="pre">x</span> <span class="pre">sB></span></tt> becomes
+<tt class="docutils literal"><span class="pre"><A</span> <span class="pre">x</span> <span class="pre">sC></span></tt> such that at least one operation is legal with <tt class="docutils literal"><span class="pre">sC</span></tt>.</p>
+<p>This is currently specified by the function <tt class="docutils literal"><span class="pre">setScalarInVectorAction</span></tt>, called
+for example as:</p>
+<blockquote>
+<div>setScalarInVectorAction(G_ICMP, s1, WidenScalar);</div></blockquote>
+<p>Next the number of elements is chosen so that the entire operation is
+legal. This aspect is not controllable at the moment, but probably
+should be (you could imagine disagreements on whether a <tt class="docutils literal"><span class="pre"><2</span> <span class="pre">x</span> <span class="pre">s8></span></tt>
+operation should be scalarized or extended to <tt class="docutils literal"><span class="pre"><8</span> <span class="pre">x</span> <span class="pre">s8></span></tt>).</p>
+</div>
+</div>
+<div class="section" id="regbankselect">
+<span id="id6"></span><h3><a class="toc-backref" href="#id31">RegBankSelect</a><a class="headerlink" href="#regbankselect" title="Permalink to this headline">¶</a></h3>
+<p>This pass constrains the <a class="reference internal" href="#gmir-gvregs"><em>Generic Virtual Registers</em></a> operands of generic
+instructions to some <a class="reference internal" href="#gmir-regbank"><em>Register Bank</em></a>.</p>
+<p>It iteratively maps instructions to a set of per-operand bank assignment.
+The possible mappings are determined by the target-provided
+<a class="reference internal" href="#api-registerbankinfo"><em>RegisterBankInfo</em></a>.
+The mapping is then applied, possibly introducing <tt class="docutils literal"><span class="pre">COPY</span></tt> instructions if
+necessary.</p>
+<p>It traverses the <tt class="docutils literal"><span class="pre">MachineFunction</span></tt> top down so that all operands are already
+mapped when analyzing an instruction.</p>
+<p>This pass could also remap target-specific instructions when beneficial.
+In the future, this could replace the ExeDepsFix pass, as we can directly
+select the best variant for an instruction that’s available on multiple banks.</p>
+<div class="section" id="api-registerbankinfo">
+<span id="id7"></span><h4><a class="toc-backref" href="#id32">API: RegisterBankInfo</a><a class="headerlink" href="#api-registerbankinfo" title="Permalink to this headline">¶</a></h4>
+<p>The <tt class="docutils literal"><span class="pre">RegisterBankInfo</span></tt> class describes multiple aspects of register banks.</p>
+<ul class="simple">
+<li><strong>Banks</strong>: <tt class="docutils literal"><span class="pre">addRegBankCoverage</span></tt> — which register bank covers each
+register class.</li>
+<li><strong>Cross-Bank Copies</strong>: <tt class="docutils literal"><span class="pre">copyCost</span></tt> — the cost of a <tt class="docutils literal"><span class="pre">COPY</span></tt> from one bank
+to another.</li>
+<li><strong>Default Mapping</strong>: <tt class="docutils literal"><span class="pre">getInstrMapping</span></tt> — the default bank assignments for
+a given instruction.</li>
+<li><strong>Alternative Mapping</strong>: <tt class="docutils literal"><span class="pre">getInstrAlternativeMapping</span></tt> — the other
+possible bank assignments for a given instruction.</li>
+</ul>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+All this information should eventually be static and generated by TableGen,
+mostly using existing information augmented by bank descriptions.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+<tt class="docutils literal"><span class="pre">getInstrMapping</span></tt> is currently separate from <tt class="docutils literal"><span class="pre">getInstrAlternativeMapping</span></tt>
+because the latter is more expensive: as we move to static mapping info,
+both methods should be free, and we should merge them.</p>
+</div>
+<div class="section" id="regbankselect-modes">
+<span id="id8"></span><h4><a class="toc-backref" href="#id33">RegBankSelect Modes</a><a class="headerlink" href="#regbankselect-modes" title="Permalink to this headline">¶</a></h4>
+<p><tt class="docutils literal"><span class="pre">RegBankSelect</span></tt> currently has two modes:</p>
+<ul class="simple">
+<li><strong>Fast</strong> — For each instruction, pick a target-provided “default” bank
+assignment.  This is the default at -O0.</li>
+<li><strong>Greedy</strong> — For each instruction, pick the cheapest of several
+target-provided bank assignment alternatives.</li>
+</ul>
+<p>We intend to eventually introduce an additional optimizing mode:</p>
+<ul class="simple">
+<li><strong>Global</strong> — Across multiple instructions, pick the cheapest combination of
+bank assignments.</li>
+</ul>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+On AArch64, we are considering using the Greedy mode even at -O0 (or perhaps at
+backend -O1):  because <a class="reference internal" href="#gmir-llt"><em>Low Level Type</em></a> doesn’t distinguish floating point from
+integer scalars, the default assignment for loads and stores is the integer
+bank, introducing cross-bank copies on most floating point operations.</p>
+</div>
+</div>
+<div class="section" id="instructionselect">
+<span id="id9"></span><h3><a class="toc-backref" href="#id34">InstructionSelect</a><a class="headerlink" href="#instructionselect" title="Permalink to this headline">¶</a></h3>
+<p>This pass transforms generic machine instructions into equivalent
+target-specific instructions.  It traverses the <tt class="docutils literal"><span class="pre">MachineFunction</span></tt> bottom-up,
+selecting uses before definitions, enabling trivial dead code elimination.</p>
+<div class="section" id="api-instructionselector">
+<span id="id10"></span><h4><a class="toc-backref" href="#id35">API: InstructionSelector</a><a class="headerlink" href="#api-instructionselector" title="Permalink to this headline">¶</a></h4>
+<p>The target implements the <tt class="docutils literal"><span class="pre">InstructionSelector</span></tt> class, containing the
+target-specific selection logic proper.</p>
+<p>The instance is provided by the subtarget, so that it can specialize the
+selector by subtarget feature (with, e.g., a vector selector overriding parts
+of a general-purpose common selector).
+We might also want to parameterize it by MachineFunction, to enable selector
+variants based on function attributes like optsize.</p>
+<p>The simple API consists of:</p>
+<blockquote>
+<div><div class="highlight-c++"><div class="highlight"><pre><span class="k">virtual</span> <span class="kt">bool</span> <span class="n">select</span><span class="p">(</span><span class="n">MachineInstr</span> <span class="o">&</span><span class="n">MI</span><span class="p">)</span>
+</pre></div>
+</div>
+</div></blockquote>
+<p>This target-provided method is responsible for mutating (or replacing) a
+possibly-generic MI into a fully target-specific equivalent.
+It is also responsible for doing the necessary constraining of gvregs into the
+appropriate register classes as well as passing through COPY instructions to
+the register allocator.</p>
+<p>The <tt class="docutils literal"><span class="pre">InstructionSelector</span></tt> can fold other instructions into the selected MI,
+by walking the use-def chain of the vreg operands.
+As GlobalISel is Global, this folding can occur across basic blocks.</p>
+</div>
+<div class="section" id="selectiondag-rule-imports">
+<h4><a class="toc-backref" href="#id36">SelectionDAG Rule Imports</a><a class="headerlink" href="#selectiondag-rule-imports" title="Permalink to this headline">¶</a></h4>
+<p>TableGen will import SelectionDAG rules and provide the following function to
+execute them:</p>
+<blockquote>
+<div><div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="n">selectImpl</span><span class="p">(</span><span class="n">MachineInstr</span> <span class="o">&</span><span class="n">MI</span><span class="p">)</span>
+</pre></div>
+</div>
+</div></blockquote>
+<p>The <tt class="docutils literal"><span class="pre">--stats</span></tt> option can be used to determine what proportion of rules were
+successfully imported. The easiest way to use this is to copy the
+<tt class="docutils literal"><span class="pre">-gen-globalisel</span></tt> tablegen command from <tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">-v</span></tt> and modify it.</p>
+<p>Similarly, the <tt class="docutils literal"><span class="pre">--warn-on-skipped-patterns</span></tt> option can be used to obtain the
+reasons that rules weren’t imported. This can be used to focus on the most
+important rejection reasons.</p>
+</div>
+<div class="section" id="patleaf-predicates">
+<h4><a class="toc-backref" href="#id37">PatLeaf Predicates</a><a class="headerlink" href="#patleaf-predicates" title="Permalink to this headline">¶</a></h4>
+<p>PatLeafs cannot be imported because their C++ is implemented in terms of
+<tt class="docutils literal"><span class="pre">SDNode</span></tt> objects. PatLeafs that handle immediate predicates should be
+replaced by <tt class="docutils literal"><span class="pre">ImmLeaf</span></tt>, <tt class="docutils literal"><span class="pre">IntImmLeaf</span></tt>, or <tt class="docutils literal"><span class="pre">FPImmLeaf</span></tt> as appropriate.</p>
+<p>There’s no standard answer for other PatLeafs. Some standard predicates have
+been baked into TableGen but this should not generally be done.</p>
+</div>
+<div class="section" id="custom-sdnodes">
+<h4><a class="toc-backref" href="#id38">Custom SDNodes</a><a class="headerlink" href="#custom-sdnodes" title="Permalink to this headline">¶</a></h4>
+<p>Custom SDNodes should be mapped to Target Pseudos using <tt class="docutils literal"><span class="pre">GINodeEquiv</span></tt>. This
+will cause the instruction selector to import them but you will also need to
+ensure the target pseudo is introduced to the MIR before the instruction
+selector. Any preceeding pass is suitable but the legalizer will be a
+particularly common choice.</p>
+</div>
+<div class="section" id="complexpatterns">
+<h4><a class="toc-backref" href="#id39">ComplexPatterns</a><a class="headerlink" href="#complexpatterns" title="Permalink to this headline">¶</a></h4>
+<p>ComplexPatterns cannot be imported because their C++ is implemented in terms of
+<tt class="docutils literal"><span class="pre">SDNode</span></tt> objects. GlobalISel versions should be defined with
+<tt class="docutils literal"><span class="pre">GIComplexOperandMatcher</span></tt> and mapped to ComplexPattern with
+<tt class="docutils literal"><span class="pre">GIComplexPatternEquiv</span></tt>.</p>
+<p>The following predicates are useful for porting ComplexPattern:</p>
+<ul class="simple">
+<li>isBaseWithConstantOffset() - Check for base+offset structures</li>
+<li>isOperandImmEqual() - Check for a particular constant</li>
+<li>isObviouslySafeToFold() - Check for reasons an instruction can’t be sunk and folded into another.</li>
+</ul>
+<p>There are some important points for the C++ implementation:</p>
+<ul class="simple">
+<li>Don’t modify MIR in the predicate</li>
+<li>Renderer lambdas should capture by value to avoid use-after-free. They will be used after the predicate returns.</li>
+<li>Only create instructions in a renderer lambda. GlobalISel won’t clean up things you create but don’t use.</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="section" id="maintainability">
+<span id="id11"></span><h2><a class="toc-backref" href="#id15">Maintainability</a><a class="headerlink" href="#maintainability" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="iterative-transformations">
+<span id="maintainability-iterative"></span><h3>Iterative Transformations<a class="headerlink" href="#iterative-transformations" title="Permalink to this headline">¶</a></h3>
+<p>Passes are split into small, iterative transformations, with all state
+represented in the MIR.</p>
+<p>This differs from SelectionDAG (in particular, the legalizer) using various
+in-memory side-tables.</p>
+</div>
+<div class="section" id="mir-serialization">
+<span id="maintainability-mir"></span><h3>MIR Serialization<a class="headerlink" href="#mir-serialization" title="Permalink to this headline">¶</a></h3>
+<p><a class="reference internal" href="#gmir"><em>Generic Machine IR</em></a> is serializable (see <a class="reference internal" href="MIRLangRef.html"><em>Machine IR (MIR) Format Reference Manual</em></a>).
+Combined with <a class="reference internal" href="#maintainability-iterative"><em>Iterative Transformations</em></a>, this enables much finer-grained
+testing, rather than requiring large and fragile IR-to-assembly tests.</p>
+<p>The current “stage” in the <a class="reference internal" href="#pipeline"><em>Core Pipeline</em></a> is represented by a set of
+<tt class="docutils literal"><span class="pre">MachineFunctionProperties</span></tt>:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">legalized</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">regBankSelected</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">selected</span></tt></li>
+</ul>
+</div>
+<div class="section" id="machineverifier">
+<span id="maintainability-verifier"></span><h3>MachineVerifier<a class="headerlink" href="#machineverifier" title="Permalink to this headline">¶</a></h3>
+<p>The pass approach lets us use the <tt class="docutils literal"><span class="pre">MachineVerifier</span></tt> to enforce invariants.
+For instance, a <tt class="docutils literal"><span class="pre">regBankSelected</span></tt> function may not have gvregs without
+a bank.</p>
+<p><tt class="docutils literal"><span class="pre">TODO</span></tt>:
+The <tt class="docutils literal"><span class="pre">MachineVerifier</span></tt> being monolithic, some of the checks we want to do
+can’t be integrated to it:  GlobalISel is a separate library, so we can’t
+directly reference it from CodeGen.  For instance, legality checks are
+currently done in RegBankSelect/InstructionSelect proper.  We could #ifdef out
+the checks, or we could add some sort of verifier API.</p>
+</div>
+</div>
+<div class="section" id="progress-and-future-work">
+<span id="progress"></span><h2><a class="toc-backref" href="#id16">Progress and Future Work</a><a class="headerlink" href="#progress-and-future-work" title="Permalink to this headline">¶</a></h2>
+<p>The initial goal is to replace FastISel on AArch64.  The next step will be to
+replace SelectionDAG as the optimized ISel.</p>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+While we iterate on GlobalISel, we strive to avoid affecting the performance of
+SelectionDAG, FastISel, or the other MIR passes.  For instance, the types of
+<a class="reference internal" href="#gmir-gvregs"><em>Generic Virtual Registers</em></a> are stored in a separate table in <tt class="docutils literal"><span class="pre">MachineRegisterInfo</span></tt>,
+that is destroyed after <a class="reference internal" href="#instructionselect"><em>InstructionSelect</em></a>.</p>
+<div class="section" id="fastisel-replacement">
+<span id="progress-fastisel"></span><h3>FastISel Replacement<a class="headerlink" href="#fastisel-replacement" title="Permalink to this headline">¶</a></h3>
+<p>For the initial FastISel replacement, we intend to fallback to SelectionDAG on
+selection failures.</p>
+<p>Currently, compile-time of the fast pipeline is within 1.5x of FastISel.
+We’re optimistic we can get to within 1.1/1.2x, but beating FastISel will be
+challenging given the multi-pass approach.
+Still, supporting all IR (via a complete legalizer) and avoiding the fallback
+to SelectionDAG in the worst case should enable better amortized performance
+than SelectionDAG+FastISel.</p>
+<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>:
+We considered never having a fallback to SelectionDAG, instead deciding early
+whether a given function is supported by GlobalISel or not.  The decision would
+be based on <a class="reference internal" href="#milegalizer"><em>Legalizer</em></a> queries.
+We abandoned that for two reasons:
+a) on IR inputs, we’d need to basically simulate the <a class="reference internal" href="#irtranslator"><em>IRTranslator</em></a>;
+b) to be robust against unforeseen failures and to enable iterative
+improvements.</p>
+</div>
+<div class="section" id="support-for-other-targets">
+<span id="progress-targets"></span><h3>Support For Other Targets<a class="headerlink" href="#support-for-other-targets" title="Permalink to this headline">¶</a></h3>
+<p>In parallel, we’re investigating adding support for other - ideally quite
+different - targets.  For instance, there is some initial AMDGPU support.</p>
+</div>
+</div>
+<div class="section" id="porting-globalisel-to-a-new-target">
+<span id="porting"></span><h2><a class="toc-backref" href="#id17">Porting GlobalISel to A New Target</a><a class="headerlink" href="#porting-globalisel-to-a-new-target" title="Permalink to this headline">¶</a></h2>
+<p>There are four major classes to implement by the target:</p>
+<ul class="simple">
+<li><a class="reference internal" href="#api-calllowering"><em>CallLowering</em></a> — lower calls, returns, and arguments
+according to the ABI.</li>
+<li><a class="reference internal" href="#api-registerbankinfo"><em>RegisterBankInfo</em></a> — describe
+<a class="reference internal" href="#gmir-regbank"><em>Register Bank</em></a> coverage, cross-bank copy cost, and the mapping of
+operands onto banks for each instruction.</li>
+<li><a class="reference internal" href="#api-legalizerinfo"><em>LegalizerInfo</em></a> — describe what is legal, and how
+to legalize what isn’t.</li>
+<li><a class="reference internal" href="#api-instructionselector"><em>InstructionSelector</em></a> — select generic MIR
+to target-specific MIR.</li>
+</ul>
+<p>Additionally:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">TargetPassConfig</span></tt> — create the passes constituting the pipeline,
+including additional passes not included in the <a class="reference internal" href="#pipeline"><em>Core Pipeline</em></a>.</li>
+</ul>
+</div>
+<div class="section" id="resources">
+<span id="other-resources"></span><h2><a class="toc-backref" href="#id18">Resources</a><a class="headerlink" href="#resources" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li><a class="reference external" href="https://www.youtube.com/watch?v=F6GGbYtae3g">Global Instruction Selection - A Proposal by Quentin Colombet @LLVMDevMeeting 2015</a></li>
+<li><a class="reference external" href="https://www.youtube.com/watch?v=6tfb344A7w8">Global Instruction Selection - Status by Quentin Colombet, Ahmed Bougacha, and Tim Northover @LLVMDevMeeting 2016</a></li>
+<li><a class="reference external" href="https://www.youtube.com/watch?v=d6dF6E4BPeU">GlobalISel - LLVM’s Latest Instruction Selection Framework by Diana Picus @FOSDEM17</a></li>
+<li>GlobalISel: Past, Present, and Future by Quentin Colombet and Ahmed Bougacha @LLVMDevMeeting 2017</li>
+<li>Head First into GlobalISel by Daniel Sanders, Aditya Nandakumar, and Justin Bogner @LLVMDevMeeting 2017</li>
+</ul>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="XRay.html" title="XRay Instrumentation"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="Coroutines.html" title="Coroutines in LLVM"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/GoldPlugin.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/GoldPlugin.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/GoldPlugin.html (added)
+++ www-releases/trunk/7.0.1/docs/GoldPlugin.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,258 @@
+
+
+<!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>The LLVM gold plugin — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="LLVM’s Optional Rich Disassembly Output" href="MarkedUpDisassembly.html" />
+    <link rel="prev" title="Debugging JIT-ed Code With GDB" href="DebuggingJITedCode.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="MarkedUpDisassembly.html" title="LLVM’s Optional Rich Disassembly Output"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="DebuggingJITedCode.html" title="Debugging JIT-ed Code With GDB"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="the-llvm-gold-plugin">
+<h1>The LLVM gold plugin<a class="headerlink" href="#the-llvm-gold-plugin" 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>Building with link time optimization requires cooperation from
+the system linker. LTO support on Linux systems is available via the
+<a class="reference external" href="http://sourceware.org/binutils">gold linker</a> which supports LTO via plugins. This is the same mechanism
+used by the <a class="reference external" href="http://gcc.gnu.org/wiki/LinkTimeOptimization">GCC LTO</a> project.</p>
+<p>The LLVM gold plugin implements the gold plugin interface on top of
+<a class="reference internal" href="LinkTimeOptimization.html#liblto"><em>libLTO</em></a>.  The same plugin can also be used by other tools such as
+<tt class="docutils literal"><span class="pre">ar</span></tt> and <tt class="docutils literal"><span class="pre">nm</span></tt>.  Note that ld.bfd from binutils version 2.21.51.0.2
+and above also supports LTO via plugins.  However, usage of the LLVM
+gold plugin with ld.bfd is not tested and therefore not officially
+supported or recommended.</p>
+</div>
+<div class="section" id="how-to-build-it">
+<span id="lto-how-to-build"></span><h2>How to build it<a class="headerlink" href="#how-to-build-it" title="Permalink to this headline">¶</a></h2>
+<p>You need to have gold with plugin support and build the LLVMgold plugin.
+The gold linker is installed as ld.gold. To see whether gold is the default
+on your system, run <tt class="docutils literal"><span class="pre">/usr/bin/ld</span> <span class="pre">-v</span></tt>. It will report “GNU
+gold” or else “GNU ld” if not. If gold is already installed at
+<tt class="docutils literal"><span class="pre">/usr/bin/ld.gold</span></tt>, one option is to simply make that the default by
+backing up your existing <tt class="docutils literal"><span class="pre">/usr/bin/ld</span></tt> and creating a symbolic link
+with <tt class="docutils literal"><span class="pre">ln</span> <span class="pre">-s</span> <span class="pre">/usr/bin/ld.gold</span> <span class="pre">/usr/bin/ld</span></tt>. Alternatively, you can build
+with clang’s <tt class="docutils literal"><span class="pre">-fuse-ld=gold</span></tt> or add <tt class="docutils literal"><span class="pre">-fuse-ld=gold</span></tt> to LDFLAGS, which will
+cause the clang driver to invoke <tt class="docutils literal"><span class="pre">/usr/bin/ld.gold</span></tt> directly.</p>
+<p>If you have gold installed, check for plugin support by running
+<tt class="docutils literal"><span class="pre">/usr/bin/ld.gold</span> <span class="pre">-plugin</span></tt>. If it complains “missing argument” then
+you have plugin support. If not, and you get an error such as “unknown option”,
+then you will either need to build gold or install a version with plugin
+support.</p>
+<ul>
+<li><p class="first">Download, configure and build gold with plugin support:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils
+<span class="nv">$ </span>mkdir build
+<span class="nv">$ </span><span class="nb">cd </span>build
+<span class="nv">$ </span>../binutils/configure --enable-gold --enable-plugins --disable-werror
+<span class="nv">$ </span>make all-gold
+</pre></div>
+</div>
+<p>That should leave you with <tt class="docutils literal"><span class="pre">build/gold/ld-new</span></tt> which supports
+the <tt class="docutils literal"><span class="pre">-plugin</span></tt> option. Running <tt class="docutils literal"><span class="pre">make</span></tt> will additionally build
+<tt class="docutils literal"><span class="pre">build/binutils/ar</span></tt> and <tt class="docutils literal"><span class="pre">nm-new</span></tt> binaries supporting plugins.</p>
+<p>Once you’re ready to switch to using gold, backup your existing
+<tt class="docutils literal"><span class="pre">/usr/bin/ld</span></tt> then replace it with <tt class="docutils literal"><span class="pre">ld-new</span></tt>. Alternatively, install
+in <tt class="docutils literal"><span class="pre">/usr/bin/ld.gold</span></tt> and use <tt class="docutils literal"><span class="pre">-fuse-ld=gold</span></tt> as described earlier.</p>
+<p>Optionally, add <tt class="docutils literal"><span class="pre">--enable=gold=default</span></tt> to the above configure invocation
+to automatically install the newly built gold as the default linker with
+<tt class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></tt>.</p>
+</li>
+<li><p class="first">Build the LLVMgold plugin. Run CMake with
+<tt class="docutils literal"><span class="pre">-DLLVM_BINUTILS_INCDIR=/path/to/binutils/include</span></tt>.  The correct include
+path will contain the file <tt class="docutils literal"><span class="pre">plugin-api.h</span></tt>.</p>
+</li>
+</ul>
+</div>
+<div class="section" id="usage">
+<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
+<p>You should produce bitcode files from <tt class="docutils literal"><span class="pre">clang</span></tt> with the option
+<tt class="docutils literal"><span class="pre">-flto</span></tt>. This flag will also cause <tt class="docutils literal"><span class="pre">clang</span></tt> to look for the gold plugin in
+the <tt class="docutils literal"><span class="pre">lib</span></tt> directory under its prefix and pass the <tt class="docutils literal"><span class="pre">-plugin</span></tt> option to
+<tt class="docutils literal"><span class="pre">ld</span></tt>. It will not look for an alternate linker without <tt class="docutils literal"><span class="pre">-fuse-ld=gold</span></tt>,
+which is why you otherwise need gold to be the installed system linker in
+your path.</p>
+<p><tt class="docutils literal"><span class="pre">ar</span></tt> and <tt class="docutils literal"><span class="pre">nm</span></tt> also accept the <tt class="docutils literal"><span class="pre">-plugin</span></tt> option and it’s possible to
+to install <tt class="docutils literal"><span class="pre">LLVMgold.so</span></tt> to <tt class="docutils literal"><span class="pre">/usr/lib/bfd-plugins</span></tt> for a seamless setup.
+If you built your own gold, be sure to install the <tt class="docutils literal"><span class="pre">ar</span></tt> and <tt class="docutils literal"><span class="pre">nm-new</span></tt> you
+built to <tt class="docutils literal"><span class="pre">/usr/bin</span></tt>.</p>
+<div class="section" id="example-of-link-time-optimization">
+<h3>Example of link time optimization<a class="headerlink" href="#example-of-link-time-optimization" title="Permalink to this headline">¶</a></h3>
+<p>The following example shows a worked example of the gold plugin mixing LLVM
+bitcode and native code.</p>
+<div class="highlight-c"><div class="highlight"><pre><span class="o">---</span> <span class="n">a</span><span class="p">.</span><span class="n">c</span> <span class="o">---</span>
+<span class="cp">#include <stdio.h></span>
+
+<span class="k">extern</span> <span class="kt">void</span> <span class="n">foo1</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+<span class="k">extern</span> <span class="kt">void</span> <span class="n">foo4</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+
+<span class="kt">void</span> <span class="nf">foo2</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">printf</span><span class="p">(</span><span class="s">"Foo2</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="kt">void</span> <span class="nf">foo3</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">foo4</span><span class="p">();</span>
+<span class="p">}</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="n">foo1</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="o">---</span> <span class="n">b</span><span class="p">.</span><span class="n">c</span> <span class="o">---</span>
+<span class="cp">#include <stdio.h></span>
+
+<span class="k">extern</span> <span class="kt">void</span> <span class="n">foo2</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+
+<span class="kt">void</span> <span class="nf">foo1</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">foo2</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="kt">void</span> <span class="nf">foo4</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">printf</span><span class="p">(</span><span class="s">"Foo4"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<div class="highlight-bash"><div class="highlight"><pre>--- <span class="nb">command </span>lines ---
+<span class="nv">$ </span>clang -flto a.c -c -o a.o      <span class="c"># <-- a.o is LLVM bitcode file</span>
+<span class="nv">$ </span>ar q a.a a.o                   <span class="c"># <-- a.a is an archive with LLVM bitcode</span>
+<span class="nv">$ </span>clang b.c -c -o b.o            <span class="c"># <-- b.o is native object file</span>
+<span class="nv">$ </span>clang -flto a.a b.o -o main    <span class="c"># <-- link with LLVMgold plugin</span>
+</pre></div>
+</div>
+<p>Gold informs the plugin that foo3 is never referenced outside the IR,
+leading LLVM to delete that function. However, unlike in the <a class="reference internal" href="LinkTimeOptimization.html#liblto-example"><em>libLTO
+example</em></a> gold does not currently eliminate foo4.</p>
+</div>
+</div>
+<div class="section" id="quickstart-for-using-lto-with-autotooled-projects">
+<h2>Quickstart for using LTO with autotooled projects<a class="headerlink" href="#quickstart-for-using-lto-with-autotooled-projects" title="Permalink to this headline">¶</a></h2>
+<p>Once your system <tt class="docutils literal"><span class="pre">ld</span></tt>, <tt class="docutils literal"><span class="pre">ar</span></tt>, and <tt class="docutils literal"><span class="pre">nm</span></tt> all support LLVM bitcode,
+everything is in place for an easy to use LTO build of autotooled projects:</p>
+<ul>
+<li><p class="first">Follow the instructions <a class="reference internal" href="#lto-how-to-build"><em>on how to build LLVMgold.so</em></a>.</p>
+</li>
+<li><p class="first">Install the newly built binutils to <tt class="docutils literal"><span class="pre">$PREFIX</span></tt></p>
+</li>
+<li><p class="first">Copy <tt class="docutils literal"><span class="pre">Release/lib/LLVMgold.so</span></tt> to <tt class="docutils literal"><span class="pre">$PREFIX/lib/bfd-plugins/</span></tt></p>
+</li>
+<li><p class="first">Set environment variables (<tt class="docutils literal"><span class="pre">$PREFIX</span></tt> is where you installed clang and
+binutils):</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nb">export </span><span class="nv">CC</span><span class="o">=</span><span class="s2">"$PREFIX/bin/clang -flto"</span>
+<span class="nb">export </span><span class="nv">CXX</span><span class="o">=</span><span class="s2">"$PREFIX/bin/clang++ -flto"</span>
+<span class="nb">export </span><span class="nv">AR</span><span class="o">=</span><span class="s2">"$PREFIX/bin/ar"</span>
+<span class="nb">export </span><span class="nv">NM</span><span class="o">=</span><span class="s2">"$PREFIX/bin/nm"</span>
+<span class="nb">export </span><span class="nv">RANLIB</span><span class="o">=</span>/bin/true <span class="c">#ranlib is not needed, and doesn't support .bc files in .a</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Or you can just set your path:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span><span class="s2">"$PREFIX/bin:$PATH"</span>
+<span class="nb">export </span><span class="nv">CC</span><span class="o">=</span><span class="s2">"clang -flto"</span>
+<span class="nb">export </span><span class="nv">CXX</span><span class="o">=</span><span class="s2">"clang++ -flto"</span>
+<span class="nb">export </span><span class="nv">RANLIB</span><span class="o">=</span>/bin/true
+</pre></div>
+</div>
+</li>
+<li><p class="first">Configure and build the project as usual:</p>
+<div class="highlight-bash"><div class="highlight"><pre>% ./configure <span class="o">&&</span> make <span class="o">&&</span> make check
+</pre></div>
+</div>
+</li>
+</ul>
+<p>The environment variable settings may work for non-autotooled projects too,
+but you may need to set the <tt class="docutils literal"><span class="pre">LD</span></tt> environment variable as well.</p>
+</div>
+<div class="section" id="licensing">
+<h2>Licensing<a class="headerlink" href="#licensing" title="Permalink to this headline">¶</a></h2>
+<p>Gold is licensed under the GPLv3. LLVMgold uses the interface file
+<tt class="docutils literal"><span class="pre">plugin-api.h</span></tt> from gold which means that the resulting <tt class="docutils literal"><span class="pre">LLVMgold.so</span></tt>
+binary is also GPLv3. This can still be used to link non-GPLv3 programs
+just as much as gold could without the plugin.</p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="MarkedUpDisassembly.html" title="LLVM’s Optional Rich Disassembly Output"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="DebuggingJITedCode.html" title="Debugging JIT-ed Code With GDB"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToAddABuilder.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToAddABuilder.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToAddABuilder.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToAddABuilder.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,199 @@
+
+
+<!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 Add Your Build Configuration To LLVM Buildbot Infrastructure — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="yaml2obj" href="yaml2obj.html" />
+    <link rel="prev" title="The LLVM Lexicon" href="Lexicon.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="yaml2obj.html" title="yaml2obj"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="Lexicon.html" title="The LLVM Lexicon"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-add-your-build-configuration-to-llvm-buildbot-infrastructure">
+<h1>How To Add Your Build Configuration To LLVM Buildbot Infrastructure<a class="headerlink" href="#how-to-add-your-build-configuration-to-llvm-buildbot-infrastructure" 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 contains information about adding a build configuration and
+buildslave to private slave builder to LLVM Buildbot Infrastructure.</p>
+</div>
+<div class="section" id="buildmasters">
+<h2>Buildmasters<a class="headerlink" href="#buildmasters" title="Permalink to this headline">¶</a></h2>
+<p>There are two buildmasters running.</p>
+<ul class="simple">
+<li>The main buildmaster at <a class="reference external" href="http://lab.llvm.org:8011">http://lab.llvm.org:8011</a>. All builders attached
+to this machine will notify commit authors every time they break the build.</li>
+<li>The staging buildbot at <a class="reference external" href="http://lab.llvm.org:8014">http://lab.llvm.org:8014</a>. All builders attached
+to this machine will be completely silent by default when the build is broken.
+Builders for experimental backends should generally be attached to this
+buildmaster.</li>
+</ul>
+</div>
+<div class="section" id="steps-to-add-builder-to-llvm-buildbot">
+<h2>Steps To Add Builder To LLVM Buildbot<a class="headerlink" href="#steps-to-add-builder-to-llvm-buildbot" title="Permalink to this headline">¶</a></h2>
+<p>Volunteers can provide their build machines to work as build slaves to
+public LLVM Buildbot.</p>
+<p>Here are the steps you can follow to do so:</p>
+<ol class="arabic">
+<li><p class="first">Check the existing build configurations to make sure the one you are
+interested in is not covered yet or gets built on your computer much
+faster than on the existing one. We prefer faster builds so developers
+will get feedback sooner after changes get committed.</p>
+</li>
+<li><p class="first">The computer you will be registering with the LLVM buildbot
+infrastructure should have all dependencies installed and you can
+actually build your configuration successfully. Please check what degree
+of parallelism (-j param) would give the fastest build.  You can build
+multiple configurations on one computer.</p>
+</li>
+<li><p class="first">Install buildslave (currently we are using buildbot version 0.8.5).
+Depending on the platform, buildslave could be available to download and
+install with your package manager, or you can download it directly from
+<a class="reference external" href="http://trac.buildbot.net">http://trac.buildbot.net</a> and install it manually.</p>
+</li>
+<li><p class="first">Create a designated user account, your buildslave will be running under,
+and set appropriate permissions.</p>
+</li>
+<li><p class="first">Choose the buildslave root directory (all builds will be placed under
+it), buildslave access name and password the build master will be using
+to authenticate your buildslave.</p>
+</li>
+<li><p class="first">Create a buildslave in context of that buildslave account.  Point it to
+the <strong>lab.llvm.org</strong> port <strong>9990</strong> (see <a class="reference external" href="http://docs.buildbot.net/current/tutorial/firstrun.html#creating-a-slave">Buildbot documentation,
+Creating a slave</a>
+for more details) by running the following command:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>buildslave create-slave <buildslave-root-directory> <span class="se">\</span>
+             lab.llvm.org:9990 <span class="se">\</span>
+             <buildslave-access-name> <buildslave-access-password>
+</pre></div>
+</div>
+</div></blockquote>
+<p>To point a slave to silent master please use lab.llvm.org:9994 instead
+of lab.llvm.org:9990.</p>
+</li>
+<li><p class="first">Fill the buildslave description and admin name/e-mail.  Here is an
+example of the buildslave description:</p>
+<div class="highlight-python"><pre>Windows 7 x64
+Core i7 (2.66GHz), 16GB of RAM
+
+g++.exe (TDM-1 mingw32) 4.4.0
+GNU Binutils 2.19.1
+cmake version 2.8.4
+Microsoft(R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86</pre>
+</div>
+</li>
+<li><p class="first">Make sure you can actually start the buildslave successfully. Then set
+up your buildslave to start automatically at the start up time.  See the
+buildbot documentation for help.  You may want to restart your computer
+to see if it works.</p>
+</li>
+<li><p class="first">Send a patch which adds your build slave and your builder to zorg.</p>
+<ul class="simple">
+<li>slaves are added to <tt class="docutils literal"><span class="pre">buildbot/osuosl/master/config/slaves.py</span></tt></li>
+<li>builders are added to <tt class="docutils literal"><span class="pre">buildbot/osuosl/master/config/builders.py</span></tt></li>
+</ul>
+<p>Please make sure your builder name and its builddir are unique through the file.</p>
+<p>It is possible to whitelist email addresses to unconditionally receive notifications
+on build failure; for this you’ll need to add an <tt class="docutils literal"><span class="pre">InformativeMailNotifier</span></tt> to
+<tt class="docutils literal"><span class="pre">buildbot/osuosl/master/config/status.py</span></tt>. This is particularly useful for the
+staging buildmaster which is silent otherwise.</p>
+</li>
+<li><p class="first">Send the buildslave access name and the access password directly to
+<a class="reference external" href="mailto:gkistanova%40gmail.com">Galina Kistanova</a>, and wait till she
+will let you know that your changes are applied and buildmaster is
+reconfigured.</p>
+</li>
+<li><p class="first">Check the status of your buildslave on the <a class="reference external" href="http://lab.llvm.org:8011/waterfall">Waterfall Display</a> to make sure it is connected, and
+<tt class="docutils literal"><span class="pre">http://lab.llvm.org:8011/buildslaves/<your-buildslave-name></span></tt> to see
+if administrator contact and slave information are correct.</p>
+</li>
+<li><p class="first">Wait for the first build to succeed and enjoy.</p>
+</li>
+</ol>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="yaml2obj.html" title="yaml2obj"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="Lexicon.html" title="The LLVM Lexicon"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToBuildOnARM.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToBuildOnARM.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToBuildOnARM.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToBuildOnARM.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,173 @@
+
+
+<!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 Build On ARM — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="How to Cross Compile Compiler-rt Builtins For Arm" href="HowToCrossCompileBuiltinsOnArm.html" />
+    <link rel="prev" title="Advanced Build Configurations" href="AdvancedBuilds.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="HowToCrossCompileBuiltinsOnArm.html" title="How to Cross Compile Compiler-rt Builtins For Arm"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="AdvancedBuilds.html" title="Advanced Build Configurations"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-build-on-arm">
+<h1>How To Build On ARM<a class="headerlink" href="#how-to-build-on-arm" 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 contains information about building/testing LLVM and
+Clang on an ARM machine.</p>
+<p>This document is <em>NOT</em> tailored to help you cross-compile LLVM/Clang
+to ARM on another architecture, for example an x86_64 machine. To find
+out more about cross-compiling, please check <a class="reference internal" href="HowToCrossCompileLLVM.html"><em>How To Cross-Compile Clang/LLVM using Clang/LLVM</em></a>.</p>
+</div>
+<div class="section" id="notes-on-building-llvm-clang-on-arm">
+<h2>Notes On Building LLVM/Clang on ARM<a class="headerlink" href="#notes-on-building-llvm-clang-on-arm" title="Permalink to this headline">¶</a></h2>
+<p>Here are some notes on building/testing LLVM/Clang on ARM. Note that
+ARM encompasses a wide variety of CPUs; this advice is primarily based
+on the ARMv6 and ARMv7 architectures and may be inapplicable to older chips.</p>
+<ol class="arabic">
+<li><p class="first">The most popular Linaro/Ubuntu OS’s for ARM boards, e.g., the
+Pandaboard, have become hard-float platforms. There are a number of
+choices when using CMake. Autoconf usage is deprecated as of 3.8.</p>
+<p>Building LLVM/Clang in <tt class="docutils literal"><span class="pre">Relese</span></tt> mode is preferred since it consumes
+a lot less memory. Otherwise, the building process will very likely
+fail due to insufficient memory. It’s also a lot quicker to only build
+the relevant back-ends (ARM and AArch64), since it’s very unlikely that
+you’ll use an ARM board to cross-compile to other arches. If you’re
+running Compiler-RT tests, also include the x86 back-end, or some tests
+will fail.</p>
+<div class="highlight-bash"><div class="highlight"><pre>cmake <span class="nv">$LLVM_SRC_DIR</span> -DCMAKE_BUILD_TYPE<span class="o">=</span>Release <span class="se">\</span>
+                    -DLLVM_TARGETS_TO_BUILD<span class="o">=</span><span class="s2">"ARM;X86;AArch64"</span>
+</pre></div>
+</div>
+<p>Other options you can use are:</p>
+<div class="highlight-bash"><div class="highlight"><pre>Use Ninja instead of Make: <span class="s2">"-G Ninja"</span>
+Build with assertions on: <span class="s2">"-DLLVM_ENABLE_ASSERTIONS=True"</span>
+Force Python2: <span class="s2">"-DPYTHON_EXECUTABLE=/usr/bin/python2"</span>
+Local <span class="o">(</span>non-sudo<span class="o">)</span> install path: <span class="s2">"-DCMAKE_INSTALL_PREFIX=$HOME/llvm/instal"</span>
+CPU flags: <span class="s2">"DCMAKE_C_FLAGS=-mcpu=cortex-a15"</span> <span class="o">(</span>same <span class="k">for </span>CXX_FLAGS<span class="o">)</span>
+</pre></div>
+</div>
+<p>After that, just typing <tt class="docutils literal"><span class="pre">make</span> <span class="pre">-jN</span></tt> or <tt class="docutils literal"><span class="pre">ninja</span></tt> will build everything.
+<tt class="docutils literal"><span class="pre">make</span> <span class="pre">-jN</span> <span class="pre">check-all</span></tt> or <tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">check-all</span></tt> will run all compiler tests. For
+running the test suite, please refer to <a class="reference internal" href="TestingGuide.html"><em>LLVM Testing Infrastructure Guide</em></a>.</p>
+</li>
+<li><p class="first">If you are building LLVM/Clang on an ARM board with 1G of memory or less,
+please use <tt class="docutils literal"><span class="pre">gold</span></tt> rather then GNU <tt class="docutils literal"><span class="pre">ld</span></tt>. In any case it is probably a good
+idea to set up a swap partition, too.</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>sudo ln -sf /usr/bin/ld /usr/bin/ld.gold
+</pre></div>
+</div>
+</li>
+<li><p class="first">ARM development boards can be unstable and you may experience that cores
+are disappearing, caches being flushed on every big.LITTLE switch, and
+other similar issues.  To help ease the effect of this, set the Linux
+scheduler to “performance” on <strong>all</strong> cores using this little script:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># The code below requires the package 'cpufrequtils' to be installed.</span>
+<span class="k">for</span> <span class="o">((</span><span class="nv">cpu</span><span class="o">=</span>0; cpu<<span class="sb">`</span>grep -c proc /proc/cpuinfo<span class="sb">`</span>; cpu++<span class="o">))</span>; <span class="k">do</span>
+<span class="k">    </span>sudo cpufreq-set -c <span class="nv">$cpu</span> -g performance
+<span class="k">done</span>
+</pre></div>
+</div>
+<p>Remember to turn that off after the build, or you may risk burning your
+CPU. Most modern kernels don’t need that, so only use it if you have
+problems.</p>
+</li>
+<li><p class="first">Running the build on SD cards is ok, but they are more prone to failures
+than good quality USB sticks, and those are more prone to failures than
+external hard-drives (those are also a lot faster). So, at least, you
+should consider to buy a fast USB stick.  On systems with a fast eMMC,
+that’s a good option too.</p>
+</li>
+<li><p class="first">Make sure you have a decent power supply (dozens of dollars worth) that can
+provide <em>at least</em> 4 amperes, this is especially important if you use USB
+devices with your board. Externally powered USB/SATA harddrives are even
+better than having a good power supply.</p>
+</li>
+</ol>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="HowToCrossCompileBuiltinsOnArm.html" title="How to Cross Compile Compiler-rt Builtins For Arm"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="AdvancedBuilds.html" title="Advanced Build Configurations"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToCrossCompileBuiltinsOnArm.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToCrossCompileBuiltinsOnArm.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToCrossCompileBuiltinsOnArm.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToCrossCompileBuiltinsOnArm.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,284 @@
+
+
+<!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 Cross Compile Compiler-rt Builtins For Arm — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="How To Cross-Compile Clang/LLVM using Clang/LLVM" href="HowToCrossCompileLLVM.html" />
+    <link rel="prev" title="How To Build On ARM" href="HowToBuildOnARM.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="HowToCrossCompileLLVM.html" title="How To Cross-Compile Clang/LLVM using Clang/LLVM"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="HowToBuildOnARM.html" title="How To Build On ARM"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-cross-compile-compiler-rt-builtins-for-arm">
+<h1>How to Cross Compile Compiler-rt Builtins For Arm<a class="headerlink" href="#how-to-cross-compile-compiler-rt-builtins-for-arm" 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 contains information about building and testing the builtins part
+of compiler-rt for an Arm target, from an x86_64 Linux machine.</p>
+<p>While this document concentrates on Arm and Linux the general principles should
+apply to other targets supported by compiler-rt. Further contributions for other
+targets are welcome.</p>
+<p>The instructions in this document depend on libraries and programs external to
+LLVM, there are many ways to install and configure these dependencies so you
+may need to adapt the instructions here to fit your own local situation.</p>
+</div>
+<div class="section" id="prerequisites">
+<h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2>
+<p>In this use case we’ll be using CMake on a Debian-based Linux system,
+cross-compiling from an x86_64 host to a hard-float Armv7-A target. We’ll be
+using as many of the LLVM tools as we can, but it is possible to use GNU
+equivalents.</p>
+<blockquote>
+<div><ul class="simple">
+<li><tt class="docutils literal"><span class="pre">A</span> <span class="pre">build</span> <span class="pre">of</span> <span class="pre">LLVM/clang</span> <span class="pre">for</span> <span class="pre">the</span> <span class="pre">llvm-tools</span> <span class="pre">and</span> <span class="pre">llvm-config</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">The</span> <span class="pre">qemu-arm</span> <span class="pre">user</span> <span class="pre">mode</span> <span class="pre">emulator</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">An</span> <span class="pre">arm-linux-gnueabihf</span> <span class="pre">sysroot</span></tt></li>
+</ul>
+</div></blockquote>
+<p>See <a class="reference external" href="https://compiler-rt.llvm.org/">https://compiler-rt.llvm.org/</a> for more information about the dependencies
+on clang and LLVM.</p>
+<p><tt class="docutils literal"><span class="pre">qemu-arm</span></tt> should be available as a package for your Linux distribution.</p>
+<p>The most complicated of the prequisites to satisfy is the arm-linux-gnueabihf
+sysroot. The <a class="reference internal" href="HowToCrossCompileLLVM.html"><em>How To Cross-Compile Clang/LLVM using Clang/LLVM</em></a> has information about how to use the
+Linux distributions multiarch support to fulfill the dependencies for building
+LLVM. Alternatively, as building and testing just the compiler-rt builtins
+requires fewer dependencies than LLVM, it is possible to use the Linaro
+arm-linux-gnueabihf gcc installation as our sysroot.</p>
+</div>
+<div class="section" id="building-compiler-rt-builtins-for-arm">
+<h2>Building compiler-rt builtins for Arm<a class="headerlink" href="#building-compiler-rt-builtins-for-arm" title="Permalink to this headline">¶</a></h2>
+<p>We will be doing a standalone build of compiler-rt using the following cmake
+options.</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">path/to/llvm/projects/compiler-rt</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_BUILTINS=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_SANITIZERS=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_XRAY=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_LIBFUZZER=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_PROFILE=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER=/path/to/clang</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_AR=/path/to/llvm-ar</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_NM=/path/to/llvm-nm</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_RANLIB=/path/to/llvm-ranlib</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER_TARGET="arm-linux-gnueabihf"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_CONFIG_PATH=/path/to/llvm-config</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_FLAGS="build-c-flags"</span></tt></li>
+</ul>
+<p>The build-c-flags need to be sufficient to pass the C-make compiler check and
+to compile compiler-rt. When using a GCC 7 Linaro arm-linux-gnueabihf
+installation the following flags are needed:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">--target=arm-linux-gnueabihf</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">--march=armv7a</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">--gcc-toolchain=/path/to/dir/toolchain</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">--sysroot=/path/to/toolchain/arm-linux-gnueabihf/libc</span></tt></li>
+</ul>
+<p>Depending on how your sysroot is laid out, you may not need <tt class="docutils literal"><span class="pre">--gcc-toolchain</span></tt>.
+For example if you have added armhf as an architecture using your Linux
+distributions multiarch support then you should be able to use <tt class="docutils literal"><span class="pre">--sysroot=/</span></tt>.</p>
+<p>Once cmake has completed the builtins can be built with <tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">builtins</span></tt></p>
+</div>
+<div class="section" id="testing-compiler-rt-builtins-using-qemu-arm">
+<h2>Testing compiler-rt builtins using qemu-arm<a class="headerlink" href="#testing-compiler-rt-builtins-using-qemu-arm" title="Permalink to this headline">¶</a></h2>
+<p>To test the builtins library we need to add a few more cmake flags to enable
+testing and set up the compiler and flags for test case. We must also tell
+cmake that we wish to run the tests on <tt class="docutils literal"><span class="pre">qemu-arm</span></tt>.</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_EMULATOR="qemu-arm</span> <span class="pre">-L</span> <span class="pre">/path/to/armhf/sysroot</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_INCLUDE_TESTS=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_TEST_COMPILER="/path/to/clang"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_TEST_COMPILER_CFLAGS="test-c-flags"</span></tt></li>
+</ul>
+<p>The <tt class="docutils literal"><span class="pre">/path/to/armhf/sysroot</span></tt> should be the same as the one passed to
+<tt class="docutils literal"><span class="pre">--sysroot</span></tt> in the “build-c-flags”.</p>
+<p>The “test-c-flags” can be the same as the “build-c-flags”, with the addition
+of <tt class="docutils literal"><span class="pre">"-fuse-ld=lld</span></tt> if you wish to use lld to link the tests.</p>
+<p>Once cmake has completed the tests can be built and run using
+<tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">check-builtins</span></tt></p>
+</div>
+<div class="section" id="modifications-for-other-targets">
+<h2>Modifications for other Targets<a class="headerlink" href="#modifications-for-other-targets" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="arm-soft-float-target">
+<h3>Arm Soft-Float Target<a class="headerlink" href="#arm-soft-float-target" title="Permalink to this headline">¶</a></h3>
+<p>The instructions for the Arm hard-float target can be used for the soft-float
+target by substituting soft-float equivalents for the sysroot and target. The
+target to use is:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER_TARGET=arm-linux-gnueabi</span></tt></li>
+</ul>
+<p>Depending on whether you want to use floating point instructions or not you
+may need extra c-flags such as <tt class="docutils literal"><span class="pre">-mfloat-abi=softfp</span></tt> for use of floating-point
+instructions, and <tt class="docutils literal"><span class="pre">-mfloat-abi=soft</span> <span class="pre">-mfpu=none</span></tt> for software floating-point
+emulation.</p>
+</div>
+<div class="section" id="aarch64-target">
+<h3>AArch64 Target<a class="headerlink" href="#aarch64-target" title="Permalink to this headline">¶</a></h3>
+<p>The instructions for Arm can be used for AArch64 by substituting AArch64
+equivalents for the sysroot, emulator and target.</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_EMULATOR="qemu-aarch64</span> <span class="pre">-L</span> <span class="pre">/path/to/aarch64/sysroot</span></tt></li>
+</ul>
+<p>The CMAKE_C_FLAGS and COMPILER_RT_TEST_COMPILER_CFLAGS may also need:
+<tt class="docutils literal"><span class="pre">"--sysroot=/path/to/aarch64/sysroot</span> <span class="pre">--gcc-toolchain=/path/to/gcc-toolchain"</span></tt></p>
+</div>
+<div class="section" id="armv6-m-armv7-m-and-armv7e-m-targets">
+<h3>Armv6-m, Armv7-m and Armv7E-M targets<a class="headerlink" href="#armv6-m-armv7-m-and-armv7e-m-targets" title="Permalink to this headline">¶</a></h3>
+<p>If you wish to build, but not test compiler-rt for Armv6-M, Armv7-M or Armv7E-M
+then the easiest way is to use the BaremetalARM.cmake recipe in
+clang/cmake/caches.</p>
+<p>You will need a bare metal sysroot such as that provided by the GNU ARM
+Embedded toolchain.</p>
+<p>The libraries can be built with the cmake options:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DBAREMETAL_ARMV6M_SYSROOT=/path/to/bare/metal/sysroot</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DBAREMETAL_ARMV7M_SYSROOT=/path/to/bare/metal/sysroot</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DBAREMETAL_ARMV7EM_SYSROOT=/path/to/bare/metal/sysroot</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-C</span> <span class="pre">/path/to/llvm/source/tools/clang/cmake/caches/BaremetalARM.cmake</span></tt></li>
+</ul>
+<p><strong>Note</strong> that for the recipe to work the compiler-rt source must be checked out
+into the directory llvm/runtimes and not llvm/projects.</p>
+<p>To build and test the libraries using a similar method to Armv7-A is possible
+but more difficult. The main problems are:</p>
+<ul class="simple">
+<li>There isn’t a <tt class="docutils literal"><span class="pre">qemu-arm</span></tt> user-mode emulator for bare-metal systems. The <tt class="docutils literal"><span class="pre">qemu-system-arm</span></tt> can be used but this is significantly more difficult to setup.</li>
+<li>The target to compile compiler-rt have the suffix -none-eabi. This uses the BareMetal driver in clang and by default won’t find the libraries needed to pass the cmake compiler check.</li>
+</ul>
+<p>As the Armv6-M, Armv7-M and Armv7E-M builds of compiler-rt only use instructions
+that are supported on Armv7-A we can still get most of the value of running the
+tests using the same <tt class="docutils literal"><span class="pre">qemu-arm</span></tt> that we used for Armv7-A by building and
+running the test cases for Armv7-A but using the builtins compiled for
+Armv6-M, Armv7-M or Armv7E-M. This will not catch instructions that are
+supported on Armv7-A but not Armv6-M, Armv7-M and Armv7E-M.</p>
+<p>To get the cmake compile test to pass the libraries needed to successfully link
+the test application will need to be manually added to <tt class="docutils literal"><span class="pre">CMAKE_CFLAGS</span></tt>.
+Alternatively if you are using version 3.6 or above of cmake you can use
+<tt class="docutils literal"><span class="pre">CMAKE_TRY_COMPILE_TARGET=STATIC_LIBRARY</span></tt> to skip the link step.</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_OS_DIR="baremetal"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_BUILTINS=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_SANITIZERS=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_XRAY=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_LIBFUZZER=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BUILD_PROFILE=OFF</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER=${host_install_dir}/bin/clang</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_COMPILER_TARGET="your</span> <span class="pre">*-none-eabi</span> <span class="pre">target"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_AR=/path/to/llvm-ar</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_NM=/path/to/llvm-nm</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_RANLIB=/path/to/llvm-ranlib</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_BAREMETAL_BUILD=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_CONFIG_PATH=/path/to/llvm-config</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_C_FLAGS="build-c-flags"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_ASM_FLAGS="${arm_cflags}"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_EMULATOR="qemu-arm</span> <span class="pre">-L</span> <span class="pre">/path/to/armv7-A/sysroot"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_INCLUDE_TESTS=ON</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_TEST_COMPILER="/path/to/clang"</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCOMPILER_RT_TEST_COMPILER_CFLAGS="test-c-flags"</span></tt></li>
+</ul>
+<p>The Armv6-M builtins will use the soft-float ABI. When compiling the tests for
+Armv7-A we must include <tt class="docutils literal"><span class="pre">"-mthumb</span> <span class="pre">-mfloat-abi=soft</span> <span class="pre">-mfpu=none"</span></tt> in the
+test-c-flags. We must use an Armv7-A soft-float abi sysroot for <tt class="docutils literal"><span class="pre">qemu-arm</span></tt>.</p>
+<p>Unfortunately at time of writing the Armv7-M and Armv7E-M builds of
+compiler-rt will always include assembler files including floating point
+instructions. This means that building for a cpu without a floating point unit
+requires something like removing the arm_Thumb1_VFPv2_SOURCES from the
+arm_Thumb1_SOURCES in builtins/CMakeLists.txt. The float-abi of the compiler-rt
+library must be matched by the float abi of the Armv7-A sysroot used by
+qemu-arm.</p>
+<p>Depending on the linker used for the test cases you may encounter BuildAttribute
+mismatches between the M-profile objects from compiler-rt and the A-profile
+objects from the test. The lld linker does not check the BuildAttributes so it
+can be used to link the tests by adding -fuse-ld=lld to the
+<tt class="docutils literal"><span class="pre">COMPILER_RT_TEST_COMPILER_CFLAGS</span></tt>.</p>
+</div>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="HowToCrossCompileLLVM.html" title="How To Cross-Compile Clang/LLVM using Clang/LLVM"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="HowToBuildOnARM.html" title="How To Build On ARM"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToCrossCompileLLVM.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToCrossCompileLLVM.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToCrossCompileLLVM.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToCrossCompileLLVM.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,288 @@
+
+
+<!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 Cross-Compile Clang/LLVM using Clang/LLVM — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="LLVM Command Guide" href="CommandGuide/index.html" />
+    <link rel="prev" title="How to Cross Compile Compiler-rt Builtins For Arm" href="HowToCrossCompileBuiltinsOnArm.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="CommandGuide/index.html" title="LLVM Command Guide"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="HowToCrossCompileBuiltinsOnArm.html" title="How to Cross Compile Compiler-rt Builtins For Arm"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-cross-compile-clang-llvm-using-clang-llvm">
+<h1>How To Cross-Compile Clang/LLVM using Clang/LLVM<a class="headerlink" href="#how-to-cross-compile-clang-llvm-using-clang-llvm" 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 contains information about building LLVM and
+Clang on host machine, targeting another platform.</p>
+<p>For more information on how to use Clang as a cross-compiler,
+please check <a class="reference external" href="http://clang.llvm.org/docs/CrossCompilation.html">http://clang.llvm.org/docs/CrossCompilation.html</a>.</p>
+<p>TODO: Add MIPS and other platforms to this document.</p>
+</div>
+<div class="section" id="cross-compiling-from-x86-64-to-arm">
+<h2>Cross-Compiling from x86_64 to ARM<a class="headerlink" href="#cross-compiling-from-x86-64-to-arm" title="Permalink to this headline">¶</a></h2>
+<p>In this use case, we’ll be using CMake and Ninja, on a Debian-based Linux
+system, cross-compiling from an x86_64 host (most Intel and AMD chips
+nowadays) to a hard-float ARM target (most ARM targets nowadays).</p>
+<p>The packages you’ll need are:</p>
+<blockquote>
+<div><ul class="simple">
+<li><tt class="docutils literal"><span class="pre">cmake</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">ninja-build</span></tt> (from backports in Ubuntu)</li>
+<li><tt class="docutils literal"><span class="pre">gcc-4.7-arm-linux-gnueabihf</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">gcc-4.7-multilib-arm-linux-gnueabihf</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">binutils-arm-linux-gnueabihf</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">libgcc1-armhf-cross</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">libsfgcc1-armhf-cross</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">libstdc++6-armhf-cross</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">libstdc++6-4.7-dev-armhf-cross</span></tt></li>
+</ul>
+</div></blockquote>
+<div class="section" id="configuring-cmake">
+<h3>Configuring CMake<a class="headerlink" href="#configuring-cmake" title="Permalink to this headline">¶</a></h3>
+<p>For more information on how to configure CMake for LLVM/Clang,
+see <a class="reference internal" href="CMake.html"><em>Building LLVM with CMake</em></a>.</p>
+<p>The CMake options you need to add are:</p>
+<blockquote>
+<div><ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_CROSSCOMPILING=True</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX=<install-dir></span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_TABLEGEN=<path-to-host-bin>/llvm-tblgen</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DCLANG_TABLEGEN=<path-to-host-bin>/clang-tblgen</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_TARGET_ARCH=ARM</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">-DLLVM_TARGETS_TO_BUILD=ARM</span></tt></li>
+</ul>
+</div></blockquote>
+<p>If you’re compiling with GCC, you can use architecture options for your target,
+and the compiler driver will detect everything that it needs:</p>
+<blockquote>
+<div><ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-DCMAKE_CXX_FLAGS='-march=armv7-a</span> <span class="pre">-mcpu=cortex-a9</span> <span class="pre">-mfloat-abi=hard'</span></tt></li>
+</ul>
+</div></blockquote>
+<p>However, if you’re using Clang, the driver might not be up-to-date with your
+specific Linux distribution, version or GCC layout, so you’ll need to fudge.</p>
+<p>In addition to the ones above, you’ll also need:</p>
+<blockquote>
+<div><ul class="simple">
+<li><tt class="docutils literal"><span class="pre">'-target</span> <span class="pre">arm-linux-gnueabihf'</span></tt> or whatever is the triple of your cross GCC.</li>
+<li><tt class="docutils literal"><span class="pre">'--sysroot=/usr/arm-linux-gnueabihf'</span></tt>, <tt class="docutils literal"><span class="pre">'--sysroot=/opt/gcc/arm-linux-gnueabihf'</span></tt>
+or whatever is the location of your GCC’s sysroot (where /lib, /bin etc are).</li>
+<li>Appropriate use of <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-L</span></tt>, depending on how the cross GCC is installed,
+and where are the libraries and headers.</li>
+</ul>
+</div></blockquote>
+<p>The TableGen options are required to compile it with the host compiler,
+so you’ll need to compile LLVM (or at least <tt class="docutils literal"><span class="pre">llvm-tblgen</span></tt>) to your host
+platform before you start. The CXX flags define the target, cpu (which in this case
+defaults to <tt class="docutils literal"><span class="pre">fpu=VFP3</span></tt> with NEON), and forcing the hard-float ABI. If you’re
+using Clang as a cross-compiler, you will <em>also</em> have to set <tt class="docutils literal"><span class="pre">--sysroot</span></tt>
+to make sure it picks the correct linker.</p>
+<p>When using Clang, it’s important that you choose the triple to be <em>identical</em>
+to the GCC triple and the sysroot. This will make it easier for Clang to
+find the correct tools and include headers. But that won’t mean all headers and
+libraries will be found. You’ll still need to use <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-L</span></tt> to locate
+those extra ones, depending on your distribution.</p>
+<p>Most of the time, what you want is to have a native compiler to the
+platform itself, but not others. So there’s rarely a point in compiling
+all back-ends. For that reason, you should also set the
+<tt class="docutils literal"><span class="pre">TARGETS_TO_BUILD</span></tt> to only build the back-end you’re targeting to.</p>
+<p>You must set the <tt class="docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></tt>, otherwise a <tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">install</span></tt>
+will copy ARM binaries to your root filesystem, which is not what you
+want.</p>
+</div>
+<div class="section" id="hacks">
+<h3>Hacks<a class="headerlink" href="#hacks" title="Permalink to this headline">¶</a></h3>
+<p>There are some bugs in current LLVM, which require some fiddling before
+running CMake:</p>
+<ol class="arabic">
+<li><p class="first">If you’re using Clang as the cross-compiler, there is a problem in
+the LLVM ARM back-end that is producing absolute relocations on
+position-independent code (<tt class="docutils literal"><span class="pre">R_ARM_THM_MOVW_ABS_NC</span></tt>), so for now, you
+should disable PIC:</p>
+<div class="highlight-bash"><div class="highlight"><pre>-DLLVM_ENABLE_PIC<span class="o">=</span>False
+</pre></div>
+</div>
+<p>This is not a problem, since Clang/LLVM libraries are statically
+linked anyway, it shouldn’t affect much.</p>
+</li>
+<li><p class="first">The ARM libraries won’t be installed in your system.
+But the CMake prepare step, which checks for
+dependencies, will check the <em>host</em> libraries, not the <em>target</em>
+ones. Below there’s a list of some dependencies, but your project could
+have more, or this document could be outdated. You’ll see the errors
+while linking as an indication of that.</p>
+<p>Debian based distros have a way to add <tt class="docutils literal"><span class="pre">multiarch</span></tt>, which adds
+a new architecture and allows you to install packages for those
+systems. See <a class="reference external" href="https://wiki.debian.org/Multiarch/HOWTO">https://wiki.debian.org/Multiarch/HOWTO</a> for more info.</p>
+<p>But not all distros will have that, and possibly not an easy way to
+install them in any anyway, so you’ll have to build/download
+them separately.</p>
+<p>A quick way of getting the libraries is to download them from
+a distribution repository, like Debian (<a class="reference external" href="http://packages.debian.org/jessie/">http://packages.debian.org/jessie/</a>),
+and download the missing libraries. Note that the <tt class="docutils literal"><span class="pre">libXXX</span></tt>
+will have the shared objects (<tt class="docutils literal"><span class="pre">.so</span></tt>) and the <tt class="docutils literal"><span class="pre">libXXX-dev</span></tt> will
+give you the headers and the static (<tt class="docutils literal"><span class="pre">.a</span></tt>) library. Just in
+case, download both.</p>
+<p>The ones you need for ARM are: <tt class="docutils literal"><span class="pre">libtinfo</span></tt>, <tt class="docutils literal"><span class="pre">zlib1g</span></tt>,
+<tt class="docutils literal"><span class="pre">libxml2</span></tt> and <tt class="docutils literal"><span class="pre">liblzma</span></tt>. In the Debian repository you’ll
+find downloads for all architectures.</p>
+<p>After you download and unpack all <tt class="docutils literal"><span class="pre">.deb</span></tt> packages, copy all
+<tt class="docutils literal"><span class="pre">.so</span></tt> and <tt class="docutils literal"><span class="pre">.a</span></tt> to a directory, make the appropriate
+symbolic links (if necessary), and add the relevant <tt class="docutils literal"><span class="pre">-L</span></tt>
+and <tt class="docutils literal"><span class="pre">-I</span></tt> paths to <tt class="docutils literal"><span class="pre">-DCMAKE_CXX_FLAGS</span></tt> above.</p>
+</li>
+</ol>
+</div>
+<div class="section" id="running-cmake-and-building">
+<h3>Running CMake and Building<a class="headerlink" href="#running-cmake-and-building" title="Permalink to this headline">¶</a></h3>
+<p>Finally, if you’re using your platform compiler, run:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>cmake -G Ninja <<span class="nb">source</span>-dir> <options above>
+</pre></div>
+</div>
+</div></blockquote>
+<p>If you’re using Clang as the cross-compiler, run:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ CC</span><span class="o">=</span><span class="s1">'clang'</span> <span class="nv">CXX</span><span class="o">=</span><span class="s1">'clang++'</span> cmake -G Ninja <<span class="nb">source</span>-dir> <options above>
+</pre></div>
+</div>
+</div></blockquote>
+<p>If you have <tt class="docutils literal"><span class="pre">clang</span></tt>/<tt class="docutils literal"><span class="pre">clang++</span></tt> on the path, it should just work, and special
+Ninja files will be created in the build directory. I strongly suggest
+you to run <tt class="docutils literal"><span class="pre">cmake</span></tt> on a separate build directory, <em>not</em> inside the
+source tree.</p>
+<p>To build, simply type:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ninja
+</pre></div>
+</div>
+</div></blockquote>
+<p>It should automatically find out how many cores you have, what are
+the rules that needs building and will build the whole thing.</p>
+<p>You can’t run <tt class="docutils literal"><span class="pre">ninja</span> <span class="pre">check-all</span></tt> on this tree because the created
+binaries are targeted to ARM, not x86_64.</p>
+</div>
+<div class="section" id="installing-and-using">
+<h3>Installing and Using<a class="headerlink" href="#installing-and-using" title="Permalink to this headline">¶</a></h3>
+<p>After the LLVM/Clang has built successfully, you should install it
+via:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ninja install
+</pre></div>
+</div>
+</div></blockquote>
+<p>which will create a sysroot on the install-dir. You can then tar
+that directory into a binary with the full triple name (for easy
+identification), like:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ln -sf <install-dir> arm-linux-gnueabihf-clang
+<span class="nv">$ </span>tar zchf arm-linux-gnueabihf-clang.tar.gz arm-linux-gnueabihf-clang
+</pre></div>
+</div>
+</div></blockquote>
+<p>If you copy that tarball to your target board, you’ll be able to use
+it for running the test-suite, for example. Follow the guidelines at
+<a class="reference external" href="http://llvm.org/docs/lnt/quickstart.html">http://llvm.org/docs/lnt/quickstart.html</a>, unpack the tarball in the
+test directory, and use options:</p>
+<blockquote>
+<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>./sandbox/bin/python sandbox/bin/lnt runtest nt <span class="se">\</span>
+    --sandbox sandbox <span class="se">\</span>
+    --test-suite <span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span>/test-suite <span class="se">\</span>
+    --cc <span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span>/arm-linux-gnueabihf-clang/bin/clang <span class="se">\</span>
+    --cxx <span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span>/arm-linux-gnueabihf-clang/bin/clang++
+</pre></div>
+</div>
+</div></blockquote>
+<p>Remember to add the <tt class="docutils literal"><span class="pre">-jN</span></tt> options to <tt class="docutils literal"><span class="pre">lnt</span></tt> to the number of CPUs
+on your board. Also, the path to your clang has to be absolute, so
+you’ll need the <cite>pwd</cite> trick above.</p>
+</div>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="CommandGuide/index.html" title="LLVM Command Guide"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="HowToCrossCompileBuiltinsOnArm.html" title="How to Cross Compile Compiler-rt Builtins For Arm"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToReleaseLLVM.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToReleaseLLVM.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToReleaseLLVM.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToReleaseLLVM.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,436 @@
+
+
+<!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 Release LLVM To The Public — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="Advice on Packaging LLVM" href="Packaging.html" />
+    <link rel="prev" title="LLVMBuild Guide" href="LLVMBuild.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="Packaging.html" title="Advice on Packaging LLVM"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LLVMBuild.html" title="LLVMBuild Guide"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-release-llvm-to-the-public">
+<h1>How To Release LLVM To The Public<a class="headerlink" href="#how-to-release-llvm-to-the-public" 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 contains information about successfully releasing LLVM —
+including sub-projects: e.g., <tt class="docutils literal"><span class="pre">clang</span></tt> and <tt class="docutils literal"><span class="pre">compiler-rt</span></tt> — to the public.
+It is the Release Manager’s responsibility to ensure that a high quality build
+of LLVM is released.</p>
+<p>If you’re looking for the document on how to test the release candidates and
+create the binary packages, please refer to the <a class="reference internal" href="ReleaseProcess.html"><em>How To Validate a New Release</em></a> instead.</p>
+</div>
+<div class="section" id="release-timeline">
+<span id="timeline"></span><h2>Release Timeline<a class="headerlink" href="#release-timeline" title="Permalink to this headline">¶</a></h2>
+<p>LLVM is released on a time based schedule — with major releases roughly
+every 6 months.  In between major releases there may be dot releases.
+The release manager will determine if and when to make a dot release based
+on feedback from the community.  Typically, dot releases should be made if
+there are large number of bug-fixes in the stable branch or a critical bug
+has been discovered that affects a large number of users.</p>
+<p>Unless otherwise stated, dot releases will follow the same procedure as
+major releases.</p>
+<p>The release process is roughly as follows:</p>
+<ul class="simple">
+<li>Set code freeze and branch creation date for 6 months after last code freeze
+date.  Announce release schedule to the LLVM community and update the website.</li>
+<li>Create release branch and begin release process.</li>
+<li>Send out release candidate sources for first round of testing.  Testing lasts
+7-10 days.  During the first round of testing, any regressions found should be
+fixed.  Patches are merged from mainline into the release branch.  Also, all
+features need to be completed during this time.  Any features not completed at
+the end of the first round of testing will be removed or disabled for the
+release.</li>
+<li>Generate and send out the second release candidate sources.  Only <em>critical</em>
+bugs found during this testing phase will be fixed.  Any bugs introduced by
+merged patches will be fixed.  If so a third round of testing is needed.</li>
+<li>The release notes are updated.</li>
+<li>Finally, release!</li>
+</ul>
+<p>The release process will be accelerated for dot releases.  If the first round
+of testing finds no critical bugs and no regressions since the last major release,
+then additional rounds of testing will not be required.</p>
+</div>
+<div class="section" id="release-process">
+<h2>Release Process<a class="headerlink" href="#release-process" title="Permalink to this headline">¶</a></h2>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#release-administrative-tasks" id="id1">Release Administrative Tasks</a><ul>
+<li><a class="reference internal" href="#create-release-branch" id="id2">Create Release Branch</a></li>
+<li><a class="reference internal" href="#update-llvm-version" id="id3">Update LLVM Version</a></li>
+<li><a class="reference internal" href="#tagging-the-llvm-release-candidates" id="id4">Tagging the LLVM Release Candidates</a></li>
+<li><a class="reference internal" href="#build-clang-binary-distribution" id="id5">Build Clang Binary Distribution</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#release-qualification-criteria" id="id6">Release Qualification Criteria</a></li>
+<li><a class="reference internal" href="#official-testing" id="id7">Official Testing</a></li>
+<li><a class="reference internal" href="#community-testing" id="id8">Community Testing</a></li>
+<li><a class="reference internal" href="#reporting-regressions" id="id9">Reporting Regressions</a></li>
+<li><a class="reference internal" href="#merge-requests" id="id10">Merge Requests</a></li>
+<li><a class="reference internal" href="#release-patch-rules" id="id11">Release Patch Rules</a><ul>
+<li><a class="reference internal" href="#merging-patches" id="id12">Merging Patches</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#release-final-tasks" id="id13">Release Final Tasks</a><ul>
+<li><a class="reference internal" href="#update-documentation" id="id14">Update Documentation</a></li>
+<li><a class="reference internal" href="#tag-the-llvm-final-release" id="id15">Tag the LLVM Final Release</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#update-the-llvm-demo-page" id="id16">Update the LLVM Demo Page</a><ul>
+<li><a class="reference internal" href="#update-the-llvm-website" id="id17">Update the LLVM Website</a></li>
+<li><a class="reference internal" href="#announce-the-release" id="id18">Announce the Release</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="release-administrative-tasks">
+<h3><a class="toc-backref" href="#id1">Release Administrative Tasks</a><a class="headerlink" href="#release-administrative-tasks" title="Permalink to this headline">¶</a></h3>
+<p>This section describes a few administrative tasks that need to be done for the
+release process to begin.  Specifically, it involves:</p>
+<ul class="simple">
+<li>Creating the release branch,</li>
+<li>Setting version numbers, and</li>
+<li>Tagging release candidates for the release team to begin testing.</li>
+</ul>
+<div class="section" id="create-release-branch">
+<h4><a class="toc-backref" href="#id2">Create Release Branch</a><a class="headerlink" href="#create-release-branch" title="Permalink to this headline">¶</a></h4>
+<p>Branch the Subversion trunk using the following procedure:</p>
+<ol class="arabic">
+<li><p class="first">Remind developers that the release branching is imminent and to refrain from
+committing patches that might break the build.  E.g., new features, large
+patches for works in progress, an overhaul of the type system, an exciting
+new TableGen feature, etc.</p>
+</li>
+<li><p class="first">Verify that the current Subversion trunk is in decent shape by
+examining nightly tester and buildbot results.</p>
+</li>
+<li><p class="first">Create the release branch for <tt class="docutils literal"><span class="pre">llvm</span></tt>, <tt class="docutils literal"><span class="pre">clang</span></tt>, and other sub-projects,
+from the last known good revision.  The branch’s name is
+<tt class="docutils literal"><span class="pre">release_XY</span></tt>, where <tt class="docutils literal"><span class="pre">X</span></tt> is the major and <tt class="docutils literal"><span class="pre">Y</span></tt> the minor release
+numbers.  Use <tt class="docutils literal"><span class="pre">utils/release/tag.sh</span></tt> to tag the release.</p>
+</li>
+<li><p class="first">Advise developers that they may now check their patches into the Subversion
+tree again.</p>
+</li>
+<li><p class="first">The Release Manager should switch to the release branch, because all changes
+to the release will now be done in the branch.  The easiest way to do this is
+to grab a working copy using the following commands:</p>
+<div class="highlight-python"><pre>$ svn co https://llvm.org/svn/llvm-project/llvm/branches/release_XY llvm-X.Y
+
+$ svn co https://llvm.org/svn/llvm-project/cfe/branches/release_XY clang-X.Y
+
+$ svn co https://llvm.org/svn/llvm-project/test-suite/branches/release_XY test-suite-X.Y</pre>
+</div>
+</li>
+</ol>
+</div>
+<div class="section" id="update-llvm-version">
+<h4><a class="toc-backref" href="#id3">Update LLVM Version</a><a class="headerlink" href="#update-llvm-version" title="Permalink to this headline">¶</a></h4>
+<p>After creating the LLVM release branch, update the release branches’
+<tt class="docutils literal"><span class="pre">autoconf</span></tt> and <tt class="docutils literal"><span class="pre">configure.ac</span></tt> versions from ‘<tt class="docutils literal"><span class="pre">X.Ysvn</span></tt>‘ to ‘<tt class="docutils literal"><span class="pre">X.Y</span></tt>‘.
+Update it on mainline as well to be the next version (‘<tt class="docutils literal"><span class="pre">X.Y+1svn</span></tt>‘).
+Regenerate the configure scripts for both <tt class="docutils literal"><span class="pre">llvm</span></tt> and the <tt class="docutils literal"><span class="pre">test-suite</span></tt>.</p>
+<p>In addition, the version numbers of all the Bugzilla components must be updated
+for the next release.</p>
+</div>
+<div class="section" id="tagging-the-llvm-release-candidates">
+<h4><a class="toc-backref" href="#id4">Tagging the LLVM Release Candidates</a><a class="headerlink" href="#tagging-the-llvm-release-candidates" title="Permalink to this headline">¶</a></h4>
+<p>Tag release candidates using the tag.sh script in utils/release.</p>
+<div class="highlight-python"><pre>$ ./tag.sh -release X.Y.Z -rc $RC</pre>
+</div>
+<p>The Release Manager may supply pre-packaged source tarballs for users.  This can
+be done with the export.sh script in utils/release.</p>
+<div class="highlight-python"><pre>$ ./export.sh -release X.Y.Z -rc $RC</pre>
+</div>
+<p>This will generate source tarballs for each LLVM project being validated, which
+can be uploaded to the website for further testing.</p>
+</div>
+<div class="section" id="build-clang-binary-distribution">
+<h4><a class="toc-backref" href="#id5">Build Clang Binary Distribution</a><a class="headerlink" href="#build-clang-binary-distribution" title="Permalink to this headline">¶</a></h4>
+<p>Creating the <tt class="docutils literal"><span class="pre">clang</span></tt> binary distribution requires following the instructions
+<a class="reference internal" href="ReleaseProcess.html"><em>here</em></a>.</p>
+<p>That process will perform both Release+Asserts and Release builds but only
+pack the Release build for upload. You should use the Release+Asserts sysroot,
+normally under <tt class="docutils literal"><span class="pre">final/Phase3/Release+Asserts/llvmCore-3.8.1-RCn.install/</span></tt>,
+for test-suite and run-time benchmarks, to make sure nothing serious has
+passed through the net. For compile-time benchmarks, use the Release version.</p>
+<p>The minimum required version of the tools you’ll need are <a class="reference internal" href="GettingStarted.html"><em>here</em></a></p>
+</div>
+</div>
+<div class="section" id="release-qualification-criteria">
+<h3><a class="toc-backref" href="#id6">Release Qualification Criteria</a><a class="headerlink" href="#release-qualification-criteria" title="Permalink to this headline">¶</a></h3>
+<p>A release is qualified when it has no regressions from the previous release (or
+baseline).  Regressions are related to correctness first and performance second.
+(We may tolerate some minor performance regressions if they are deemed
+necessary for the general quality of the compiler.)</p>
+<p>More specifically, Clang/LLVM is qualified when it has a clean test with all
+supported sub-projects included (<tt class="docutils literal"><span class="pre">make</span> <span class="pre">check-all</span></tt>), per target, and it has no
+regressions with the <tt class="docutils literal"><span class="pre">test-suite</span></tt> in relation to the previous release.</p>
+<p>Regressions are new failures in the set of tests that are used to qualify
+each product and only include things on the list.  Every release will have
+some bugs in it.  It is the reality of developing a complex piece of
+software.  We need a very concrete and definitive release criteria that
+ensures we have monotonically improving quality on some metric.  The metric we
+use is described below.  This doesn’t mean that we don’t care about other
+criteria, but these are the criteria which we found to be most important and
+which must be satisfied before a release can go out.</p>
+</div>
+<div class="section" id="official-testing">
+<h3><a class="toc-backref" href="#id7">Official Testing</a><a class="headerlink" href="#official-testing" title="Permalink to this headline">¶</a></h3>
+<p>A few developers in the community have dedicated time to validate the release
+candidates and volunteered to be the official release testers for each
+architecture.</p>
+<p>These will be the ones testing, generating and uploading the official binaries
+to the server, and will be the minimum tests <em>necessary</em> for the release to
+proceed.</p>
+<p>This will obviously not cover all OSs and distributions, so additional community
+validation is important. However, if community input is not reached before the
+release is out, all bugs reported will have to go on the next stable release.</p>
+<p>The official release managers are:</p>
+<ul class="simple">
+<li>Major releases (X.0): Hans Wennborg</li>
+<li>Stable releases (X.n): Tom Stellard</li>
+</ul>
+<p>The official release testers are volunteered from the community and have
+consistently validated and released binaries for their targets/OSs. To contact
+them, you should email the <tt class="docutils literal"><span class="pre">release-testers@lists.llvm.org</span></tt> mailing list.</p>
+<p>The official testers list is in the file <tt class="docutils literal"><span class="pre">RELEASE_TESTERS.TXT</span></tt>, in the <tt class="docutils literal"><span class="pre">LLVM</span></tt>
+repository.</p>
+</div>
+<div class="section" id="community-testing">
+<h3><a class="toc-backref" href="#id8">Community Testing</a><a class="headerlink" href="#community-testing" title="Permalink to this headline">¶</a></h3>
+<p>Once all testing has been completed and appropriate bugs filed, the release
+candidate tarballs are put on the website and the LLVM community is notified.</p>
+<p>We ask that all LLVM developers test the release in any the following ways:</p>
+<ol class="arabic simple">
+<li>Download <tt class="docutils literal"><span class="pre">llvm-X.Y</span></tt>, <tt class="docutils literal"><span class="pre">llvm-test-X.Y</span></tt>, and the appropriate <tt class="docutils literal"><span class="pre">clang</span></tt>
+binary.  Build LLVM.  Run <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></tt> and the full LLVM test suite (<tt class="docutils literal"><span class="pre">make</span>
+<span class="pre">TEST=nightly</span> <span class="pre">report</span></tt>).</li>
+<li>Download <tt class="docutils literal"><span class="pre">llvm-X.Y</span></tt>, <tt class="docutils literal"><span class="pre">llvm-test-X.Y</span></tt>, and the <tt class="docutils literal"><span class="pre">clang</span></tt> sources.  Compile
+everything.  Run <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></tt> and the full LLVM test suite (<tt class="docutils literal"><span class="pre">make</span>
+<span class="pre">TEST=nightly</span> <span class="pre">report</span></tt>).</li>
+<li>Download <tt class="docutils literal"><span class="pre">llvm-X.Y</span></tt>, <tt class="docutils literal"><span class="pre">llvm-test-X.Y</span></tt>, and the appropriate <tt class="docutils literal"><span class="pre">clang</span></tt>
+binary. Build whole programs with it (ex. Chromium, Firefox, Apache) for
+your platform.</li>
+<li>Download <tt class="docutils literal"><span class="pre">llvm-X.Y</span></tt>, <tt class="docutils literal"><span class="pre">llvm-test-X.Y</span></tt>, and the appropriate <tt class="docutils literal"><span class="pre">clang</span></tt>
+binary. Build <em>your</em> programs with it and check for conformance and
+performance regressions.</li>
+<li>Run the <a class="reference internal" href="ReleaseProcess.html"><em>release process</em></a>, if your platform is
+<em>different</em> than that which is officially supported, and report back errors
+only if they were not reported by the official release tester for that
+architecture.</li>
+</ol>
+<p>We also ask that the OS distribution release managers test their packages with
+the first candidate of every release, and report any <em>new</em> errors in Bugzilla.
+If the bug can be reproduced with an unpatched upstream version of the release
+candidate (as opposed to the distribution’s own build), the priority should be
+release blocker.</p>
+<p>During the first round of testing, all regressions must be fixed before the
+second release candidate is tagged.</p>
+<p>In the subsequent stages, the testing is only to ensure that bug
+fixes previously merged in have not created new major problems. <em>This is not
+the time to solve additional and unrelated bugs!</em> If no patches are merged in,
+the release is determined to be ready and the release manager may move onto the
+next stage.</p>
+</div>
+<div class="section" id="reporting-regressions">
+<h3><a class="toc-backref" href="#id9">Reporting Regressions</a><a class="headerlink" href="#reporting-regressions" title="Permalink to this headline">¶</a></h3>
+<p>Every regression that is found during the tests (as per the criteria above),
+should be filled in a bug in Bugzilla with the priority <em>release blocker</em> and
+blocking a specific release.</p>
+<p>To help manage all the bugs reported and which ones are blockers or not, a new
+“[meta]” bug should be created and all regressions <em>blocking</em> that Meta. Once
+all blockers are done, the Meta can be closed.</p>
+<p>If a bug can’t be reproduced, or stops being a blocker, it should be removed
+from the Meta and its priority decreased to <em>normal</em>. Debugging can continue,
+but on trunk.</p>
+</div>
+<div class="section" id="merge-requests">
+<h3><a class="toc-backref" href="#id10">Merge Requests</a><a class="headerlink" href="#merge-requests" title="Permalink to this headline">¶</a></h3>
+<p>You can use any of the following methods to request that a revision from trunk
+be merged into a release branch:</p>
+<ol class="arabic simple">
+<li>Use the <tt class="docutils literal"><span class="pre">utils/release/merge-request.sh</span></tt> script which will automatically
+file a <a class="reference external" href="https://bugs.llvm.org/">bug</a> requesting that the patch be merged. e.g. To request revision
+12345 be merged into the branch for the 5.0.1 release:
+<tt class="docutils literal"><span class="pre">llvm.src/utils/release/merge-request.sh</span> <span class="pre">-stable-version</span> <span class="pre">5.0</span> <span class="pre">-r</span> <span class="pre">12345</span> <span class="pre">-user</span> <span class="pre">bugzilla@example.com</span></tt></li>
+<li>Manually file a <a class="reference external" href="https://bugs.llvm.org/">bug</a> with the subject: “Merge r12345 into the X.Y branch”,
+enter the commit(s) that you want merged in the “Fixed by Commit(s)” and mark
+it as a blocker of the current release bug.  Release bugs are given aliases
+in the form of release-x.y.z, so to mark a bug as a blocker for the 5.0.1
+release, just enter release-5.0.1 in the “Blocks” field.</li>
+<li>Reply to the commit email on llvm-commits for the revision to merge and cc
+the release manager.</li>
+</ol>
+</div>
+<div class="section" id="release-patch-rules">
+<h3><a class="toc-backref" href="#id11">Release Patch Rules</a><a class="headerlink" href="#release-patch-rules" title="Permalink to this headline">¶</a></h3>
+<p>Below are the rules regarding patching the release branch:</p>
+<ol class="arabic simple">
+<li>Patches applied to the release branch may only be applied by the release
+manager, the official release testers or the code owners with approval from
+the release manager.</li>
+<li>During the first round of testing, patches that fix regressions or that are
+small and relatively risk free (verified by the appropriate code owner) are
+applied to the branch.  Code owners are asked to be very conservative in
+approving patches for the branch.  We reserve the right to reject any patch
+that does not fix a regression as previously defined.</li>
+<li>During the remaining rounds of testing, only patches that fix critical
+regressions may be applied.</li>
+<li>For dot releases all patches must maintain both API and ABI compatibility with
+the previous major release.  Only bug-fixes will be accepted.</li>
+</ol>
+<div class="section" id="merging-patches">
+<h4><a class="toc-backref" href="#id12">Merging Patches</a><a class="headerlink" href="#merging-patches" title="Permalink to this headline">¶</a></h4>
+<p>The <tt class="docutils literal"><span class="pre">utils/release/merge.sh</span></tt> script can be used to merge individual revisions
+into any one of the llvm projects. To merge revision <tt class="docutils literal"><span class="pre">$N</span></tt> into project
+<tt class="docutils literal"><span class="pre">$PROJ</span></tt>, do:</p>
+<ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">svn</span> <span class="pre">co</span> <span class="pre">https://llvm.org/svn/llvm-project/$PROJ/branches/release_XX</span>
+<span class="pre">$PROJ.src</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">$PROJ.src/utils/release/merge.sh</span> <span class="pre">--proj</span> <span class="pre">$PROJ</span> <span class="pre">--rev</span> <span class="pre">$N</span></tt></li>
+<li>Run regression tests.</li>
+<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">$PROJ.src</span></tt>. Run the <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">commit</span></tt> command printed out by <tt class="docutils literal"><span class="pre">merge.sh</span></tt>
+in step 2.</li>
+</ol>
+</div>
+</div>
+<div class="section" id="release-final-tasks">
+<h3><a class="toc-backref" href="#id13">Release Final Tasks</a><a class="headerlink" href="#release-final-tasks" title="Permalink to this headline">¶</a></h3>
+<p>The final stages of the release process involves tagging the “final” release
+branch, updating documentation that refers to the release, and updating the
+demo page.</p>
+<div class="section" id="update-documentation">
+<h4><a class="toc-backref" href="#id14">Update Documentation</a><a class="headerlink" href="#update-documentation" title="Permalink to this headline">¶</a></h4>
+<p>Review the documentation and ensure that it is up to date.  The “Release Notes”
+must be updated to reflect new features, bug fixes, new known issues, and
+changes in the list of supported platforms.  The “Getting Started Guide” should
+be updated to reflect the new release version number tag available from
+Subversion and changes in basic system requirements.  Merge both changes from
+mainline into the release branch.</p>
+</div>
+<div class="section" id="tag-the-llvm-final-release">
+<span id="tag"></span><h4><a class="toc-backref" href="#id15">Tag the LLVM Final Release</a><a class="headerlink" href="#tag-the-llvm-final-release" title="Permalink to this headline">¶</a></h4>
+<p>Tag the final release sources using the tag.sh script in utils/release.</p>
+<div class="highlight-python"><pre>$ ./tag.sh -release X.Y.Z -final</pre>
+</div>
+</div>
+</div>
+<div class="section" id="update-the-llvm-demo-page">
+<h3><a class="toc-backref" href="#id16">Update the LLVM Demo Page</a><a class="headerlink" href="#update-the-llvm-demo-page" title="Permalink to this headline">¶</a></h3>
+<p>The LLVM demo page must be updated to use the new release.  This consists of
+using the new <tt class="docutils literal"><span class="pre">clang</span></tt> binary and building LLVM.</p>
+<div class="section" id="update-the-llvm-website">
+<h4><a class="toc-backref" href="#id17">Update the LLVM Website</a><a class="headerlink" href="#update-the-llvm-website" title="Permalink to this headline">¶</a></h4>
+<p>The website must be updated before the release announcement is sent out.  Here
+is what to do:</p>
+<ol class="arabic simple">
+<li>Check out the <tt class="docutils literal"><span class="pre">www</span></tt> module from Subversion.</li>
+<li>Create a new sub-directory <tt class="docutils literal"><span class="pre">X.Y</span></tt> in the releases directory.</li>
+<li>Commit the <tt class="docutils literal"><span class="pre">llvm</span></tt>, <tt class="docutils literal"><span class="pre">test-suite</span></tt>, <tt class="docutils literal"><span class="pre">clang</span></tt> source and binaries in this
+new directory.</li>
+<li>Copy and commit the <tt class="docutils literal"><span class="pre">llvm/docs</span></tt> and <tt class="docutils literal"><span class="pre">LICENSE.txt</span></tt> files into this new
+directory.  The docs should be built with <tt class="docutils literal"><span class="pre">BUILD_FOR_WEBSITE=1</span></tt>.</li>
+<li>Commit the <tt class="docutils literal"><span class="pre">index.html</span></tt> to the <tt class="docutils literal"><span class="pre">release/X.Y</span></tt> directory to redirect (use
+from previous release).</li>
+<li>Update the <tt class="docutils literal"><span class="pre">releases/download.html</span></tt> file with the new release.</li>
+<li>Update the <tt class="docutils literal"><span class="pre">releases/index.html</span></tt> with the new release and link to release
+documentation.</li>
+<li>Finally, update the main page (<tt class="docutils literal"><span class="pre">index.html</span></tt> and sidebar) to point to the
+new release and release announcement.  Make sure this all gets committed back
+into Subversion.</li>
+</ol>
+</div>
+<div class="section" id="announce-the-release">
+<h4><a class="toc-backref" href="#id18">Announce the Release</a><a class="headerlink" href="#announce-the-release" title="Permalink to this headline">¶</a></h4>
+<p>Send an email to the list announcing the release, pointing people to all the
+relevant documentation, download pages and bugs fixed.</p>
+</div>
+</div>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="Packaging.html" title="Advice on Packaging LLVM"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LLVMBuild.html" title="LLVMBuild Guide"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToSetUpLLVMStyleRTTI.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToSetUpLLVMStyleRTTI.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToSetUpLLVMStyleRTTI.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToSetUpLLVMStyleRTTI.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,474 @@
+
+
+<!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 set up LLVM-style RTTI for your class hierarchy — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="LLVM Programmer’s Manual" href="ProgrammersManual.html" />
+    <link rel="prev" title="Extending LLVM: Adding instructions, intrinsics, types, etc." href="ExtendingLLVM.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="ProgrammersManual.html" title="LLVM Programmer’s Manual"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="ExtendingLLVM.html" title="Extending LLVM: Adding instructions, intrinsics, types, etc."
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-set-up-llvm-style-rtti-for-your-class-hierarchy">
+<h1><a class="toc-backref" href="#id1">How to set up LLVM-style RTTI for your class hierarchy</a><a class="headerlink" href="#how-to-set-up-llvm-style-rtti-for-your-class-hierarchy" title="Permalink to this headline">¶</a></h1>
+<div class="contents topic" id="contents">
+<p class="topic-title first">Contents</p>
+<ul class="simple">
+<li><a class="reference internal" href="#how-to-set-up-llvm-style-rtti-for-your-class-hierarchy" id="id1">How to set up LLVM-style RTTI for your class hierarchy</a><ul>
+<li><a class="reference internal" href="#background" id="id2">Background</a></li>
+<li><a class="reference internal" href="#basic-setup" id="id3">Basic Setup</a></li>
+<li><a class="reference internal" href="#concrete-bases-and-deeper-hierarchies" id="id4">Concrete Bases and Deeper Hierarchies</a><ul>
+<li><a class="reference internal" href="#a-bug-to-be-aware-of" id="id5">A Bug to be Aware Of</a></li>
+<li><a class="reference internal" href="#the-contract-of-classof" id="id6">The Contract of <tt class="docutils literal"><span class="pre">classof</span></tt></a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#rules-of-thumb" id="id7">Rules of Thumb</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="background">
+<h2><a class="toc-backref" href="#id2">Background</a><a class="headerlink" href="#background" title="Permalink to this headline">¶</a></h2>
+<p>LLVM avoids using C++’s built in RTTI. Instead, it  pervasively uses its
+own hand-rolled form of RTTI which is much more efficient and flexible,
+although it requires a bit more work from you as a class author.</p>
+<p>A description of how to use LLVM-style RTTI from a client’s perspective is
+given in the <a class="reference external" href="ProgrammersManual.html#isa">Programmer’s Manual</a>. This
+document, in contrast, discusses the steps you need to take as a class
+hierarchy author to make LLVM-style RTTI available to your clients.</p>
+<p>Before diving in, make sure that you are familiar with the Object Oriented
+Programming concept of “<a class="reference external" href="http://en.wikipedia.org/wiki/Is-a">is-a</a>”.</p>
+</div>
+<div class="section" id="basic-setup">
+<h2><a class="toc-backref" href="#id3">Basic Setup</a><a class="headerlink" href="#basic-setup" title="Permalink to this headline">¶</a></h2>
+<p>This section describes how to set up the most basic form of LLVM-style RTTI
+(which is sufficient for 99.9% of the cases). We will set up LLVM-style
+RTTI for this class hierarchy:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Shape</span> <span class="p">{</span>
+<span class="k">public</span><span class="o">:</span>
+  <span class="n">Shape</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">class</span> <span class="nc">Square</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">SideLength</span><span class="p">;</span>
+<span class="k">public</span><span class="o">:</span>
+  <span class="n">Square</span><span class="p">(</span><span class="kt">double</span> <span class="n">S</span><span class="p">)</span> <span class="o">:</span> <span class="n">SideLength</span><span class="p">(</span><span class="n">S</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">class</span> <span class="nc">Circle</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Radius</span><span class="p">;</span>
+<span class="k">public</span><span class="o">:</span>
+  <span class="n">Circle</span><span class="p">(</span><span class="kt">double</span> <span class="n">R</span><span class="p">)</span> <span class="o">:</span> <span class="n">Radius</span><span class="p">(</span><span class="n">R</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>The most basic working setup for LLVM-style RTTI requires the following
+steps:</p>
+<ol class="arabic">
+<li><p class="first">In the header where you declare <tt class="docutils literal"><span class="pre">Shape</span></tt>, you will want to <tt class="docutils literal"><span class="pre">#include</span>
+<span class="pre">"llvm/Support/Casting.h"</span></tt>, which declares LLVM’s RTTI templates. That
+way your clients don’t even have to think about it.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "llvm/Support/Casting.h"</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">In the base class, introduce an enum which discriminates all of the
+different concrete classes in the hierarchy, and stash the enum value
+somewhere in the base class.</p>
+<p>Here is the code after introducing this change:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">class</span> <span class="nc">Shape</span> <span class="p">{</span>
+ <span class="k">public</span><span class="o">:</span>
+<span class="o">+</span>  <span class="c1">/// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)</span>
+<span class="o">+</span>  <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+<span class="o">+</span>    <span class="n">SK_Square</span><span class="p">,</span>
+<span class="o">+</span>    <span class="n">SK_Circle</span>
+<span class="o">+</span>  <span class="p">};</span>
+<span class="o">+</span><span class="k">private</span><span class="o">:</span>
+<span class="o">+</span>  <span class="k">const</span> <span class="n">ShapeKind</span> <span class="n">Kind</span><span class="p">;</span>
+<span class="o">+</span><span class="k">public</span><span class="o">:</span>
+<span class="o">+</span>  <span class="n">ShapeKind</span> <span class="n">getKind</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">Kind</span><span class="p">;</span> <span class="p">}</span>
+<span class="o">+</span>
+   <span class="n">Shape</span><span class="p">()</span> <span class="p">{}</span>
+   <span class="k">virtual</span> <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">};</span>
+</pre></div>
+</div>
+<p>You will usually want to keep the <tt class="docutils literal"><span class="pre">Kind</span></tt> member encapsulated and
+private, but let the enum <tt class="docutils literal"><span class="pre">ShapeKind</span></tt> be public along with providing a
+<tt class="docutils literal"><span class="pre">getKind()</span></tt> method. This is convenient for clients so that they can do
+a <tt class="docutils literal"><span class="pre">switch</span></tt> over the enum.</p>
+<p>A common naming convention is that these enums are “kind”s, to avoid
+ambiguity with the words “type” or “class” which have overloaded meanings
+in many contexts within LLVM. Sometimes there will be a natural name for
+it, like “opcode”. Don’t bikeshed over this; when in doubt use <tt class="docutils literal"><span class="pre">Kind</span></tt>.</p>
+<p>You might wonder why the <tt class="docutils literal"><span class="pre">Kind</span></tt> enum doesn’t have an entry for
+<tt class="docutils literal"><span class="pre">Shape</span></tt>. The reason for this is that since <tt class="docutils literal"><span class="pre">Shape</span></tt> is abstract
+(<tt class="docutils literal"><span class="pre">computeArea()</span> <span class="pre">=</span> <span class="pre">0;</span></tt>), you will never actually have non-derived
+instances of exactly that class (only subclasses). See <a class="reference internal" href="#concrete-bases-and-deeper-hierarchies">Concrete Bases
+and Deeper Hierarchies</a> for information on how to deal with
+non-abstract bases. It’s worth mentioning here that unlike
+<tt class="docutils literal"><span class="pre">dynamic_cast<></span></tt>, LLVM-style RTTI can be used (and is often used) for
+classes that don’t have v-tables.</p>
+</li>
+<li><p class="first">Next, you need to make sure that the <tt class="docutils literal"><span class="pre">Kind</span></tt> gets initialized to the
+value corresponding to the dynamic type of the class. Typically, you will
+want to have it be an argument to the constructor of the base class, and
+then pass in the respective <tt class="docutils literal"><span class="pre">XXXKind</span></tt> from subclass constructors.</p>
+<p>Here is the code after that change:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">class</span> <span class="nc">Shape</span> <span class="p">{</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="c1">/// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)</span>
+   <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+     <span class="n">SK_Square</span><span class="p">,</span>
+     <span class="n">SK_Circle</span>
+   <span class="p">};</span>
+ <span class="k">private</span><span class="o">:</span>
+   <span class="k">const</span> <span class="n">ShapeKind</span> <span class="n">Kind</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="n">ShapeKind</span> <span class="n">getKind</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">Kind</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="o">-</span>  <span class="n">Shape</span><span class="p">()</span> <span class="p">{}</span>
+<span class="o">+</span>  <span class="n">Shape</span><span class="p">(</span><span class="n">ShapeKind</span> <span class="n">K</span><span class="p">)</span> <span class="o">:</span> <span class="n">Kind</span><span class="p">(</span><span class="n">K</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="k">virtual</span> <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">class</span> <span class="nc">Square</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+   <span class="kt">double</span> <span class="n">SideLength</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+<span class="o">-</span>  <span class="n">Square</span><span class="p">(</span><span class="kt">double</span> <span class="n">S</span><span class="p">)</span> <span class="o">:</span> <span class="n">SideLength</span><span class="p">(</span><span class="n">S</span><span class="p">)</span> <span class="p">{}</span>
+<span class="o">+</span>  <span class="n">Square</span><span class="p">(</span><span class="kt">double</span> <span class="n">S</span><span class="p">)</span> <span class="o">:</span> <span class="n">Shape</span><span class="p">(</span><span class="n">SK_Square</span><span class="p">),</span> <span class="n">SideLength</span><span class="p">(</span><span class="n">S</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">class</span> <span class="nc">Circle</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+   <span class="kt">double</span> <span class="n">Radius</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+<span class="o">-</span>  <span class="n">Circle</span><span class="p">(</span><span class="kt">double</span> <span class="n">R</span><span class="p">)</span> <span class="o">:</span> <span class="n">Radius</span><span class="p">(</span><span class="n">R</span><span class="p">)</span> <span class="p">{}</span>
+<span class="o">+</span>  <span class="n">Circle</span><span class="p">(</span><span class="kt">double</span> <span class="n">R</span><span class="p">)</span> <span class="o">:</span> <span class="n">Shape</span><span class="p">(</span><span class="n">SK_Circle</span><span class="p">),</span> <span class="n">Radius</span><span class="p">(</span><span class="n">R</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+ <span class="p">};</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Finally, you need to inform LLVM’s RTTI templates how to dynamically
+determine the type of a class (i.e. whether the <tt class="docutils literal"><span class="pre">isa<></span></tt>/<tt class="docutils literal"><span class="pre">dyn_cast<></span></tt>
+should succeed). The default “99.9% of use cases” way to accomplish this
+is through a small static member function <tt class="docutils literal"><span class="pre">classof</span></tt>. In order to have
+proper context for an explanation, we will display this code first, and
+then below describe each part:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">class</span> <span class="nc">Shape</span> <span class="p">{</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="c1">/// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)</span>
+   <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+     <span class="n">SK_Square</span><span class="p">,</span>
+     <span class="n">SK_Circle</span>
+   <span class="p">};</span>
+ <span class="k">private</span><span class="o">:</span>
+   <span class="k">const</span> <span class="n">ShapeKind</span> <span class="n">Kind</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="n">ShapeKind</span> <span class="n">getKind</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">Kind</span><span class="p">;</span> <span class="p">}</span>
+
+   <span class="n">Shape</span><span class="p">(</span><span class="n">ShapeKind</span> <span class="n">K</span><span class="p">)</span> <span class="o">:</span> <span class="n">Kind</span><span class="p">(</span><span class="n">K</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="k">virtual</span> <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">class</span> <span class="nc">Square</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+   <span class="kt">double</span> <span class="n">SideLength</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="n">Square</span><span class="p">(</span><span class="kt">double</span> <span class="n">S</span><span class="p">)</span> <span class="o">:</span> <span class="n">Shape</span><span class="p">(</span><span class="n">SK_Square</span><span class="p">),</span> <span class="n">SideLength</span><span class="p">(</span><span class="n">S</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+<span class="o">+</span>
+<span class="o">+</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">+</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">==</span> <span class="n">SK_Square</span><span class="p">;</span>
+<span class="o">+</span>  <span class="p">}</span>
+ <span class="p">};</span>
+
+ <span class="k">class</span> <span class="nc">Circle</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Shape</span> <span class="p">{</span>
+   <span class="kt">double</span> <span class="n">Radius</span><span class="p">;</span>
+ <span class="k">public</span><span class="o">:</span>
+   <span class="n">Circle</span><span class="p">(</span><span class="kt">double</span> <span class="n">R</span><span class="p">)</span> <span class="o">:</span> <span class="n">Shape</span><span class="p">(</span><span class="n">SK_Circle</span><span class="p">),</span> <span class="n">Radius</span><span class="p">(</span><span class="n">R</span><span class="p">)</span> <span class="p">{}</span>
+   <span class="kt">double</span> <span class="n">computeArea</span><span class="p">()</span> <span class="n">override</span><span class="p">;</span>
+<span class="o">+</span>
+<span class="o">+</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">+</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">==</span> <span class="n">SK_Circle</span><span class="p">;</span>
+<span class="o">+</span>  <span class="p">}</span>
+ <span class="p">};</span>
+</pre></div>
+</div>
+<p>The job of <tt class="docutils literal"><span class="pre">classof</span></tt> is to dynamically determine whether an object of
+a base class is in fact of a particular derived class.  In order to
+downcast a type <tt class="docutils literal"><span class="pre">Base</span></tt> to a type <tt class="docutils literal"><span class="pre">Derived</span></tt>, there needs to be a
+<tt class="docutils literal"><span class="pre">classof</span></tt> in <tt class="docutils literal"><span class="pre">Derived</span></tt> which will accept an object of type <tt class="docutils literal"><span class="pre">Base</span></tt>.</p>
+<p>To be concrete, consider the following code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Shape</span> <span class="o">*</span><span class="n">S</span> <span class="o">=</span> <span class="p">...;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">isa</span><span class="o"><</span><span class="n">Circle</span><span class="o">></span><span class="p">(</span><span class="n">S</span><span class="p">))</span> <span class="p">{</span>
+  <span class="cm">/* do something ... */</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The code of the <tt class="docutils literal"><span class="pre">isa<></span></tt> test in this code will eventually boil
+down—after template instantiation and some other machinery—to a
+check roughly like <tt class="docutils literal"><span class="pre">Circle::classof(S)</span></tt>. For more information, see
+<a class="reference internal" href="#classof-contract"><em>The Contract of classof</em></a>.</p>
+<p>The argument to <tt class="docutils literal"><span class="pre">classof</span></tt> should always be an <em>ancestor</em> class because
+the implementation has logic to allow and optimize away
+upcasts/up-<tt class="docutils literal"><span class="pre">isa<></span></tt>‘s automatically. It is as though every class
+<tt class="docutils literal"><span class="pre">Foo</span></tt> automatically has a <tt class="docutils literal"><span class="pre">classof</span></tt> like:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Foo</span> <span class="p">{</span>
+  <span class="p">[...]</span>
+  <span class="k">template</span> <span class="o"><</span><span class="k">class</span> <span class="nc">T</span><span class="o">></span>
+  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">T</span> <span class="o">*</span><span class="p">,</span>
+                      <span class="o">::</span><span class="n">std</span><span class="o">::</span><span class="n">enable_if</span><span class="o"><</span>
+                        <span class="o">::</span><span class="n">std</span><span class="o">::</span><span class="n">is_base_of</span><span class="o"><</span><span class="n">Foo</span><span class="p">,</span> <span class="n">T</span><span class="o">>::</span><span class="n">value</span>
+                      <span class="o">>::</span><span class="n">type</span><span class="o">*</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">true</span><span class="p">;</span> <span class="p">}</span>
+  <span class="p">[...]</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Note that this is the reason that we did not need to introduce a
+<tt class="docutils literal"><span class="pre">classof</span></tt> into <tt class="docutils literal"><span class="pre">Shape</span></tt>: all relevant classes derive from <tt class="docutils literal"><span class="pre">Shape</span></tt>,
+and <tt class="docutils literal"><span class="pre">Shape</span></tt> itself is abstract (has no entry in the <tt class="docutils literal"><span class="pre">Kind</span></tt> enum),
+so this notional inferred <tt class="docutils literal"><span class="pre">classof</span></tt> is all we need. See <a class="reference internal" href="#concrete-bases-and-deeper-hierarchies">Concrete
+Bases and Deeper Hierarchies</a> for more information about how to extend
+this example to more general hierarchies.</p>
+</li>
+</ol>
+<p>Although for this small example setting up LLVM-style RTTI seems like a lot
+of “boilerplate”, if your classes are doing anything interesting then this
+will end up being a tiny fraction of the code.</p>
+</div>
+<div class="section" id="concrete-bases-and-deeper-hierarchies">
+<h2><a class="toc-backref" href="#id4">Concrete Bases and Deeper Hierarchies</a><a class="headerlink" href="#concrete-bases-and-deeper-hierarchies" title="Permalink to this headline">¶</a></h2>
+<p>For concrete bases (i.e. non-abstract interior nodes of the inheritance
+tree), the <tt class="docutils literal"><span class="pre">Kind</span></tt> check inside <tt class="docutils literal"><span class="pre">classof</span></tt> needs to be a bit more
+complicated. The situation differs from the example above in that</p>
+<ul class="simple">
+<li>Since the class is concrete, it must itself have an entry in the <tt class="docutils literal"><span class="pre">Kind</span></tt>
+enum because it is possible to have objects with this class as a dynamic
+type.</li>
+<li>Since the class has children, the check inside <tt class="docutils literal"><span class="pre">classof</span></tt> must take them
+into account.</li>
+</ul>
+<p>Say that <tt class="docutils literal"><span class="pre">SpecialSquare</span></tt> and <tt class="docutils literal"><span class="pre">OtherSpecialSquare</span></tt> derive
+from <tt class="docutils literal"><span class="pre">Square</span></tt>, and so <tt class="docutils literal"><span class="pre">ShapeKind</span></tt> becomes:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+   <span class="n">SK_Square</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_SpecialSquare</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_OtherSpecialSquare</span><span class="p">,</span>
+   <span class="n">SK_Circle</span>
+ <span class="p">}</span>
+</pre></div>
+</div>
+<p>Then in <tt class="docutils literal"><span class="pre">Square</span></tt>, we would need to modify the <tt class="docutils literal"><span class="pre">classof</span></tt> like so:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="o">-</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">-</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">==</span> <span class="n">SK_Square</span><span class="p">;</span>
+<span class="o">-</span>  <span class="p">}</span>
+<span class="o">+</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">+</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">>=</span> <span class="n">SK_Square</span> <span class="o">&&</span>
+<span class="o">+</span>           <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o"><=</span> <span class="n">SK_OtherSpecialSquare</span><span class="p">;</span>
+<span class="o">+</span>  <span class="p">}</span>
+</pre></div>
+</div>
+<p>The reason that we need to test a range like this instead of just equality
+is that both <tt class="docutils literal"><span class="pre">SpecialSquare</span></tt> and <tt class="docutils literal"><span class="pre">OtherSpecialSquare</span></tt> “is-a”
+<tt class="docutils literal"><span class="pre">Square</span></tt>, and so <tt class="docutils literal"><span class="pre">classof</span></tt> needs to return <tt class="docutils literal"><span class="pre">true</span></tt> for them.</p>
+<p>This approach can be made to scale to arbitrarily deep hierarchies. The
+trick is that you arrange the enum values so that they correspond to a
+preorder traversal of the class hierarchy tree. With that arrangement, all
+subclass tests can be done with two comparisons as shown above. If you just
+list the class hierarchy like a list of bullet points, you’ll get the
+ordering right:</p>
+<div class="highlight-python"><pre>| Shape
+  | Square
+    | SpecialSquare
+    | OtherSpecialSquare
+  | Circle</pre>
+</div>
+<div class="section" id="a-bug-to-be-aware-of">
+<h3><a class="toc-backref" href="#id5">A Bug to be Aware Of</a><a class="headerlink" href="#a-bug-to-be-aware-of" title="Permalink to this headline">¶</a></h3>
+<p>The example just given opens the door to bugs where the <tt class="docutils literal"><span class="pre">classof</span></tt>s are
+not updated to match the <tt class="docutils literal"><span class="pre">Kind</span></tt> enum when adding (or removing) classes to
+(from) the hierarchy.</p>
+<p>Continuing the example above, suppose we add a <tt class="docutils literal"><span class="pre">SomewhatSpecialSquare</span></tt> as
+a subclass of <tt class="docutils literal"><span class="pre">Square</span></tt>, and update the <tt class="docutils literal"><span class="pre">ShapeKind</span></tt> enum like so:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+   <span class="n">SK_Square</span><span class="p">,</span>
+   <span class="n">SK_SpecialSquare</span><span class="p">,</span>
+   <span class="n">SK_OtherSpecialSquare</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_SomewhatSpecialSquare</span><span class="p">,</span>
+   <span class="n">SK_Circle</span>
+ <span class="p">}</span>
+</pre></div>
+</div>
+<p>Now, suppose that we forget to update <tt class="docutils literal"><span class="pre">Square::classof()</span></tt>, so it still
+looks like:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// BUG: Returns false when S->getKind() == SK_SomewhatSpecialSquare,</span>
+  <span class="c1">// even though SomewhatSpecialSquare "is a" Square.</span>
+  <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">>=</span> <span class="n">SK_Square</span> <span class="o">&&</span>
+         <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o"><=</span> <span class="n">SK_OtherSpecialSquare</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>As the comment indicates, this code contains a bug. A straightforward and
+non-clever way to avoid this is to introduce an explicit <tt class="docutils literal"><span class="pre">SK_LastSquare</span></tt>
+entry in the enum when adding the first subclass(es). For example, we could
+rewrite the example at the beginning of <a class="reference internal" href="#concrete-bases-and-deeper-hierarchies">Concrete Bases and Deeper
+Hierarchies</a> as:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+   <span class="n">SK_Square</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_SpecialSquare</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_OtherSpecialSquare</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_LastSquare</span><span class="p">,</span>
+   <span class="n">SK_Circle</span>
+ <span class="p">}</span>
+<span class="p">...</span>
+<span class="c1">// Square::classof()</span>
+<span class="o">-</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">-</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">==</span> <span class="n">SK_Square</span><span class="p">;</span>
+<span class="o">-</span>  <span class="p">}</span>
+<span class="o">+</span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">classof</span><span class="p">(</span><span class="k">const</span> <span class="n">Shape</span> <span class="o">*</span><span class="n">S</span><span class="p">)</span> <span class="p">{</span>
+<span class="o">+</span>    <span class="k">return</span> <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o">>=</span> <span class="n">SK_Square</span> <span class="o">&&</span>
+<span class="o">+</span>           <span class="n">S</span><span class="o">-></span><span class="n">getKind</span><span class="p">()</span> <span class="o"><=</span> <span class="n">SK_LastSquare</span><span class="p">;</span>
+<span class="o">+</span>  <span class="p">}</span>
+</pre></div>
+</div>
+<p>Then, adding new subclasses is easy:</p>
+<div class="highlight-c++"><div class="highlight"><pre> <span class="k">enum</span> <span class="n">ShapeKind</span> <span class="p">{</span>
+   <span class="n">SK_Square</span><span class="p">,</span>
+   <span class="n">SK_SpecialSquare</span><span class="p">,</span>
+   <span class="n">SK_OtherSpecialSquare</span><span class="p">,</span>
+<span class="o">+</span>  <span class="n">SK_SomewhatSpecialSquare</span><span class="p">,</span>
+   <span class="n">SK_LastSquare</span><span class="p">,</span>
+   <span class="n">SK_Circle</span>
+ <span class="p">}</span>
+</pre></div>
+</div>
+<p>Notice that <tt class="docutils literal"><span class="pre">Square::classof</span></tt> does not need to be changed.</p>
+</div>
+<div class="section" id="the-contract-of-classof">
+<span id="classof-contract"></span><h3><a class="toc-backref" href="#id6">The Contract of <tt class="docutils literal"><span class="pre">classof</span></tt></a><a class="headerlink" href="#the-contract-of-classof" title="Permalink to this headline">¶</a></h3>
+<p>To be more precise, let <tt class="docutils literal"><span class="pre">classof</span></tt> be inside a class <tt class="docutils literal"><span class="pre">C</span></tt>.  Then the
+contract for <tt class="docutils literal"><span class="pre">classof</span></tt> is “return <tt class="docutils literal"><span class="pre">true</span></tt> if the dynamic type of the
+argument is-a <tt class="docutils literal"><span class="pre">C</span></tt>”.  As long as your implementation fulfills this
+contract, you can tweak and optimize it as much as you want.</p>
+<p>For example, LLVM-style RTTI can work fine in the presence of
+multiple-inheritance by defining an appropriate <tt class="docutils literal"><span class="pre">classof</span></tt>.
+An example of this in practice is
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a> vs.
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html">DeclContext</a>
+inside Clang.
+The <tt class="docutils literal"><span class="pre">Decl</span></tt> hierarchy is done very similarly to the example setup
+demonstrated in this tutorial.
+The key part is how to then incorporate <tt class="docutils literal"><span class="pre">DeclContext</span></tt>: all that is needed
+is in <tt class="docutils literal"><span class="pre">bool</span> <span class="pre">DeclContext::classof(const</span> <span class="pre">Decl</span> <span class="pre">*)</span></tt>, which asks the question
+“Given a <tt class="docutils literal"><span class="pre">Decl</span></tt>, how can I determine if it is-a <tt class="docutils literal"><span class="pre">DeclContext</span></tt>?”.
+It answers this with a simple switch over the set of <tt class="docutils literal"><span class="pre">Decl</span></tt> “kinds”, and
+returning true for ones that are known to be <tt class="docutils literal"><span class="pre">DeclContext</span></tt>‘s.</p>
+</div>
+</div>
+<div class="section" id="rules-of-thumb">
+<h2><a class="toc-backref" href="#id7">Rules of Thumb</a><a class="headerlink" href="#rules-of-thumb" title="Permalink to this headline">¶</a></h2>
+<ol class="arabic simple">
+<li>The <tt class="docutils literal"><span class="pre">Kind</span></tt> enum should have one entry per concrete class, ordered
+according to a preorder traversal of the inheritance tree.</li>
+<li>The argument to <tt class="docutils literal"><span class="pre">classof</span></tt> should be a <tt class="docutils literal"><span class="pre">const</span> <span class="pre">Base</span> <span class="pre">*</span></tt>, where <tt class="docutils literal"><span class="pre">Base</span></tt>
+is some ancestor in the inheritance hierarchy. The argument should
+<em>never</em> be a derived class or the class itself: the template machinery
+for <tt class="docutils literal"><span class="pre">isa<></span></tt> already handles this case and optimizes it.</li>
+<li>For each class in the hierarchy that has no children, implement a
+<tt class="docutils literal"><span class="pre">classof</span></tt> that checks only against its <tt class="docutils literal"><span class="pre">Kind</span></tt>.</li>
+<li>For each class in the hierarchy that has children, implement a
+<tt class="docutils literal"><span class="pre">classof</span></tt> that checks a range of the first child’s <tt class="docutils literal"><span class="pre">Kind</span></tt> and the
+last child’s <tt class="docutils literal"><span class="pre">Kind</span></tt>.</li>
+</ol>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="ProgrammersManual.html" title="LLVM Programmer’s Manual"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="ExtendingLLVM.html" title="Extending LLVM: Adding instructions, intrinsics, types, etc."
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToSubmitABug.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToSubmitABug.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToSubmitABug.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToSubmitABug.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,280 @@
+
+
+<!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 submit an LLVM bug report — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="Sphinx Quickstart Template" href="SphinxQuickstartTemplate.html" />
+    <link rel="prev" title="yaml2obj" href="yaml2obj.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="SphinxQuickstartTemplate.html" title="Sphinx Quickstart Template"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="yaml2obj.html" title="yaml2obj"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-submit-an-llvm-bug-report">
+<h1>How to submit an LLVM bug report<a class="headerlink" href="#how-to-submit-an-llvm-bug-report" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="introduction-got-bugs">
+<h2>Introduction - Got bugs?<a class="headerlink" href="#introduction-got-bugs" title="Permalink to this headline">¶</a></h2>
+<p>If you’re working with LLVM and run into a bug, we definitely want to know
+about it.  This document describes what you can do to increase the odds of
+getting it fixed quickly.</p>
+<p>Basically you have to do two things at a minimum.  First, decide whether
+the bug <a class="reference internal" href="#crashes-the-compiler">crashes the compiler</a> (or an LLVM pass), or if the
+compiler is <a class="reference internal" href="#miscompiling">miscompiling</a> the program (i.e., the
+compiler successfully produces an executable, but it doesn’t run right).
+Based on what type of bug it is, follow the instructions in the linked
+section to narrow down the bug so that the person who fixes it will be able
+to find the problem more easily.</p>
+<p>Once you have a reduced test-case, go to <a class="reference external" href="https://bugs.llvm.org/enter_bug.cgi">the LLVM Bug Tracking System</a> and fill out the form with the
+necessary details (note that you don’t need to pick a category, just use
+the “new-bugs” category if you’re not sure).  The bug description should
+contain the following information:</p>
+<ul class="simple">
+<li>All information necessary to reproduce the problem.</li>
+<li>The reduced test-case that triggers the bug.</li>
+<li>The location where you obtained LLVM (if not from our Subversion
+repository).</li>
+</ul>
+<p>Thanks for helping us make LLVM better!</p>
+</div>
+<div class="section" id="crashing-bugs">
+<span id="crashes-the-compiler"></span><h2>Crashing Bugs<a class="headerlink" href="#crashing-bugs" title="Permalink to this headline">¶</a></h2>
+<p>More often than not, bugs in the compiler cause it to crash—often due to
+an assertion failure of some sort. The most important piece of the puzzle
+is to figure out if it is crashing in the Clang front-end or if it is one of
+the LLVM libraries (e.g. the optimizer or code generator) that has
+problems.</p>
+<p>To figure out which component is crashing (the front-end, optimizer or code
+generator), run the <tt class="docutils literal"><span class="pre">clang</span></tt> command line as you were when the crash
+occurred, but with the following extra command line options:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-O0</span> <span class="pre">-emit-llvm</span></tt>: If <tt class="docutils literal"><span class="pre">clang</span></tt> still crashes when passed these
+options (which disable the optimizer and code generator), then the crash
+is in the front-end.  Jump ahead to the section on <a class="reference internal" href="#front-end"><em>front-end bugs</em></a>.</li>
+<li><tt class="docutils literal"><span class="pre">-emit-llvm</span></tt>: If <tt class="docutils literal"><span class="pre">clang</span></tt> crashes with this option (which disables
+the code generator), you found an optimizer bug.  Jump ahead to
+<a class="reference internal" href="#compile-time-optimization-bugs">compile-time optimization bugs</a>.</li>
+<li>Otherwise, you have a code generator crash. Jump ahead to <a class="reference internal" href="#code-generator-bugs">code
+generator bugs</a>.</li>
+</ul>
+<div class="section" id="front-end-bugs">
+<span id="front-end"></span><span id="front-end-bug"></span><h3>Front-end bugs<a class="headerlink" href="#front-end-bugs" title="Permalink to this headline">¶</a></h3>
+<p>If the problem is in the front-end, you should re-run the same <tt class="docutils literal"><span class="pre">clang</span></tt>
+command that resulted in the crash, but add the <tt class="docutils literal"><span class="pre">-save-temps</span></tt> option.
+The compiler will crash again, but it will leave behind a <tt class="docutils literal"><span class="pre">foo.i</span></tt> file
+(containing preprocessed C source code) and possibly <tt class="docutils literal"><span class="pre">foo.s</span></tt> for each
+compiled <tt class="docutils literal"><span class="pre">foo.c</span></tt> file. Send us the <tt class="docutils literal"><span class="pre">foo.i</span></tt> file, along with the options
+you passed to <tt class="docutils literal"><span class="pre">clang</span></tt>, and a brief description of the error it caused.</p>
+<p>The <a class="reference external" href="http://delta.tigris.org/">delta</a> tool helps to reduce the
+preprocessed file down to the smallest amount of code that still replicates
+the problem. You’re encouraged to use delta to reduce the code to make the
+developers’ lives easier. <a class="reference external" href="http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction">This website</a> has instructions
+on the best way to use delta.</p>
+</div>
+<div class="section" id="compile-time-optimization-bugs">
+<span id="id1"></span><h3>Compile-time optimization bugs<a class="headerlink" href="#compile-time-optimization-bugs" title="Permalink to this headline">¶</a></h3>
+<p>If you find that a bug crashes in the optimizer, compile your test-case to a
+<tt class="docutils literal"><span class="pre">.bc</span></tt> file by passing “<tt class="docutils literal"><span class="pre">-emit-llvm</span> <span class="pre">-O0</span> <span class="pre">-c</span> <span class="pre">-o</span> <span class="pre">foo.bc</span></tt>”.
+Then run:</p>
+<div class="highlight-bash"><div class="highlight"><pre>opt -O3 -debug-pass<span class="o">=</span>Arguments foo.bc -disable-output
+</pre></div>
+</div>
+<p>This command should do two things: it should print out a list of passes, and
+then it should crash in the same way as clang.  If it doesn’t crash, please
+follow the instructions for a <a class="reference internal" href="#front-end-bug">front-end bug</a>.</p>
+<p>If this does crash, then you should be able to debug this with the following
+bugpoint command:</p>
+<div class="highlight-bash"><div class="highlight"><pre>bugpoint foo.bc <list of passes printed by opt>
+</pre></div>
+</div>
+<p>Please run this, then file a bug with the instructions and reduced .bc
+files that bugpoint emits.  If something goes wrong with bugpoint, please
+submit the “foo.bc” file and the list of passes printed by <tt class="docutils literal"><span class="pre">opt</span></tt>.</p>
+</div>
+<div class="section" id="code-generator-bugs">
+<span id="id2"></span><h3>Code generator bugs<a class="headerlink" href="#code-generator-bugs" title="Permalink to this headline">¶</a></h3>
+<p>If you find a bug that crashes clang in the code generator, compile your
+source file to a .bc file by passing “<tt class="docutils literal"><span class="pre">-emit-llvm</span> <span class="pre">-c</span> <span class="pre">-o</span> <span class="pre">foo.bc</span></tt>” to
+clang (in addition to the options you already pass).  Once your have
+foo.bc, one of the following commands should fail:</p>
+<ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">llc</span> <span class="pre">foo.bc</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">llc</span> <span class="pre">foo.bc</span> <span class="pre">-relocation-model=pic</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">llc</span> <span class="pre">foo.bc</span> <span class="pre">-relocation-model=static</span></tt></li>
+</ol>
+<p>If none of these crash, please follow the instructions for a <a class="reference internal" href="#front-end-bug">front-end
+bug</a>.  If one of these do crash, you should be able to reduce this with
+one of the following bugpoint command lines (use the one corresponding to
+the command above that failed):</p>
+<ol class="arabic simple">
+<li><tt class="docutils literal"><span class="pre">bugpoint</span> <span class="pre">-run-llc</span> <span class="pre">foo.bc</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">bugpoint</span> <span class="pre">-run-llc</span> <span class="pre">foo.bc</span> <span class="pre">--tool-args</span> <span class="pre">-relocation-model=pic</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">bugpoint</span> <span class="pre">-run-llc</span> <span class="pre">foo.bc</span> <span class="pre">--tool-args</span> <span class="pre">-relocation-model=static</span></tt></li>
+</ol>
+<p>Please run this, then file a bug with the instructions and reduced .bc file
+that bugpoint emits.  If something goes wrong with bugpoint, please submit
+the “foo.bc” file and the option that llc crashes with.</p>
+</div>
+</div>
+<div class="section" id="miscompilations">
+<span id="miscompiling"></span><h2>Miscompilations<a class="headerlink" href="#miscompilations" title="Permalink to this headline">¶</a></h2>
+<p>If clang successfully produces an executable, but that executable
+doesn’t run right, this is either a bug in the code or a bug in the
+compiler.  The first thing to check is to make sure it is not using
+undefined behavior (e.g. reading a variable before it is defined). In
+particular, check to see if the program <a class="reference external" href="http://valgrind.org/">valgrind</a>‘s clean, passes purify, or some other memory
+checker tool. Many of the “LLVM bugs” that we have chased down ended up
+being bugs in the program being compiled, not LLVM.</p>
+<p>Once you determine that the program itself is not buggy, you should choose
+which code generator you wish to compile the program with (e.g. LLC or the JIT)
+and optionally a series of LLVM passes to run.  For example:</p>
+<div class="highlight-bash"><div class="highlight"><pre>bugpoint -run-llc <span class="o">[</span>... optzn passes ...<span class="o">]</span> file-to-test.bc --args -- <span class="o">[</span>program arguments<span class="o">]</span>
+</pre></div>
+</div>
+<p>bugpoint will try to narrow down your list of passes to the one pass that
+causes an error, and simplify the bitcode file as much as it can to assist
+you. It will print a message letting you know how to reproduce the
+resulting error.</p>
+</div>
+<div class="section" id="incorrect-code-generation">
+<h2>Incorrect code generation<a class="headerlink" href="#incorrect-code-generation" title="Permalink to this headline">¶</a></h2>
+<p>Similarly to debugging incorrect compilation by mis-behaving passes, you
+can debug incorrect code generation by either LLC or the JIT, using
+<tt class="docutils literal"><span class="pre">bugpoint</span></tt>. The process <tt class="docutils literal"><span class="pre">bugpoint</span></tt> follows in this case is to try to
+narrow the code down to a function that is miscompiled by one or the other
+method, but since for correctness, the entire program must be run,
+<tt class="docutils literal"><span class="pre">bugpoint</span></tt> will compile the code it deems to not be affected with the C
+Backend, and then link in the shared object it generates.</p>
+<p>To debug the JIT:</p>
+<div class="highlight-bash"><div class="highlight"><pre>bugpoint -run-jit -output<span class="o">=[</span>correct output file<span class="o">]</span> <span class="o">[</span>bitcode file<span class="o">]</span>  <span class="se">\</span>
+         --tool-args -- <span class="o">[</span>arguments to pass to lli<span class="o">]</span>              <span class="se">\</span>
+         --args -- <span class="o">[</span>program arguments<span class="o">]</span>
+</pre></div>
+</div>
+<p>Similarly, to debug the LLC, one would run:</p>
+<div class="highlight-bash"><div class="highlight"><pre>bugpoint -run-llc -output<span class="o">=[</span>correct output file<span class="o">]</span> <span class="o">[</span>bitcode file<span class="o">]</span>  <span class="se">\</span>
+         --tool-args -- <span class="o">[</span>arguments to pass to llc<span class="o">]</span>              <span class="se">\</span>
+         --args -- <span class="o">[</span>program arguments<span class="o">]</span>
+</pre></div>
+</div>
+<p><strong>Special note:</strong> if you are debugging MultiSource or SPEC tests that
+already exist in the <tt class="docutils literal"><span class="pre">llvm/test</span></tt> hierarchy, there is an easier way to
+debug the JIT, LLC, and CBE, using the pre-written Makefile targets, which
+will pass the program options specified in the Makefiles:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nb">cd </span>llvm/test/../../program
+make bugpoint-jit
+</pre></div>
+</div>
+<p>At the end of a successful <tt class="docutils literal"><span class="pre">bugpoint</span></tt> run, you will be presented
+with two bitcode files: a <em>safe</em> file which can be compiled with the C
+backend and the <em>test</em> file which either LLC or the JIT
+mis-codegenerates, and thus causes the error.</p>
+<p>To reproduce the error that <tt class="docutils literal"><span class="pre">bugpoint</span></tt> found, it is sufficient to do
+the following:</p>
+<ol class="arabic">
+<li><p class="first">Regenerate the shared object from the safe bitcode file:</p>
+<div class="highlight-bash"><div class="highlight"><pre>llc -march<span class="o">=</span>c safe.bc -o safe.c
+gcc -shared safe.c -o safe.so
+</pre></div>
+</div>
+</li>
+<li><p class="first">If debugging LLC, compile test bitcode native and link with the shared
+object:</p>
+<div class="highlight-bash"><div class="highlight"><pre>llc test.bc -o test.s
+gcc test.s safe.so -o test.llc
+./test.llc <span class="o">[</span>program options<span class="o">]</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">If debugging the JIT, load the shared object and supply the test
+bitcode:</p>
+<div class="highlight-bash"><div class="highlight"><pre>lli -load<span class="o">=</span>safe.so test.bc <span class="o">[</span>program options<span class="o">]</span>
+</pre></div>
+</div>
+</li>
+</ol>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="SphinxQuickstartTemplate.html" title="Sphinx Quickstart Template"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="yaml2obj.html" title="yaml2obj"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToUseAttributes.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToUseAttributes.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToUseAttributes.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToUseAttributes.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,169 @@
+
+
+<!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 Use Attributes — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="User Guide for NVPTX Back-end" href="NVPTXUsage.html" />
+    <link rel="prev" title="Writing an LLVM Pass" href="WritingAnLLVMPass.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="NVPTXUsage.html" title="User Guide for NVPTX Back-end"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="WritingAnLLVMPass.html" title="Writing an LLVM Pass"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-use-attributes">
+<h1>How To Use Attributes<a class="headerlink" href="#how-to-use-attributes" 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="#attribute" id="id2"><tt class="docutils literal"><span class="pre">Attribute</span></tt></a></li>
+<li><a class="reference internal" href="#attributelist" id="id3"><tt class="docutils literal"><span class="pre">AttributeList</span></tt></a></li>
+<li><a class="reference internal" href="#attrbuilder" id="id4"><tt class="docutils literal"><span class="pre">AttrBuilder</span></tt></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>Attributes in LLVM have changed in some fundamental ways.  It was necessary to
+do this to support expanding the attributes to encompass more than a handful of
+attributes — e.g. command line options.  The old way of handling attributes
+consisted of representing them as a bit mask of values.  This bit mask was
+stored in a “list” structure that was reference counted.  The advantage of this
+was that attributes could be manipulated with ‘or’s and ‘and’s.  The
+disadvantage of this was that there was limited room for expansion, and
+virtually no support for attribute-value pairs other than alignment.</p>
+<p>In the new scheme, an <tt class="docutils literal"><span class="pre">Attribute</span></tt> object represents a single attribute that’s
+uniqued.  You use the <tt class="docutils literal"><span class="pre">Attribute::get</span></tt> methods to create a new <tt class="docutils literal"><span class="pre">Attribute</span></tt>
+object.  An attribute can be a single “enum” value (the enum being the
+<tt class="docutils literal"><span class="pre">Attribute::AttrKind</span></tt> enum), a string representing a target-dependent
+attribute, or an attribute-value pair.  Some examples:</p>
+<ul class="simple">
+<li>Target-independent: <tt class="docutils literal"><span class="pre">noinline</span></tt>, <tt class="docutils literal"><span class="pre">zext</span></tt></li>
+<li>Target-dependent: <tt class="docutils literal"><span class="pre">"no-sse"</span></tt>, <tt class="docutils literal"><span class="pre">"thumb2"</span></tt></li>
+<li>Attribute-value pair: <tt class="docutils literal"><span class="pre">"cpu"</span> <span class="pre">=</span> <span class="pre">"cortex-a8"</span></tt>, <tt class="docutils literal"><span class="pre">align</span> <span class="pre">=</span> <span class="pre">4</span></tt></li>
+</ul>
+<p>Note: for an attribute value pair, we expect a target-dependent attribute to
+have a string for the value.</p>
+</div>
+<div class="section" id="attribute">
+<h2><a class="toc-backref" href="#id2"><tt class="docutils literal"><span class="pre">Attribute</span></tt></a><a class="headerlink" href="#attribute" title="Permalink to this headline">¶</a></h2>
+<p>An <tt class="docutils literal"><span class="pre">Attribute</span></tt> object is designed to be passed around by value.</p>
+<p>Because attributes are no longer represented as a bit mask, you will need to
+convert any code which does treat them as a bit mask to use the new query
+methods on the Attribute class.</p>
+</div>
+<div class="section" id="attributelist">
+<h2><a class="toc-backref" href="#id3"><tt class="docutils literal"><span class="pre">AttributeList</span></tt></a><a class="headerlink" href="#attributelist" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">AttributeList</span></tt> stores a collection of Attribute objects for each kind of
+object that may have an attribute associated with it: the function as a whole,
+the return type, or the function’s parameters.  A function’s attributes are at
+index <tt class="docutils literal"><span class="pre">AttributeList::FunctionIndex</span></tt>; the return type’s attributes are at
+index <tt class="docutils literal"><span class="pre">AttributeList::ReturnIndex</span></tt>; and the function’s parameters’ attributes
+are at indices 1, ..., n (where ‘n’ is the number of parameters).  Most methods
+on the <tt class="docutils literal"><span class="pre">AttributeList</span></tt> class take an index parameter.</p>
+<p>An <tt class="docutils literal"><span class="pre">AttributeList</span></tt> is also a uniqued and immutable object.  You create an
+<tt class="docutils literal"><span class="pre">AttributeList</span></tt> through the <tt class="docutils literal"><span class="pre">AttributeList::get</span></tt> methods.  You can add and
+remove attributes, which result in the creation of a new <tt class="docutils literal"><span class="pre">AttributeList</span></tt>.</p>
+<p>An <tt class="docutils literal"><span class="pre">AttributeList</span></tt> object is designed to be passed around by value.</p>
+<p>Note: It is advised that you do <em>not</em> use the <tt class="docutils literal"><span class="pre">AttributeList</span></tt> “introspection”
+methods (e.g. <tt class="docutils literal"><span class="pre">Raw</span></tt>, <tt class="docutils literal"><span class="pre">getRawPointer</span></tt>, etc.).  These methods break
+encapsulation, and may be removed in a future release (i.e. LLVM 4.0).</p>
+</div>
+<div class="section" id="attrbuilder">
+<h2><a class="toc-backref" href="#id4"><tt class="docutils literal"><span class="pre">AttrBuilder</span></tt></a><a class="headerlink" href="#attrbuilder" title="Permalink to this headline">¶</a></h2>
+<p>Lastly, we have a “builder” class to help create the <tt class="docutils literal"><span class="pre">AttributeList</span></tt> object
+without having to create several different intermediate uniqued
+<tt class="docutils literal"><span class="pre">AttributeList</span></tt> objects.  The <tt class="docutils literal"><span class="pre">AttrBuilder</span></tt> class allows you to add and
+remove attributes at will.  The attributes won’t be uniqued until you call the
+appropriate <tt class="docutils literal"><span class="pre">AttributeList::get</span></tt> method.</p>
+<p>An <tt class="docutils literal"><span class="pre">AttrBuilder</span></tt> object is <em>not</em> designed to be passed around by value.  It
+should be passed by reference.</p>
+<p>Note: It is advised that you do <em>not</em> use the <tt class="docutils literal"><span class="pre">AttrBuilder::addRawValue()</span></tt>
+method or the <tt class="docutils literal"><span class="pre">AttrBuilder(uint64_t</span> <span class="pre">Val)</span></tt> constructor.  These are for
+backwards compatibility and may be removed in a future release (i.e. LLVM 4.0).</p>
+<p>And that’s basically it! A lot of functionality is hidden behind these classes,
+but the interfaces are pretty straight forward.</p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="NVPTXUsage.html" title="User Guide for NVPTX Back-end"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="WritingAnLLVMPass.html" title="Writing an LLVM Pass"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/HowToUseInstrMappings.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/HowToUseInstrMappings.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/HowToUseInstrMappings.html (added)
+++ www-releases/trunk/7.0.1/docs/HowToUseInstrMappings.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,270 @@
+
+
+<!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 Use Instruction Mappings — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="up" title="Writing an LLVM Backend" href="WritingAnLLVMBackend.html" />
+    <link rel="next" title="Garbage Collection with LLVM" href="GarbageCollection.html" />
+    <link rel="prev" title="Writing an LLVM Backend" href="WritingAnLLVMBackend.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="GarbageCollection.html" title="Garbage Collection with LLVM"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="WritingAnLLVMBackend.html" title="Writing an LLVM Backend"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+
+          <li><a href="WritingAnLLVMBackend.html" accesskey="U">Writing an LLVM Backend</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="how-to-use-instruction-mappings">
+<h1>How To Use Instruction Mappings<a class="headerlink" href="#how-to-use-instruction-mappings" 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="#instrmapping-class-overview" id="id2"><tt class="docutils literal"><span class="pre">InstrMapping</span></tt> Class Overview</a><ul>
+<li><a class="reference internal" href="#sample-example" id="id3">Sample Example</a></li>
+</ul>
+</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>This document contains information about adding instruction mapping support
+for a target. The motivation behind this feature comes from the need to switch
+between different instruction formats during various optimizations. One approach
+could be to use switch cases which list all the instructions along with formats
+they can transition to. However, it has large maintenance overhead
+because of the hardcoded instruction names. Also, whenever a new instruction is
+added in the .td files, all the relevant switch cases should be modified
+accordingly. Instead, the same functionality could be achieved with TableGen and
+some support from the .td files for a fraction of maintenance cost.</p>
+</div>
+<div class="section" id="instrmapping-class-overview">
+<h2><a class="toc-backref" href="#id2"><tt class="docutils literal"><span class="pre">InstrMapping</span></tt> Class Overview</a><a class="headerlink" href="#instrmapping-class-overview" title="Permalink to this headline">¶</a></h2>
+<p>TableGen uses relationship models to map instructions with each other. These
+models are described using <tt class="docutils literal"><span class="pre">InstrMapping</span></tt> class as a base. Each model sets
+various fields of the <tt class="docutils literal"><span class="pre">InstrMapping</span></tt> class such that they can uniquely
+describe all the instructions using that model. TableGen parses all the relation
+models and uses the information to construct relation tables which relate
+instructions with each other. These tables are emitted in the
+<tt class="docutils literal"><span class="pre">XXXInstrInfo.inc</span></tt> file along with the functions to query them. Following
+is the definition of <tt class="docutils literal"><span class="pre">InstrMapping</span></tt> class definied in Target.td file:</p>
+<div class="highlight-text"><div class="highlight"><pre>class InstrMapping {
+  // Used to reduce search space only to the instructions using this
+  // relation model.
+  string FilterClass;
+
+  // List of fields/attributes that should be same for all the instructions in
+  // a row of the relation table. Think of this as a set of properties shared
+  // by all the instructions related by this relationship.
+  list<string> RowFields = [];
+
+  // List of fields/attributes that are same for all the instructions
+  // in a column of the relation table.
+  list<string> ColFields = [];
+
+  // Values for the fields/attributes listed in 'ColFields' corresponding to
+  // the key instruction. This is the instruction that will be transformed
+  // using this relation model.
+  list<string> KeyCol = [];
+
+  // List of values for the fields/attributes listed in 'ColFields', one for
+  // each column in the relation table. These are the instructions a key
+  // instruction will be transformed into.
+  list<list<string> > ValueCols = [];
+}
+</pre></div>
+</div>
+<div class="section" id="sample-example">
+<h3><a class="toc-backref" href="#id3">Sample Example</a><a class="headerlink" href="#sample-example" title="Permalink to this headline">¶</a></h3>
+<p>Let’s say that we want to have a function
+<tt class="docutils literal"><span class="pre">int</span> <span class="pre">getPredOpcode(uint16_t</span> <span class="pre">Opcode,</span> <span class="pre">enum</span> <span class="pre">PredSense</span> <span class="pre">inPredSense)</span></tt> which
+takes a non-predicated instruction and returns its predicated true or false form
+depending on some input flag, <tt class="docutils literal"><span class="pre">inPredSense</span></tt>. The first step in the process is
+to define a relationship model that relates predicated instructions to their
+non-predicated form by assigning appropriate values to the <tt class="docutils literal"><span class="pre">InstrMapping</span></tt>
+fields. For this relationship, non-predicated instructions are treated as key
+instruction since they are the one used to query the interface function.</p>
+<div class="highlight-text"><div class="highlight"><pre>def getPredOpcode : InstrMapping {
+  // Choose a FilterClass that is used as a base class for all the
+  // instructions modeling this relationship. This is done to reduce the
+  // search space only to these set of instructions.
+  let FilterClass = "PredRel";
+
+  // Instructions with same values for all the fields in RowFields form a
+  // row in the resulting relation table.
+  // For example, if we want to relate 'ADD' (non-predicated) with 'Add_pt'
+  // (predicated true) and 'Add_pf' (predicated false), then all 3
+  // instructions need to have same value for BaseOpcode field. It can be any
+  // unique value (Ex: XYZ) and should not be shared with any other
+  // instruction not related to 'add'.
+  let RowFields = ["BaseOpcode"];
+
+  // List of attributes that can be used to define key and column instructions
+  // for a relation. Key instruction is passed as an argument
+  // to the function used for querying relation tables. Column instructions
+  // are the instructions they (key) can transform into.
+  //
+  // Here, we choose 'PredSense' as ColFields since this is the unique
+  // attribute of the key (non-predicated) and column (true/false)
+  // instructions involved in this relationship model.
+  let ColFields = ["PredSense"];
+
+  // The key column contains non-predicated instructions.
+  let KeyCol = ["none"];
+
+  // Two value columns - first column contains instructions with
+  // PredSense=true while second column has instructions with PredSense=false.
+  let ValueCols = [["true"], ["false"]];
+}
+</pre></div>
+</div>
+<p>TableGen uses the above relationship model to emit relation table that maps
+non-predicated instructions with their predicated forms. It also outputs the
+interface function
+<tt class="docutils literal"><span class="pre">int</span> <span class="pre">getPredOpcode(uint16_t</span> <span class="pre">Opcode,</span> <span class="pre">enum</span> <span class="pre">PredSense</span> <span class="pre">inPredSense)</span></tt> to query
+the table. Here, Function <tt class="docutils literal"><span class="pre">getPredOpcode</span></tt> takes two arguments, opcode of the
+current instruction and PredSense of the desired instruction, and returns
+predicated form of the instruction, if found in the relation table.
+In order for an instruction to be added into the relation table, it needs
+to include relevant information in its definition. For example, consider
+following to be the current definitions of ADD, ADD_pt (true) and ADD_pf (false)
+instructions:</p>
+<div class="highlight-text"><div class="highlight"><pre>def ADD : ALU32_rr<(outs IntRegs:$dst), (ins IntRegs:$a, IntRegs:$b),
+            "$dst = add($a, $b)",
+            [(set (i32 IntRegs:$dst), (add (i32 IntRegs:$a),
+                                           (i32 IntRegs:$b)))]>;
+
+def ADD_Pt : ALU32_rr<(outs IntRegs:$dst),
+                       (ins PredRegs:$p, IntRegs:$a, IntRegs:$b),
+            "if ($p) $dst = add($a, $b)",
+            []>;
+
+def ADD_Pf : ALU32_rr<(outs IntRegs:$dst),
+                       (ins PredRegs:$p, IntRegs:$a, IntRegs:$b),
+            "if (!$p) $dst = add($a, $b)",
+            []>;
+</pre></div>
+</div>
+<p>In this step, we modify these instructions to include the information
+required by the relationship model, <tt>getPredOpcode</tt>, so that they can
+be related.</p>
+<div class="highlight-text"><div class="highlight"><pre>def ADD : PredRel, ALU32_rr<(outs IntRegs:$dst), (ins IntRegs:$a, IntRegs:$b),
+            "$dst = add($a, $b)",
+            [(set (i32 IntRegs:$dst), (add (i32 IntRegs:$a),
+                                           (i32 IntRegs:$b)))]> {
+  let BaseOpcode = "ADD";
+  let PredSense = "none";
+}
+
+def ADD_Pt : PredRel, ALU32_rr<(outs IntRegs:$dst),
+                       (ins PredRegs:$p, IntRegs:$a, IntRegs:$b),
+            "if ($p) $dst = add($a, $b)",
+            []> {
+  let BaseOpcode = "ADD";
+  let PredSense = "true";
+}
+
+def ADD_Pf : PredRel, ALU32_rr<(outs IntRegs:$dst),
+                       (ins PredRegs:$p, IntRegs:$a, IntRegs:$b),
+            "if (!$p) $dst = add($a, $b)",
+            []> {
+  let BaseOpcode = "ADD";
+  let PredSense = "false";
+}
+</pre></div>
+</div>
+<p>Please note that all the above instructions use <tt class="docutils literal"><span class="pre">PredRel</span></tt> as a base class.
+This is extremely important since TableGen uses it as a filter for selecting
+instructions for <tt class="docutils literal"><span class="pre">getPredOpcode</span></tt> model. Any instruction not derived from
+<tt class="docutils literal"><span class="pre">PredRel</span></tt> is excluded from the analysis. <tt class="docutils literal"><span class="pre">BaseOpcode</span></tt> is another important
+field. Since it’s selected as a <tt class="docutils literal"><span class="pre">RowFields</span></tt> of the model, it is required
+to have the same value for all 3 instructions in order to be related. Next,
+<tt class="docutils literal"><span class="pre">PredSense</span></tt> is used to determine their column positions by comparing its value
+with <tt class="docutils literal"><span class="pre">KeyCol</span></tt> and <tt class="docutils literal"><span class="pre">ValueCols</span></tt>. If an instruction sets its <tt class="docutils literal"><span class="pre">PredSense</span></tt>
+value to something not used in the relation model, it will not be assigned
+a column in the relation table.</p>
+</div>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="GarbageCollection.html" title="Garbage Collection with LLVM"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="WritingAnLLVMBackend.html" title="Writing an LLVM Backend"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+
+          <li><a href="WritingAnLLVMBackend.html" >Writing an LLVM Backend</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/InAlloca.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/InAlloca.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/InAlloca.html (added)
+++ www-releases/trunk/7.0.1/docs/InAlloca.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,241 @@
+
+
+<!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>Design and Usage of the InAlloca Attribute — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="Using ARM NEON instructions in big endian mode" href="BigEndianNEON.html" />
+    <link rel="prev" title="Stack maps and patch points in LLVM" href="StackMaps.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="BigEndianNEON.html" title="Using ARM NEON instructions in big endian mode"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="StackMaps.html" title="Stack maps and patch points in LLVM"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="design-and-usage-of-the-inalloca-attribute">
+<h1>Design and Usage of the InAlloca Attribute<a class="headerlink" href="#design-and-usage-of-the-inalloca-attribute" 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>The <a class="reference internal" href="LangRef.html#attr-inalloca"><em>inalloca</em></a> attribute is designed to allow
+taking the address of an aggregate argument that is being passed by
+value through memory.  Primarily, this feature is required for
+compatibility with the Microsoft C++ ABI.  Under that ABI, class
+instances that are passed by value are constructed directly into
+argument stack memory.  Prior to the addition of inalloca, calls in LLVM
+were indivisible instructions.  There was no way to perform intermediate
+work, such as object construction, between the first stack adjustment
+and the final control transfer.  With inalloca, all arguments passed in
+memory are modelled as a single alloca, which can be stored to prior to
+the call.  Unfortunately, this complicated feature comes with a large
+set of restrictions designed to bound the lifetime of the argument
+memory around the call.</p>
+<p>For now, it is recommended that frontends and optimizers avoid producing
+this construct, primarily because it forces the use of a base pointer.
+This feature may grow in the future to allow general mid-level
+optimization, but for now, it should be regarded as less efficient than
+passing by value with a copy.</p>
+</div>
+<div class="section" id="intended-usage">
+<h2>Intended Usage<a class="headerlink" href="#intended-usage" title="Permalink to this headline">¶</a></h2>
+<p>The example below is the intended LLVM IR lowering for some C++ code
+that passes two default-constructed <tt class="docutils literal"><span class="pre">Foo</span></tt> objects to <tt class="docutils literal"><span class="pre">g</span></tt> in the
+32-bit Microsoft C++ ABI.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Foo is non-trivial.</span>
+<span class="k">struct</span> <span class="n">Foo</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">;</span> <span class="n">Foo</span><span class="p">();</span> <span class="o">~</span><span class="n">Foo</span><span class="p">();</span> <span class="n">Foo</span><span class="p">(</span><span class="k">const</span> <span class="n">Foo</span> <span class="o">&</span><span class="p">);</span> <span class="p">};</span>
+<span class="kt">void</span> <span class="n">g</span><span class="p">(</span><span class="n">Foo</span> <span class="n">a</span><span class="p">,</span> <span class="n">Foo</span> <span class="n">b</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="n">g</span><span class="p">(</span><span class="n">Foo</span><span class="p">(),</span> <span class="n">Foo</span><span class="p">());</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<div class="highlight-text"><div class="highlight"><pre>%struct.Foo = type { i32, i32 }
+declare void @Foo_ctor(%struct.Foo* %this)
+declare void @Foo_dtor(%struct.Foo* %this)
+declare void @g(<{ %struct.Foo, %struct.Foo }>* inalloca %memargs)
+
+define void @f() {
+entry:
+  %base = call i8* @llvm.stacksave()
+  %memargs = alloca <{ %struct.Foo, %struct.Foo }>
+  %b = getelementptr <{ %struct.Foo, %struct.Foo }>* %memargs, i32 1
+  call void @Foo_ctor(%struct.Foo* %b)
+
+  ; If a's ctor throws, we must destruct b.
+  %a = getelementptr <{ %struct.Foo, %struct.Foo }>* %memargs, i32 0
+  invoke void @Foo_ctor(%struct.Foo* %a)
+      to label %invoke.cont unwind %invoke.unwind
+
+invoke.cont:
+  call void @g(<{ %struct.Foo, %struct.Foo }>* inalloca %memargs)
+  call void @llvm.stackrestore(i8* %base)
+  ...
+
+invoke.unwind:
+  call void @Foo_dtor(%struct.Foo* %b)
+  call void @llvm.stackrestore(i8* %base)
+  ...
+}
+</pre></div>
+</div>
+<p>To avoid stack leaks, the frontend saves the current stack pointer with
+a call to <a class="reference internal" href="LangRef.html#int-stacksave"><em>llvm.stacksave</em></a>.  Then, it allocates the
+argument stack space with alloca and calls the default constructor.  The
+default constructor could throw an exception, so the frontend has to
+create a landing pad.  The frontend has to destroy the already
+constructed argument <tt class="docutils literal"><span class="pre">b</span></tt> before restoring the stack pointer.  If the
+constructor does not unwind, <tt class="docutils literal"><span class="pre">g</span></tt> is called.  In the Microsoft C++ ABI,
+<tt class="docutils literal"><span class="pre">g</span></tt> will destroy its arguments, and then the stack is restored in
+<tt class="docutils literal"><span class="pre">f</span></tt>.</p>
+</div>
+<div class="section" id="design-considerations">
+<h2>Design Considerations<a class="headerlink" href="#design-considerations" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="lifetime">
+<h3>Lifetime<a class="headerlink" href="#lifetime" title="Permalink to this headline">¶</a></h3>
+<p>The biggest design consideration for this feature is object lifetime.
+We cannot model the arguments as static allocas in the entry block,
+because all calls need to use the memory at the top of the stack to pass
+arguments.  We cannot vend pointers to that memory at function entry
+because after code generation they will alias.</p>
+<p>The rule against allocas between argument allocations and the call site
+avoids this problem, but it creates a cleanup problem.  Cleanup and
+lifetime is handled explicitly with stack save and restore calls.  In
+the future, we may want to introduce a new construct such as <tt class="docutils literal"><span class="pre">freea</span></tt>
+or <tt class="docutils literal"><span class="pre">afree</span></tt> to make it clear that this stack adjusting cleanup is less
+powerful than a full stack save and restore.</p>
+</div>
+<div class="section" id="nested-calls-and-copy-elision">
+<h3>Nested Calls and Copy Elision<a class="headerlink" href="#nested-calls-and-copy-elision" title="Permalink to this headline">¶</a></h3>
+<p>We also want to be able to support copy elision into these argument
+slots.  This means we have to support multiple live argument
+allocations.</p>
+<p>Consider the evaluation of:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Foo is non-trivial.</span>
+<span class="k">struct</span> <span class="n">Foo</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">a</span><span class="p">;</span> <span class="n">Foo</span><span class="p">();</span> <span class="n">Foo</span><span class="p">(</span><span class="k">const</span> <span class="o">&</span><span class="n">Foo</span><span class="p">);</span> <span class="o">~</span><span class="n">Foo</span><span class="p">();</span> <span class="p">};</span>
+<span class="n">Foo</span> <span class="n">bar</span><span class="p">(</span><span class="n">Foo</span> <span class="n">b</span><span class="p">);</span>
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">bar</span><span class="p">(</span><span class="n">bar</span><span class="p">(</span><span class="n">Foo</span><span class="p">()));</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In this case, we want to be able to elide copies into <tt class="docutils literal"><span class="pre">bar</span></tt>‘s argument
+slots.  That means we need to have more than one set of argument frames
+active at the same time.  First, we need to allocate the frame for the
+outer call so we can pass it in as the hidden struct return pointer to
+the middle call.  Then we do the same for the middle call, allocating a
+frame and passing its address to <tt class="docutils literal"><span class="pre">Foo</span></tt>‘s default constructor.  By
+wrapping the evaluation of the inner <tt class="docutils literal"><span class="pre">bar</span></tt> with stack save and
+restore, we can have multiple overlapping active call frames.</p>
+</div>
+<div class="section" id="callee-cleanup-calling-conventions">
+<h3>Callee-cleanup Calling Conventions<a class="headerlink" href="#callee-cleanup-calling-conventions" title="Permalink to this headline">¶</a></h3>
+<p>Another wrinkle is the existence of callee-cleanup conventions.  On
+Windows, all methods and many other functions adjust the stack to clear
+the memory used to pass their arguments.  In some sense, this means that
+the allocas are automatically cleared by the call.  However, LLVM
+instead models this as a write of undef to all of the inalloca values
+passed to the call instead of a stack adjustment.  Frontends should
+still restore the stack pointer to avoid a stack leak.</p>
+</div>
+<div class="section" id="exceptions">
+<h3>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h3>
+<p>There is also the possibility of an exception.  If argument evaluation
+or copy construction throws an exception, the landing pad must do
+cleanup, which includes adjusting the stack pointer to avoid a stack
+leak.  This means the cleanup of the stack memory cannot be tied to the
+call itself.  There needs to be a separate IR-level instruction that can
+perform independent cleanup of arguments.</p>
+</div>
+<div class="section" id="efficiency">
+<h3>Efficiency<a class="headerlink" href="#efficiency" title="Permalink to this headline">¶</a></h3>
+<p>Eventually, it should be possible to generate efficient code for this
+construct.  In particular, using inalloca should not require a base
+pointer.  If the backend can prove that all points in the CFG only have
+one possible stack level, then it can address the stack directly from
+the stack pointer.  While this is not yet implemented, the plan is that
+the inalloca attribute should not change much, but the frontend IR
+generation recommendations may change.</p>
+</div>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="BigEndianNEON.html" title="Using ARM NEON instructions in big endian mode"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="StackMaps.html" title="Stack maps and patch points in LLVM"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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/7.0.1/docs/LLVMBuild.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/7.0.1/docs/LLVMBuild.html?rev=349965&view=auto
==============================================================================
--- www-releases/trunk/7.0.1/docs/LLVMBuild.html (added)
+++ www-releases/trunk/7.0.1/docs/LLVMBuild.html Fri Dec 21 13:53:02 2018
@@ -0,0 +1,383 @@
+
+
+<!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>LLVMBuild Guide — LLVM 7 documentation</title>
+    
+    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '7',
+        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>
+    <link rel="top" title="LLVM 7 documentation" href="index.html" />
+    <link rel="next" title="How To Release LLVM To The Public" href="HowToReleaseLLVM.html" />
+    <link rel="prev" title="Creating an LLVM Project" href="Projects.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="index.html">
+    <img src="_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="HowToReleaseLLVM.html" title="How To Release LLVM To The Public"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="Projects.html" title="Creating an LLVM Project"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="llvmbuild-guide">
+<h1>LLVMBuild Guide<a class="headerlink" href="#llvmbuild-guide" 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="#project-organization" id="id2">Project Organization</a></li>
+<li><a class="reference internal" href="#build-integration" id="id3">Build Integration</a></li>
+<li><a class="reference internal" href="#component-overview" id="id4">Component Overview</a></li>
+<li><a class="reference internal" href="#llvmbuild-format-reference" id="id5">LLVMBuild Format Reference</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>This document describes the <tt class="docutils literal"><span class="pre">LLVMBuild</span></tt> organization and files which
+we use to describe parts of the LLVM ecosystem. For description of
+specific LLVMBuild related tools, please see the command guide.</p>
+<p>LLVM is designed to be a modular set of libraries which can be flexibly
+mixed together in order to build a variety of tools, like compilers,
+JITs, custom code generators, optimization passes, interpreters, and so
+on. Related projects in the LLVM system like Clang and LLDB also tend to
+follow this philosophy.</p>
+<p>In order to support this usage style, LLVM has a fairly strict structure
+as to how the source code and various components are organized. The
+<tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt> files are the explicit specification of that
+structure, and are used by the build systems and other tools in order to
+develop the LLVM project.</p>
+</div>
+<div class="section" id="project-organization">
+<h2><a class="toc-backref" href="#id2">Project Organization</a><a class="headerlink" href="#project-organization" title="Permalink to this headline">¶</a></h2>
+<p>The source code for LLVM projects using the LLVMBuild system (LLVM,
+Clang, and LLDB) is organized into <em>components</em>, which define the
+separate pieces of functionality that make up the project. These
+projects may consist of many libraries, associated tools, build tools,
+or other utility tools (for example, testing tools).</p>
+<p>For the most part, the project contents are organized around defining
+one main component per each subdirectory. Each such directory contains
+an <tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt> which contains the component definitions.</p>
+<p>The component descriptions for the project as a whole are automatically
+gathered by the LLVMBuild tools. The tools automatically traverse the
+source directory structure to find all of the component description
+files. NOTE: For performance/sanity reasons, we only traverse into
+subdirectories when the parent itself contains an <tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt>
+description file.</p>
+</div>
+<div class="section" id="build-integration">
+<h2><a class="toc-backref" href="#id3">Build Integration</a><a class="headerlink" href="#build-integration" title="Permalink to this headline">¶</a></h2>
+<p>The LLVMBuild files themselves are just a declarative way to describe
+the project structure. The actual building of the LLVM project is
+handled by another build system (See: <a class="reference internal" href="CMake.html"><em>CMake</em></a>).</p>
+<p>The build system implementation will load the relevant contents of the
+LLVMBuild files and use that to drive the actual project build.
+Typically, the build system will only need to load this information at
+“configure” time, and use it to generate native information. Build
+systems will also handle automatically reconfiguring their information
+when the contents of the <tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt> files change.</p>
+<p>Developers generally are not expected to need to be aware of the details
+of how the LLVMBuild system is integrated into their build. Ideally,
+LLVM developers who are not working on the build system would only ever
+need to modify the contents of the <tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt> description files
+(although we have not reached this goal yet).</p>
+<p>For more information on the utility tool we provide to help interfacing
+with the build system, please see the <a class="reference internal" href="CommandGuide/llvm-build.html"><em>llvm-build</em></a> documentation.</p>
+</div>
+<div class="section" id="component-overview">
+<h2><a class="toc-backref" href="#id4">Component Overview</a><a class="headerlink" href="#component-overview" title="Permalink to this headline">¶</a></h2>
+<p>As mentioned earlier, LLVM projects are organized into logical
+<em>components</em>. Every component is typically grouped into its own
+subdirectory. Generally, a component is organized around a coherent
+group of sources which have some kind of clear API separation from other
+parts of the code.</p>
+<p>LLVM primarily uses the following types of components:</p>
+<ul class="simple">
+<li><em>Libraries</em> - Library components define a distinct API which can be
+independently linked into LLVM client applications. Libraries typically
+have private and public header files, and may specify a link of required
+libraries that they build on top of.</li>
+<li><em>Build Tools</em> - Build tools are applications which are designed to be run
+as part of the build process (typically to generate other source files).
+Currently, LLVM uses one main build tool called <a class="reference internal" href="TableGen/index.html"><em>TableGen</em></a>
+to generate a variety of source files.</li>
+<li><em>Tools</em> - Command line applications which are built using the LLVM
+component libraries. Most LLVM tools are small and are primarily
+frontends to the library interfaces.</li>
+</ul>
+<p>Components are described using <tt class="docutils literal"><span class="pre">LLVMBuild.txt</span></tt> files in the directories
+that define the component. See the <a class="reference internal" href="#llvmbuild-format-reference">LLVMBuild Format Reference</a> section
+for information on the exact format of these files.</p>
+</div>
+<div class="section" id="llvmbuild-format-reference">
+<h2><a class="toc-backref" href="#id5">LLVMBuild Format Reference</a><a class="headerlink" href="#llvmbuild-format-reference" title="Permalink to this headline">¶</a></h2>
+<p>LLVMBuild files are written in a simple variant of the INI or configuration
+file format (<a class="reference external" href="http://en.wikipedia.org/wiki/INI_file">Wikipedia entry</a>). The format defines a list of sections
+each of which may contain some number of properties. A simple example of
+the file format is below:</p>
+<div class="highlight-ini"><div class="highlight"><pre><span class="c">; Comments start with a semi-colon.</span>
+
+<span class="c">; Sections are declared using square brackets.</span>
+<span class="k">[component_0]</span>
+
+<span class="c">; Properties are declared using '=' and are contained in the previous section.</span>
+<span class="c">;</span>
+<span class="c">; We support simple string and boolean scalar values and list values, where</span>
+<span class="c">; items are separated by spaces. There is no support for quoting, and so</span>
+<span class="c">; property values may not contain spaces.</span>
+<span class="na">property_name</span> <span class="o">=</span> <span class="s">property_value</span>
+<span class="na">list_property_name</span> <span class="o">=</span> <span class="s">value_1 value_2 ... value_n</span>
+<span class="na">boolean_property_name</span> <span class="o">=</span> <span class="s">1 (or 0)</span>
+</pre></div>
+</div>
+<p>LLVMBuild files are expected to define a strict set of sections and
+properties. A typical component description file for a library
+component would look like the following example:</p>
+<div class="highlight-ini"><div class="highlight"><pre><span class="k">[component_0]</span>
+<span class="na">type</span> <span class="o">=</span> <span class="s">Library</span>
+<span class="na">name</span> <span class="o">=</span> <span class="s">Linker</span>
+<span class="na">parent</span> <span class="o">=</span> <span class="s">Libraries</span>
+<span class="na">required_libraries</span> <span class="o">=</span> <span class="s">Archive BitReader Core Support TransformUtils</span>
+</pre></div>
+</div>
+<p>A full description of the exact sections and properties which are
+allowed follows.</p>
+<p>Each file may define exactly one common component, named <tt class="docutils literal"><span class="pre">common</span></tt>. The
+common component may define the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">subdirectories</span></tt> <strong>[optional]</strong></p>
+<p>If given, a list of the names of the subdirectories from the current
+subpath to search for additional LLVMBuild files.</p>
+</li>
+</ul>
+<p>Each file may define multiple components. Each component is described by a
+section who name starts with <tt class="docutils literal"><span class="pre">component</span></tt>. The remainder of the section
+name is ignored, but each section name must be unique. Typically components
+are just number in order for files with multiple components
+(<tt class="docutils literal"><span class="pre">component_0</span></tt>, <tt class="docutils literal"><span class="pre">component_1</span></tt>, and so on).</p>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">Section names not matching this format (or the <tt class="docutils literal"><span class="pre">common</span></tt> section) are
+currently unused and are disallowed.</p>
+</div>
+<p>Every component is defined by the properties in the section. The exact
+list of properties that are allowed depends on the component type.
+Components <strong>may not</strong> define any properties other than those expected
+by the component type.</p>
+<p>Every component must define the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span></tt> <strong>[required]</strong></p>
+<p>The type of the component. Supported component types are detailed
+below. Most components will define additional properties which may be
+required or optional.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">name</span></tt> <strong>[required]</strong></p>
+<p>The name of the component. Names are required to be unique across the
+entire project.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">parent</span></tt> <strong>[required]</strong></p>
+<p>The name of the logical parent of the component. Components are
+organized into a logical tree to make it easier to navigate and
+organize groups of components. The parents have no semantics as far
+as the project build is concerned, however. Typically, the parent
+will be the main component of the parent directory.</p>
+<p>Components may reference the root pseudo component using <tt class="docutils literal"><span class="pre">$ROOT</span></tt> to
+indicate they should logically be grouped at the top-level.</p>
+</li>
+</ul>
+<p>Components may define the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">dependencies</span></tt> <strong>[optional]</strong></p>
+<p>If specified, a list of names of components which <em>must</em> be built
+prior to this one. This should only be exactly those components which
+produce some tool or source code required for building the component.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last"><tt class="docutils literal"><span class="pre">Group</span></tt> and <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt> components have no semantics for the
+actual build, and are not allowed to specify dependencies.</p>
+</div>
+</li>
+</ul>
+<p>The following section lists the available component types, as well as
+the properties which are associated with that component.</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">Group</span></tt></p>
+<p>Group components exist purely to allow additional arbitrary structuring
+of the logical components tree. For example, one might define a
+<tt class="docutils literal"><span class="pre">Libraries</span></tt> group to hold all of the root library components.</p>
+<p><tt class="docutils literal"><span class="pre">Group</span></tt> components have no additionally properties.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">Library</span></tt></p>
+<p>Library components define an individual library which should be built
+from the source code in the component directory.</p>
+<p>Components with this type use the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">library_name</span></tt> <strong>[optional]</strong></p>
+<p>If given, the name to use for the actual library file on disk. If
+not given, the name is derived from the component name itself.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">required_libraries</span></tt> <strong>[optional]</strong></p>
+<p>If given, a list of the names of <tt class="docutils literal"><span class="pre">Library</span></tt> or <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt>
+components which must also be linked in whenever this library is
+used. That is, the link time dependencies for this component. When
+tools are built, the build system will include the transitive closure
+of all <tt class="docutils literal"><span class="pre">required_libraries</span></tt> for the components the tool needs.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">add_to_library_groups</span></tt> <strong>[optional]</strong></p>
+<p>If given, a list of the names of <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt> components which
+this component is also part of. This allows nesting groups of
+components.  For example, the <tt class="docutils literal"><span class="pre">X86</span></tt> target might define a library
+group for all of the <tt class="docutils literal"><span class="pre">X86</span></tt> components. That library group might
+then be included in the <tt class="docutils literal"><span class="pre">all-targets</span></tt> library group.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">installed</span></tt> <strong>[optional]</strong> <strong>[boolean]</strong></p>
+<p>Whether this library is installed. Libraries that are not installed
+are only reported by <tt class="docutils literal"><span class="pre">llvm-config</span></tt> when it is run as part of a
+development directory.</p>
+</li>
+</ul>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">LibraryGroup</span></tt></p>
+<p><tt class="docutils literal"><span class="pre">LibraryGroup</span></tt> components are a mechanism to allow easy definition of
+useful sets of related components. In particular, we use them to easily
+specify things like “all targets”, or “all assembly printers”.</p>
+<p>Components with this type use the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">required_libraries</span></tt> <strong>[optional]</strong></p>
+<p>See the <tt class="docutils literal"><span class="pre">Library</span></tt> type for a description of this property.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">add_to_library_groups</span></tt> <strong>[optional]</strong></p>
+<p>See the <tt class="docutils literal"><span class="pre">Library</span></tt> type for a description of this property.</p>
+</li>
+</ul>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">TargetGroup</span></tt></p>
+<p><tt class="docutils literal"><span class="pre">TargetGroup</span></tt> components are an extension of <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt>s,
+specifically for defining LLVM targets (which are handled specially in a
+few places).</p>
+<p>The name of the component should always be the name of the target.</p>
+<p>Components with this type use the <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt> properties in
+addition to:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">has_asmparser</span></tt> <strong>[optional]</strong> <strong>[boolean]</strong></p>
+<p>Whether this target defines an assembly parser.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">has_asmprinter</span></tt> <strong>[optional]</strong> <strong>[boolean]</strong></p>
+<p>Whether this target defines an assembly printer.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">has_disassembler</span></tt> <strong>[optional]</strong> <strong>[boolean]</strong></p>
+<p>Whether this target defines a disassembler.</p>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">has_jit</span></tt> <strong>[optional]</strong> <strong>[boolean]</strong></p>
+<p>Whether this target supports JIT compilation.</p>
+</li>
+</ul>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">Tool</span></tt></p>
+<p><tt class="docutils literal"><span class="pre">Tool</span></tt> components define standalone command line tools which should be
+built from the source code in the component directory and linked.</p>
+<p>Components with this type use the following properties:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal"><span class="pre">required_libraries</span></tt> <strong>[optional]</strong></p>
+<p>If given, a list of the names of <tt class="docutils literal"><span class="pre">Library</span></tt> or <tt class="docutils literal"><span class="pre">LibraryGroup</span></tt>
+components which this tool is required to be linked with.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">The values should be the component names, which may not always
+match up with the actual library names on disk.</p>
+</div>
+<p>Build systems are expected to properly include all of the libraries
+required by the linked components (i.e., the transitive closure of
+<tt class="docutils literal"><span class="pre">required_libraries</span></tt>).</p>
+<p>Build systems are also expected to understand that those library
+components must be built prior to linking – they do not also need
+to be listed under <tt class="docutils literal"><span class="pre">dependencies</span></tt>.</p>
+</li>
+</ul>
+</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">type</span> <span class="pre">=</span> <span class="pre">BuildTool</span></tt></p>
+<p><tt class="docutils literal"><span class="pre">BuildTool</span></tt> components are like <tt class="docutils literal"><span class="pre">Tool</span></tt> components, except that the
+tool is supposed to be built for the platform where the build is running
+(instead of that platform being targeted). Build systems are expected
+to handle the fact that required libraries may need to be built for
+multiple platforms in order to be able to link this tool.</p>
+<p><tt class="docutils literal"><span class="pre">BuildTool</span></tt> components currently use the exact same properties as
+<tt class="docutils literal"><span class="pre">Tool</span></tt> components, the type distinction is only used to differentiate
+what the tool is built for.</p>
+</li>
+</ul>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="HowToReleaseLLVM.html" title="How To Release LLVM To The Public"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="Projects.html" title="Creating an LLVM Project"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="index.html">Documentation</a>»</li>
+ 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2018, LLVM Project.
+      Last updated on 2018-12-21.
+      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