#==============================================================================#
# This file specifies intentionally untracked files that git should ignore.
# See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
-#
-# This file is intentionally different from the output of `git svn show-ignore`,
-# as most of those are useless.
#==============================================================================#
#==============================================================================#
Let's look at an example plugin that prints top-level function names. This
example is checked into the clang repository; please take a look at
the `latest version of PrintFunctionNames.cpp
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?view=markup>`_.
+<https://github.com/llvm/llvm-project/blob/master/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp>`_.
Running the plugin
==================
-plugin -Xclang print-fns
Also see the print-function-name plugin example's
-`README <https://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/README.txt?view=markup>`_
+`README <https://github.com/llvm/llvm-project/blob/master/clang/examples/PrintFunctionNames/README.txt>`_
Using the clang command line
refactoring, etc.
Only a couple of the most basic and fundamental tools are kept in the
-primary Clang Subversion project. The rest of the tools are kept in a
-side-project so that developers who don't want or need to build them
-don't. If you want to get access to the extra Clang Tools repository,
-simply check it out into the tools tree of your Clang checkout and
-follow the usual process for building and working with a combined
-LLVM/Clang checkout:
-
-- With Subversion:
-
- - ``cd llvm/tools/clang/tools``
- - ``svn co https://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra``
-
-- Or with Git:
-
- - ``cd llvm/tools/clang/tools``
- - ``git clone https://llvm.org/git/clang-tools-extra.git extra``
+primary Clang tree. The rest of the tools are kept in a separate
+directory tree, ``clang-tools-extra
+<https://github.com/llvm/llvm-project/tree/master/clang-tools-extra>``_.
This document describes a high-level overview of the organization of
Clang Tools within the project as well as giving an introduction to some
Vectors" above). The `GlobalLayoutBuilder`_ class is responsible for laying
out the globals efficiently to minimize the sizes of the underlying bitsets.
-.. _GlobalLayoutBuilder: https://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/LowerTypeTests.h?view=markup
+.. _GlobalLayoutBuilder: https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
Alignment
~~~~~~~~~
In comparison, the old scheme does not require the splitting but it is more efficient when the combined virtual tables have been split.
The `GlobalSplit`_ pass is responsible for splitting combined virtual tables into individual ones.
-.. _GlobalSplit: https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalSplit.cpp?view=markup
+.. _GlobalSplit: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/IPO/GlobalSplit.cpp
Order virtual tables by a pre-order traversal of the class hierarchy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The first step to adding a new attribute to Clang is to add its definition to
`include/clang/Basic/Attr.td
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup>`_.
+<https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/Attr.td>`_.
This tablegen definition must derive from the ``Attr`` (tablegen, not
semantic) type, or one of its derivatives. Most attributes will derive from the
``InheritableAttr`` type, which specifies that the attribute can be inherited by
either ``diag::warn_attribute_wrong_decl_type`` or
``diag::err_attribute_wrong_decl_type``, and the parameter enumeration is found
in `include/clang/Sema/ParsedAttr.h
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedAttr.h?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Sema/ParsedAttr.h>`_
If a previously unused Decl node is added to the ``SubjectList``, the logic used
to automatically determine the diagnostic parameter in `utils/TableGen/ClangAttrEmitter.cpp
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/utils/TableGen/ClangAttrEmitter.cpp>`_
may need to be updated.
By default, all subjects in the SubjectList must either be a Decl node defined
Documentation is table generated on the public web server by a server-side
process that runs daily. Generally, the documentation for an attribute is a
stand-alone definition in `include/clang/Basic/AttrDocs.td
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/AttrDocs.td>`_
that is named after the attribute being documented.
If the attribute is not for public consumption, or is an implicitly-created
optional. The associated C++ type of the argument is determined by the argument
definition type. If the existing argument types are insufficient, new types can
be created, but it requires modifying `utils/TableGen/ClangAttrEmitter.cpp
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/utils/TableGen/ClangAttrEmitter.cpp>`_
to properly support the type.
Other Properties
If the parsed form of the attribute is more complex, or differs from the
semantic form, the ``HasCustomParsing`` bit can be set to ``1`` for the class,
and the parsing code in `Parser::ParseGNUAttributeArgs()
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/lib/Parse/ParseDecl.cpp>`_
can be updated for the special case. Note that this only applies to arguments
with a GNU spelling -- attributes with a __declspec spelling currently ignore
this flag and are handled by ``Parser::ParseMicrosoftDeclSpec``.
Boilerplate
^^^^^^^^^^^
All semantic processing of declaration attributes happens in `lib/Sema/SemaDeclAttr.cpp
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup>`_,
+<https://github.com/llvm/llvm-project/blob/master/clang/lib/Sema/SemaDeclAttr.cpp>`_,
and generally starts in the ``ProcessDeclAttribute()`` function. If the
attribute is a "simple" attribute -- meaning that it requires no custom semantic
processing aside from what is automatically provided, add a call to
If the attribute adds additional warnings, define a ``DiagGroup`` in
`include/clang/Basic/DiagnosticGroups.td
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/DiagnosticGroups.td>`_
named after the attribute's ``Spelling`` with "_"s replaced by "-"s. If there
is only a single diagnostic, it is permissible to use ``InGroup<DiagGroup<"your-attribute">>``
directly in `DiagnosticSemaKinds.td
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup>`_
+<https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/DiagnosticSemaKinds.td>`_
All semantic diagnostics generated for your attribute, including automatically-
generated ones (such as subjects and argument counts), should have a
=======================
As Clang is part of the LLVM project, you'll need to download LLVM's
-source code first. Both Clang and LLVM are maintained as Subversion
-repositories, but we'll be accessing them through the git mirror. For
-further information, see the `getting started
-guide <https://llvm.org/docs/GettingStarted.html>`_.
+source code first. Both Clang and LLVM are in the same git repository,
+under different directories. For further information, see the `getting
+started guide <https://llvm.org/docs/GettingStarted.html>`_.
.. code-block:: console
- mkdir ~/clang-llvm && cd ~/clang-llvm
- git clone https://llvm.org/git/llvm.git
- cd llvm/tools
- git clone https://llvm.org/git/clang.git
- cd clang/tools
- git clone https://llvm.org/git/clang-tools-extra.git extra
+ cd ~/clang-llvm
+ git clone https://github.com/llvm/llvm-project.git
-Next you need to obtain the CMake build system and Ninja build tool. You
-may already have CMake installed, but current binary versions of CMake
-aren't built with Ninja support.
+Next you need to obtain the CMake build system and Ninja build tool.
.. code-block:: console
cd ~/clang-llvm
mkdir build && cd build
- cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON # Enable tests; default is off.
+ cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS=clang -DLLVM_BUILD_TESTS=ON # Enable tests; default is off.
ninja
ninja check # Test LLVM only.
ninja clang-test # Test Clang only.
And we're live.
-All of the tests should pass, though there is a (very) small chance that
-you can catch LLVM and Clang out of sync. Running ``'git svn rebase'``
-in both the llvm and clang directories should fix any problems.
+All of the tests should pass.
Finally, we want to set Clang as its own compiler.
Linking
^^^^^^^
-For a list of libraries to link, look at one of the tools' Makefiles (for
-example `clang-check/Makefile
-<https://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/Makefile?view=markup>`_).
+For a list of libraries to link, look at one of the tools' CMake files (for
+example `clang-check/CMakeList.txt
+<https://github.com/llvm/llvm-project/blob/master/clang/tools/clang-check/CMakeLists.txt>`_).
libunwind (LLVM)
^^^^^^^^^^^^^^^^
-LLVM's unwinder library can be obtained from subversion:
-
-.. code-block:: console
-
- llvm-src$ svn co https://llvm.org/svn/llvm-project/libunwind/trunk projects/libunwind
-
-When checked out into projects/libunwind within an LLVM checkout,
-it should be automatically picked up by the LLVM build system.
+LLVM's unwinder library is part of the llvm-project git repository. To
+build it, pass ``-DLLVM_ENABLE_PROJECTS=libunwind`` to the cmake invocation.
If using libc++abi, you may need to configure it to use libunwind
rather than libgcc_s by passing ``-DLIBCXXABI_USE_LLVM_UNWINDER=YES``
/// Values for bit flags used in the ident_t to describe the fields.
/// All enumeric elements are named and described in accordance with the code
-/// from http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h
+/// from https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h
enum OpenMPLocationFlags : unsigned {
/// Use trampoline for internal microtask.
OMP_IDENT_IMD = 0x01,
/// Describes ident structure that describes a source location.
/// All descriptions are taken from
-/// http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h
+/// https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h
/// Original structure:
/// typedef struct ident {
/// kmp_int32 reserved_1; /**< might be used in Fortran;
// Initialize default location for psource field of ident_t structure of
// all ident_t objects. Format is ";file;function;line;column;;".
// Taken from
- // http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp_str.c
+ // https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp_str.cpp
DefaultOpenMPPSource =
CGM.GetAddrOfConstantCString(";unknown;unknown;0;0;;").getPointer();
DefaultOpenMPPSource =
// kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds,
// kmp_routine_entry_t *task_entry);
// Task flags. Format is taken from
- // http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h,
+ // https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp.h,
// description of kmp_tasking_flags struct.
enum {
TiedFlag = 0x1,
const VarDecl *TargetParam) const {
llvm_unreachable("Not supported in SIMD-only mode");
}
-
<li><a href="http://lcs.ios.ac.cn/~xuzb/canalyze/memmodel.pdf">Xu, Zhongxing &
Kremenek, Ted & Zhang, Jian. (2010). A Memory Model for Static Analysis of C
Programs.</a></li>
-<li><a href="https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/README.txt">
+<li><a href="https://github.com/llvm/llvm-project/blob/master/clang/lib/StaticAnalyzer/README.txt">
The Clang Static Analyzer README</a></li>
-<li><a href="https://github.com/llvm-mirror/clang/blob/master/docs/analyzer/RegionStore.txt">
+<li><a href="https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/RegionStore.txt">
Documentation for how the Store works</a></li>
-<li><a href="https://github.com/llvm-mirror/clang/blob/master/docs/analyzer/IPA.txt">
+<li><a href="https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/IPA.txt">
Documentation about inlining</a></li>
<li> The "Building a Checker in 24 hours" presentation given at the <a
href="http://llvm.org/devmtg/2012-11">November 2012 LLVM Developer's
<h3 id="buildNix">On Unix-like Systems</h3>
-<p>Note: as an experimental setup, you can use a <b>single checkout</b> with all the projects, and an <b>easy CMake invocation</b>, see the LLVM Doc "<a href="https://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-a-git-monorepo">For developers to work with a git monorepo</a>"</p>
-
<p>If you would like to check out and build Clang, the current procedure is as
follows:</p>
http://www.cmake.org/download</a></li>
</ul>
- <li>Check out LLVM:
+ <li>Check out the LLVM project:
<ul>
<li>Change directory to where you want the llvm directory placed.</li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
- </ul>
- </li>
- <li>Check out Clang:
- <ul>
- <li><tt>cd llvm/tools</tt></li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
- <li><tt>cd ../..</tt></li>
- </ul>
- </li>
- <li>Check out extra Clang tools: (optional)
- <ul>
- <li><tt>cd llvm/tools/clang/tools</tt></li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk
- extra</tt></li>
- <li><tt>cd ../../../..</tt></li>
- </ul>
- </li>
- <li>Check out Compiler-RT (optional):
- <ul>
- <li><tt>cd llvm/projects</tt></li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk
- compiler-rt</tt></li>
- <li><tt>cd ../..</tt></li>
- </ul>
- </li>
- <li>Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)
- <ul>
- <li><tt>cd llvm/projects</tt></li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/libcxx/trunk
- libcxx</tt></li>
- <li><tt>cd ../..</tt></li>
+ <li><tt>git clone https://github.com/llvm/llvm-project.git</tt></li>
</ul>
</li>
<li>Build LLVM and Clang:
<ul>
+ <li><tt>cd llvm-project</tt></li>
<li><tt>mkdir build</tt> (in-tree build is not supported)</li>
<li><tt>cd build</tt></li>
- <li><tt>cmake -G "Unix Makefiles" ../llvm</tt></li>
+ <li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm</tt></li>
<li><tt>make</tt></li>
<li>This builds both LLVM and Clang for debug mode.</li>
<li>Note: For subsequent Clang development, you can just run
</li>
</ol>
-<h3>Simultaneously Building Clang and LLVM:</h3>
-
-<p>Once you have checked out Clang into the llvm source tree it will build along
-with the rest of <tt>llvm</tt>. To build all of LLVM and Clang together all at
-once simply run <tt>make</tt> from the root LLVM directory.</p>
-
-<p>If you encounter problems while building Clang, make sure that your LLVM
-checkout is at the same revision as your Clang checkout. LLVM's interfaces
-change over time, and mismatched revisions are not expected to work
-together. We recommend writing a script to automatically run <tt>svn up</tt> in
-each repository to keep them synchronized. Alternatively, you may consider using
-the unofficial
-<a href="https://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-a-git-monorepo">git monorepo</a>
-which automatically keeps everything in sync at the same revision and lets you
-commit changes atomically across multiple LLVM subprojects.</p>
-
<h3 id="buildWindows">Using Visual Studio</h3>
<p>The following details setting up for and building Clang on Windows using
<ol>
<li>Get the required tools:
<ul>
- <li><b>Subversion</b>. Source code control program. Get it from:
- <a href="https://subversion.apache.org/packages.html">
- https://subversion.apache.org/packages.html</a></li>
+ <li><b>Git</b>. Source code control program. Get it from:
+ <a href="https://git-scm.com/download">
+ https://git-scm.com/download</a></li>
<li><b>CMake</b>. This is used for generating Visual Studio solution and
project files. Get it from:
<a href="https://cmake.org/download/">
</ul>
</li>
- <li>Check out LLVM:
+ <li>Check out LLVM and Clang:
<ul>
- <li><tt>svn co https://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
+ <li><tt>git clone https://github.com/llvm/llvm-project.git</tt></li>
</ul>
- </li>
- <li>Check out Clang:
- <ul>
- <li><tt>cd llvm\tools</tt>
- <li><tt>svn co https://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
- </ul>
- <p><em>Note</em>: Some Clang tests are sensitive to the line endings. Ensure
- that checking out the files does not convert LF line endings to CR+LF.
- If you use git-svn, make sure your <tt>core.autocrlf</tt> setting is false.</p>
+ <p><em>Note</em>: Some Clang tests are sensitive to the line endings. Ensure
+ that checking out the files does not convert LF line endings to CR+LF. If
+ you're using git on Windows, make sure your <tt>core.autocrlf</tt> setting
+ is false.</p>
</li>
<li>Run CMake to generate the Visual Studio solution and project files:
<ul>
<li><tt>cd build</tt></li>
<li>
If you are using Visual Studio 2017:
- <tt>cmake -G "Visual Studio 15 2017" -A x64 -Thost=x64 ..\llvm</tt><br/>
+ <tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 15 2017" -A x64 -Thost=x64 ..\llvm</tt><br/>
<tt>-Thost=x64</tt> is required, since the 32-bit linker will run out of memory.
</li>
<li>To generate x86 binaries instead of x64, pass <tt>-A Win32</tt>.</li>
on running regression tests on Windows.</li>
</ol>
-<p>Note that once you have checked out both llvm and clang, to synchronize
-to the latest code base, use the <tt>svn update</tt> command in both the
-llvm and llvm\tools\clang directories, as they are separate repositories.</p>
-
<h3 id="buildWindowsNinja">Using Ninja alongside Visual Studio</h3>
<p>We recommend that developers who want the fastest incremental builds use the
wrapped <tt>Type*</tt> which you can then dump.</li>
<li>For <a href="http://lldb.llvm.org"> <tt>LLDB</tt></a> users there are
data formatters for clang data structures in
- <a href="http://llvm.org/svn/llvm-project/cfe/trunk/utils/ClangDataFormat.py">
- <tt>utils/ClangDataFormat.py</tt></a>.</li>
+ <a href="https://github.com/llvm/llvm-project/blob/master/clang/utils/ClangDataFormat.py">
+ <tt>clang/utils/ClangDataFormat.py</tt></a>.</li>
</ul>
<!--=====================================================================-->
<h3 id="debuggingVisualStudio">Debugging using Visual Studio</h3>
<!--=====================================================================-->
- <p>The files
- <a href="http://llvm.org/svn/llvm-project/llvm/trunk/utils/LLVMVisualizers/llvm.natvis">
- <tt>utils/LLVMVisualizers/llvm.natvis</tt></a> and
- <a href="http://llvm.org/svn/llvm-project/cfe/trunk/utils/ClangVisualizers/clang.natvis">
- <tt>utils/ClangVisualizers/clang.natvis</tt></a> provide debugger visualizers
+ <p>The files
+ <a href="https://github.com/llvm/llvm-project/blob/master/llvm/utils/LLVMVisualizers/llvm.natvis">
+ <tt>llvm/utils/LLVMVisualizers/llvm.natvis</tt></a> and
+ <a href="https://github.com/llvm/llvm-project/blob/master/clang/utils/ClangVisualizers/clang.natvis">
+ <tt>clang/utils/ClangVisualizers/clang.natvis</tt></a> provide debugger visualizers
that make debugging of more complex data types much easier.</p>
- <p>For Visual Studio 2013 only, put the files into
- <tt>%USERPROFILE%\Documents\Visual Studio 2013\Visualizers</tt> or
+ <p>For Visual Studio 2013 only, put the files into
+ <tt>%USERPROFILE%\Documents\Visual Studio 2013\Visualizers</tt> or
create a symbolic link so they update automatically.</p>
<p>For later versions of Visual Studio, no installation is required.
Note also that later versions of Visual Studio also display better visualizations.</p>
<div class="submenu">
<label>The Code</label>
- <a href="/get_started.html#build">Check Out SVN</a>
- <a href="http://llvm.org/svn/llvm-project/cfe/trunk/">Browse SVN</a>
- <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/">Browse ViewVC</a>
+ <a href="/get_started.html#build">Check Out Sources</a>
+ <a href="https://github.com/llvm/llvm-project/tree/master/clang/">Browse Sources</a>
<a href="http://clang.llvm.org/doxygen/">doxygen</a>
</div>