Skip to content

Commit e8af89e

Browse files
[clang][docs] Improve "Obtaining Clang" section (#71313)
## Why The documentation is written relatively to `clang-llvm`, not the root repository directory. However, some steps in the documentation are relative to the repository root, which is not correct. ## What Documentation steps have been modified to make them correct and outdated ones were updated. Some details: * Correct paths in documentation * Change `bootstrap.py` -> `configure.py` since bootstraping Ninja has [slightly changed](https://github.com/ninja-build/ninja/tree/master?tab=readme-ov-file#python)
1 parent 069e9b4 commit e8af89e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/docs/LibASTMatchersTutorial.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ started guide <https://llvm.org/docs/GettingStarted.html>`_.
2222

2323
.. code-block:: console
2424
25-
cd ~/clang-llvm
25+
mkdir ~/clang-llvm && cd ~/clang-llvm
2626
git clone https://github.com/llvm/llvm-project.git
2727
2828
Next you need to obtain the CMake build system and Ninja build tool.
@@ -33,11 +33,11 @@ Next you need to obtain the CMake build system and Ninja build tool.
3333
git clone https://github.com/martine/ninja.git
3434
cd ninja
3535
git checkout release
36-
./bootstrap.py
36+
./configure.py --bootstrap
3737
sudo cp ninja /usr/bin/
3838
3939
cd ~/clang-llvm
40-
git clone git://cmake.org/stage/cmake.git
40+
git clone https://gitlab.kitware.com/cmake/cmake.git
4141
cd cmake
4242
git checkout next
4343
./bootstrap
@@ -50,7 +50,7 @@ Okay. Now we'll build Clang!
5050
5151
cd ~/clang-llvm
5252
mkdir build && cd build
53-
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=ON
53+
cmake -G Ninja ../llvm-project/llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=ON
5454
ninja
5555
ninja check # Test LLVM only.
5656
ninja clang-test # Test Clang only.
@@ -65,7 +65,7 @@ Finally, we want to set Clang as its own compiler.
6565
.. code-block:: console
6666
6767
cd ~/clang-llvm/build
68-
ccmake ../llvm
68+
ccmake ../llvm-project/llvm
6969
7070
The second command will bring up a GUI for configuring Clang. You need
7171
to set the entry for ``CMAKE_CXX_COMPILER``. Press ``'t'`` to turn on
@@ -89,7 +89,7 @@ live in the ``clang-tools-extra`` repository.
8989

9090
.. code-block:: console
9191
92-
cd ~/clang-llvm
92+
cd ~/clang-llvm/llvm-project
9393
mkdir clang-tools-extra/loop-convert
9494
echo 'add_subdirectory(loop-convert)' >> clang-tools-extra/CMakeLists.txt
9595
vim clang-tools-extra/loop-convert/CMakeLists.txt
@@ -314,7 +314,7 @@ handiwork:
314314

315315
.. code-block:: console
316316
317-
cd ~/clang-llvm/llvm/llvm_build/
317+
cd ~/clang-llvm/build/
318318
ninja loop-convert
319319
vim ~/test-files/simple-loops.cc
320320
bin/loop-convert ~/test-files/simple-loops.cc

0 commit comments

Comments
 (0)