[clang] [clang][docs] Improve "Obtainig Clang" section (PR #71313)

Robin Caloudis via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 5 04:35:38 PST 2023


https://github.com/robincaloudis created https://github.com/llvm/llvm-project/pull/71313

The documentation is written relatively to `clang-llvm`, not the root repository directory. Therefore, the `llvm-project` repo needs to be cloned into the existing directory `clang-llvm`. As cloning into an existing directory is only allowed if the directory is empty, I added `mkdir ~/clang-llvm` to make the intent of creating an empty directory explicit.

>From 85d6cfbcebc97e3893f79d1cd39b1718f6e928d4 Mon Sep 17 00:00:00 2001
From: Robin Caloudis <53619127+robincaloudis at users.noreply.github.com>
Date: Sun, 5 Nov 2023 13:34:29 +0100
Subject: [PATCH] [clang][docs] Improve "Obtainig Clang" section

The documentation is written relatively to `clang-llvm`, not the root repository directory. Therefore, the `llvm-project` repo needs to be cloned into the existing directory `clang-llvm`. As cloning into an existing directory is only allowed if the directory is empty, I added `mkdir ~/clang-llvm` to make the intent of creating an empty directory explicit.
---
 clang/docs/LibASTMatchersTutorial.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/docs/LibASTMatchersTutorial.rst b/clang/docs/LibASTMatchersTutorial.rst
index 37c9f178fa8df31..2a3f052f2e9ce15 100644
--- a/clang/docs/LibASTMatchersTutorial.rst
+++ b/clang/docs/LibASTMatchersTutorial.rst
@@ -22,8 +22,8 @@ started guide <https://llvm.org/docs/GettingStarted.html>`_.
 
 .. code-block:: console
 
-      cd ~/clang-llvm
-      git clone https://github.com/llvm/llvm-project.git
+      mkdir ~/clang-llvm && 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.
 



More information about the cfe-commits mailing list