[llvm-branch-commits] [clang] [docs] Use intersphinx for Clang cross-project links (PR #239865)
Reid Kleckner via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Nov 6 17:03:50 PST 2026
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/239865
Use the shared intersphinx mapping in the Clang docs and replace absolute URLs to LLVM and other subprojects with `inv:` links, including the references in `AttrDocs.td`. This enables `sphinx.ext.intersphinx` for the Clang docs configuration.
Links are validated against the inventories at build time, and a downstream or release build can retarget the mapping. `clang/Maintainers.md` keeps its absolute URL because the file is mainly read on GitHub, where `inv:` links do not resolve. Some other links to LLVM are intentionally left for follow-up changes.
Part of #214861. This is the third of three stacked PRs and depends on the two PRs below it.
The Clang docs build cleanly with warnings as errors against the live inventories, and the generated HTML points at the expected pages.
>From 025e40a9425e6c5059de7ff4b9a9af6a12185bc1 Mon Sep 17 00:00:00 2001
From: Reid Kleckner <rkleckner at nvidia.com>
Date: Fri, 11 Sep 2026 22:26:00 +0000
Subject: [PATCH] [docs] Use intersphinx for Clang cross-project links
Configure the Clang documentation with the external project inventories it
references and replace absolute cross-project documentation URLs with
validated intersphinx document and reference roles.
Part of #214861
LLM-aided
---
clang/docs/AddressSanitizer.md | 2 +-
.../BoundsSafety/BoundsSafetyAdoptionGuide.md | 2 +-
clang/docs/CIR/CleanupAndEHDesign.md | 4 ++--
clang/docs/ClangFormatStyleOptions.md | 2 +-
clang/docs/ClangOffloadBundler.md | 9 ++++----
clang/docs/ClangTools.md | 11 +++++-----
clang/docs/ClangTransformerTutorial.md | 2 +-
clang/docs/ControlFlowIntegrity.md | 2 +-
clang/docs/ControlFlowIntegrityDesign.md | 2 +-
clang/docs/CrossCompilation.md | 3 +--
clang/docs/DebuggingCoroutines.md | 3 +--
clang/docs/HIPSupport.md | 4 ++--
clang/docs/InternalsManual.md | 12 +++++-----
clang/docs/LLVMExceptionHandlingCodeGen.md | 3 +--
clang/docs/LanguageExtensions.md | 22 +++++++++----------
clang/docs/LibASTMatchersTutorial.md | 4 ++--
clang/docs/MemorySanitizer.md | 2 +-
clang/docs/OffloadingDesign.md | 2 +-
clang/docs/OpenCLSupport.md | 2 +-
clang/docs/PCHInternals.md | 7 +++---
clang/docs/RealtimeSanitizer.md | 2 +-
clang/docs/ReleaseNotes.md | 6 ++---
clang/docs/SafeBuffers.md | 4 ++--
clang/docs/SanitizerCoverage.md | 2 +-
clang/docs/SourceBasedCodeCoverage.md | 4 ++--
clang/docs/ThinLTO.md | 12 +++++-----
clang/docs/ThreadSanitizer.md | 2 +-
clang/docs/Toolchain.md | 6 ++---
clang/docs/TypeSanitizer.md | 2 +-
clang/docs/UndefinedBehaviorSanitizer.md | 2 +-
clang/docs/UsersManual.md | 2 +-
.../PerformanceInvestigation.md | 3 +--
clang/docs/analyzer/user-docs/FilingBugs.md | 3 +--
clang/docs/conf.py | 3 +++
clang/include/clang/Basic/AttrDocs.td | 8 +++----
35 files changed, 78 insertions(+), 83 deletions(-)
diff --git a/clang/docs/AddressSanitizer.md b/clang/docs/AddressSanitizer.md
index 19276261b75620..35a56ef4af1db0 100644
--- a/clang/docs/AddressSanitizer.md
+++ b/clang/docs/AddressSanitizer.md
@@ -20,7 +20,7 @@ Typical slowdown introduced by AddressSanitizer is **2x**.
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html) and enable
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake) and enable
the `compiler-rt` runtime. An example CMake configuration that will allow
for the use/testing of AddressSanitizer:
diff --git a/clang/docs/BoundsSafety/BoundsSafetyAdoptionGuide.md b/clang/docs/BoundsSafety/BoundsSafetyAdoptionGuide.md
index 39a435d321b72e..97f8ec36953a78 100644
--- a/clang/docs/BoundsSafety/BoundsSafetyAdoptionGuide.md
+++ b/clang/docs/BoundsSafety/BoundsSafetyAdoptionGuide.md
@@ -8,7 +8,7 @@ feature is not available yet. In the mean time, the preview implementation is
available
[here](https://github.com/swiftlang/llvm-project/tree/stable/21.x) in a
fork of `llvm-project`. Please follow
-[Building LLVM with CMake](https://llvm.org/docs/CMake.html) to build the
+[Building LLVM with CMake](inv:llvm:std:doc#CMake) to build the
compiler.
## Feature flag
diff --git a/clang/docs/CIR/CleanupAndEHDesign.md b/clang/docs/CIR/CleanupAndEHDesign.md
index c9b95d730d8ea3..38b67a086b334c 100644
--- a/clang/docs/CIR/CleanupAndEHDesign.md
+++ b/clang/docs/CIR/CleanupAndEHDesign.md
@@ -1211,8 +1211,8 @@ methods for use with the exception handling ABI.
For each supported exception handling ABI, the operations and function
calls used will have a direct correspondence to the LLVM IR instructions
and runtime library functions used for that ABI. The LLVM IR exception
-handling model is described in detail here: [LLVM Exception
-Handling](https://llvm.org/docs/ExceptionHandling.html).
+handling model is described in detail here:
+[LLVM Exception Handling](inv:llvm:std:doc#ExceptionHandling).
A personality function attribute will be added to functions that require
it during the ABI lowering phase.
diff --git a/clang/docs/ClangFormatStyleOptions.md b/clang/docs/ClangFormatStyleOptions.md
index c7de6fc25e1f3a..9bb43829fa2b4b 100644
--- a/clang/docs/ClangFormatStyleOptions.md
+++ b/clang/docs/ClangFormatStyleOptions.md
@@ -149,7 +149,7 @@ the configuration (without a prefix: `Auto`).
Possible values:
- `LLVM`
- A style complying with the [LLVM coding standards](https://llvm.org/docs/CodingStandards.html)
+ A style complying with the [LLVM coding standards](inv:llvm:std:doc#CodingStandards)
- `Google`
A style complying with [Google's C++ style guide](https://google.github.io/styleguide/cppguide.html)
- `Chromium`
diff --git a/clang/docs/ClangOffloadBundler.md b/clang/docs/ClangOffloadBundler.md
index 45f9fba0a50aa0..7b0ece84516f7b 100644
--- a/clang/docs/ClangOffloadBundler.md
+++ b/clang/docs/ClangOffloadBundler.md
@@ -405,11 +405,10 @@ Target-specific information is available for the following:
*AMD GPU*
-: AMD GPU supports target ID and target features. See [User Guide for AMDGPU
- Backend](https://llvm.org/docs/AMDGPUUsage.html) which defines the
- [processors](https://llvm.org/docs/AMDGPUUsage.html#amdgpu-processors) and
- [target
- features](https://llvm.org/docs/AMDGPUUsage.html#amdgpu-target-features)
+: AMD GPU supports target ID and target features. See
+ [User Guide for AMDGPU Backend](inv:llvm:std:doc#AMDGPUUsage) which defines
+ the [processors](inv:llvm:std:label#amdgpu-processors) and
+ [target features](inv:llvm:std:label#amdgpu-target-features)
supported.
Most other targets do not support target IDs.
diff --git a/clang/docs/ClangTools.md b/clang/docs/ClangTools.md
index 3d6103dcf5b014..9245bf914458ea 100644
--- a/clang/docs/ClangTools.md
+++ b/clang/docs/ClangTools.md
@@ -82,19 +82,19 @@ provide its own user-focused documentation.
### `Clang-Doc`
-[Clang-Doc](https://clang.llvm.org/extra/clang-doc.html) is a tool for
+[Clang-Doc](inv:clang-tools-extra:std:doc#clang-doc) is a tool for
generating C and C++ documentation from source code and comments.
### `Clang-Include-Fixer`
-[Clang-Include-Fixer](https://clang.llvm.org/extra/clang-include-fixer.html)
+[Clang-Include-Fixer](inv:clang-tools-extra:std:doc#clang-include-fixer)
is a tool to automate the addition of missing `#include` directives in a C++
file. It adds missing namespace qualifiers to unidentified symbols when
necessary and also removes unused headers.
### `Clang-Tidy`
-[Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/) is a Clang-based C++
+[Clang-Tidy](inv:clang-tools-extra:std:doc#clang-tidy/index) is a Clang-based C++
linter tool. It provides an extensible framework for building compiler-based
static analyses detecting and fixing bug-prone patterns, performance,
portability and maintainability issues. It also has checks for modernizing code
@@ -109,13 +109,13 @@ more.
### `Modularize`
-[Modularize](https://clang.llvm.org/extra/modularize.html) is a standalone
+[Modularize](inv:clang-tools-extra:std:doc#modularize) is a standalone
tool that checks whether a set of headers provides the consistent definitions
required to use modules.
### `pp-trace`
-[pp-trace](https://clang.llvm.org/extra/pp-trace.html) is a standalone tool
+[pp-trace](inv:clang-tools-extra:std:doc#pp-trace) is a standalone tool
that traces preprocessor activity. It’s also used as a test of Clang’s
`PPCallbacks` interface.
@@ -172,4 +172,3 @@ that traces preprocessor activity. It’s also used as a test of Clang’s
```c++
sort(v.begin(), v.end(), greater<>());
```
-
diff --git a/clang/docs/ClangTransformerTutorial.md b/clang/docs/ClangTransformerTutorial.md
index 28a7a428c7bec7..ef032f3d9b3992 100644
--- a/clang/docs/ClangTransformerTutorial.md
+++ b/clang/docs/ClangTransformerTutorial.md
@@ -338,7 +338,7 @@ For additional documentation on these functions, see the header file
## Using a RewriteRule as a clang-tidy check
Transformer supports executing a rewrite rule as a
-[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) check, with the class
+[clang-tidy](inv:clang-tools-extra:std:doc#clang-tidy/index) check, with the class
`clang::tidy::utils::TransformerClangTidyCheck`. It is designed to require
minimal code in the definition. For example, given a rule
`MyCheckAsRewriteRule`, one can define a tidy check as follows:
diff --git a/clang/docs/ControlFlowIntegrity.md b/clang/docs/ControlFlowIntegrity.md
index c25a27fd910c51..fda6f82cb0181e 100644
--- a/clang/docs/ControlFlowIntegrity.md
+++ b/clang/docs/ControlFlowIntegrity.md
@@ -408,4 +408,4 @@ Martin Abadi, Mihai Budiu, Úlfar Erlingsson, Jay Ligatti.
Caroline Tice, Tom Roeder, Peter Collingbourne, Stephen Checkoway,
Úlfar Erlingsson, Luis Lozano, Geoff Pike.
-[gold plugin]: https://llvm.org/docs/GoldPlugin.html
+[gold plugin]: inv:llvm:std:doc#GoldPlugin
diff --git a/clang/docs/ControlFlowIntegrityDesign.md b/clang/docs/ControlFlowIntegrityDesign.md
index 1b3348928c8593..75bb0a42fa0a13 100644
--- a/clang/docs/ControlFlowIntegrityDesign.md
+++ b/clang/docs/ControlFlowIntegrityDesign.md
@@ -781,4 +781,4 @@ ability to protect against invalid casts between polymorphic types.
[intel cet]: https://software.intel.com/en-us/blogs/2016/06/09/intel-release-new-technology-specifications-protect-rop-attacks
[rfg]: https://xlab.tencent.com/en/2016/11/02/return-flow-guard
[safestack]: SafeStack.md
-[type metadata]: https://llvm.org/docs/TypeMetadata.html
+[type metadata]: inv:llvm:std:doc#TypeMetadata
diff --git a/clang/docs/CrossCompilation.md b/clang/docs/CrossCompilation.md
index d6a0134a8fb2b8..90c037bd4849a0 100644
--- a/clang/docs/CrossCompilation.md
+++ b/clang/docs/CrossCompilation.md
@@ -11,7 +11,7 @@ However, this document is *not* a "how to" and won't help you setting your
build system or Makefiles, nor choosing the right CMake options, etc.
Also, it does not cover all the possible options, nor does it contain
specific examples for specific architectures. For a concrete example, the
-[instructions for cross-compiling LLVM itself](https://llvm.org/docs/HowToCrossCompileLLVM.html) may be of interest.
+[instructions for cross-compiling LLVM itself](inv:llvm:std:doc#HowToCrossCompileLLVM) may be of interest.
After reading this document, you should be familiar with the main issues
related to cross-compilation, and what main compiler options Clang provides
@@ -190,4 +190,3 @@ uses hard-float), Clang will pick the `armv7l-linux-gnueabi-ld`
The same is true if you're compiling for different environments, like
`gnueabi` and `androideabi`, and might even link and run, but produce
run-time errors, which are much harder to track down and fix.
-
diff --git a/clang/docs/DebuggingCoroutines.md b/clang/docs/DebuggingCoroutines.md
index 03ea897cb04758..3ab9844184119e 100644
--- a/clang/docs/DebuggingCoroutines.md
+++ b/clang/docs/DebuggingCoroutines.md
@@ -600,7 +600,7 @@ gets emitted, but none of them are really interesting regarding debugging
information.
For more details on the IR representation of coroutines and the relevant
-optimization passes, see [Coroutines in LLVM](https://llvm.org/docs/Coroutines.html).
+optimization passes, see [Coroutines in LLVM](inv:llvm:std:doc#Coroutines).
Emitting debug information inside `CoroSplit` forces us to generate
insufficient debugging information. Usually, the compiler generates debug
@@ -1264,4 +1264,3 @@ The authors of the Folly libraries wrote a blog post series on how they debug co
Besides some topics also covered here (stack traces from the debugger), Folly's blog post series also covers
additional topics, such as capturing async stack traces in performance profiles via eBPF filters
and printing async stack traces on crashes.
-
diff --git a/clang/docs/HIPSupport.md b/clang/docs/HIPSupport.md
index e2c9443145117f..e754459102d194 100644
--- a/clang/docs/HIPSupport.md
+++ b/clang/docs/HIPSupport.md
@@ -730,7 +730,7 @@ We augment the `clang` driver with the following flags:
point to the folder where the library is installed / built under a
`/rocprim` subfolder;
-The [--offload-arch](https://llvm.org/docs/AMDGPUUsage.html#amdgpu-processors)
+The [--offload-arch](inv:llvm:std:label#amdgpu-processors)
flag can be used to specify the accelerator for which offload code is to be
generated.
@@ -879,7 +879,7 @@ At the moment, C++ Standard Parallelism Offload is only available for AMD GPUs,
when the [ROCm](https://rocm.docs.amd.com/en/latest/) stack is used, on the
Linux operating system. Support is synthesised in the following table:
-| [Processor](https://llvm.org/docs/AMDGPUUsage.html#amdgpu-processors) | HMM Mode | Interposition Mode |
+| [Processor](inv:llvm:std:label#amdgpu-processors) | HMM Mode | Interposition Mode |
| ---------------------------------------------------------------------- | -------- | ------------------ |
| GCN GFX9 (Vega) | YES | YES |
| GCN GFX10.1 (RDNA 1) | *NO* | YES |
diff --git a/clang/docs/InternalsManual.md b/clang/docs/InternalsManual.md
index 3b16082b0eeda0..8dc9b4ad58d44b 100644
--- a/clang/docs/InternalsManual.md
+++ b/clang/docs/InternalsManual.md
@@ -13,7 +13,7 @@ and does not describe any of the clients of the libraries.
## LLVM Support Library
The LLVM `libSupport` library provides many underlying libraries and
-[data-structures](https://llvm.org/docs/ProgrammersManual.html), including
+[data-structures](inv:llvm:std:doc#ProgrammersManual), including
command line option processing, various containers, and a system abstraction
layer, which is used for file system access.
@@ -702,7 +702,7 @@ The clang Driver and library are documented {doc}`here <DriverInternals>`.
Clang supports precompiled headers ({doc}`PCH <PCHInternals>`), which uses a
serialized representation of Clang's internal data structures, encoded with the
-[LLVM bitstream format](https://llvm.org/docs/BitCodeFormat.html).
+[LLVM bitstream format](inv:llvm:std:doc#BitCodeFormat).
## The Frontend Library
@@ -2920,7 +2920,7 @@ diagnostics purpose, and inject that in the `ConstraintSatisfaction`.
## The CodeGen Library
-CodeGen takes an {ref}`AST <AST>` as input and produces [LLVM IR code](https://llvm.org/docs/LangRef.html) from it.
+CodeGen takes an {ref}`AST <AST>` as input and produces [LLVM IR code](inv:llvm:std:doc#LangRef) from it.
## How to change Clang
@@ -3393,7 +3393,7 @@ are similar.
to introduce a cleanup. You shouldn't have to deal with
exception-handling directly.
- Testing is extremely important in IR generation. Use `clang -cc1
- -emit-llvm` and [FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) to verify that you're
+ -emit-llvm` and [FileCheck](inv:llvm:std:doc#CommandGuide/FileCheck) to verify that you're
generating the right IR.
6. Teach template instantiation how to cope with your AST node, which requires
@@ -3446,13 +3446,13 @@ the change in behavior. There are four kinds of tests:
provisions for tests for C++ defect reports are described in
{ref}`"C++ Defect Report Tests" <cxx-defect-report-tests>` section.
- AST dump tests: such tests pass printable AST output to the
- [FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) utility,
+ [FileCheck](inv:llvm:std:doc#CommandGuide/FileCheck) utility,
which check presence of certain patterns (or lack of thereof).
- LLVM IR tests: in such tests, the LLVM IR output of Clang is checked, which
is needed in cases when checking diagnostics is not sufficient (e.g. when
testing exception handling or object lifetime). Such tests pass LLVM IR
output to the
- [FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) utility,
+ [FileCheck](inv:llvm:std:doc#CommandGuide/FileCheck) utility,
which check the presence of certain IR patterns (or lack of thereof).
(verifying-diagnostics)=
diff --git a/clang/docs/LLVMExceptionHandlingCodeGen.md b/clang/docs/LLVMExceptionHandlingCodeGen.md
index 4a5720698c10ed..a72e30f6b57ea0 100644
--- a/clang/docs/LLVMExceptionHandlingCodeGen.md
+++ b/clang/docs/LLVMExceptionHandlingCodeGen.md
@@ -9,7 +9,7 @@ flow patterns used to model normal and exceptional exits, and it outlines how
the generated IR differs across common ABI models.
For details on the LLVM IR representation of exception handling, see
-[LLVM Exception Handling](https://llvm.org/docs/ExceptionHandling.html).
+[LLVM Exception Handling](inv:llvm:std:doc#ExceptionHandling).
## Core Model
@@ -232,4 +232,3 @@ void f() {
The above function names and flow are accurate as of LLVM 22.0, but this is
subject to change as the code evolves, and this document might not be updated to
reflect the exact functions used.
-
diff --git a/clang/docs/LanguageExtensions.md b/clang/docs/LanguageExtensions.md
index a9d1f54debd2c4..dc2d6dca15b76d 100644
--- a/clang/docs/LanguageExtensions.md
+++ b/clang/docs/LanguageExtensions.md
@@ -787,16 +787,16 @@ of different sizes and signs is forbidden in binary and ternary builtins.
| T \_\_builtin_elementwise_canonicalize(T x) | return the platform specific canonical encoding of a floating-point number | floating point types |
| T \_\_builtin_elementwise_copysign(T x, T y) | return the magnitude of x with the sign of y. | floating point types |
| T \_\_builtin_elementwise_fmod(T x, T y) | return the floating-point remainder of (x/y) whose sign matches the sign of x. | floating point types |
-| T \_\_builtin_elementwise_max(T x, T y) | return x or y, whichever is larger For floating point types, follows semantics of maxNum in IEEE 754-2008. See [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | integer floating point types (deprecated) |
-| T \_\_builtin_elementwise_min(T x, T y) | return x or y, whichever is smaller For floating point types, follows semantics of minNum in IEEE 754-2008. See [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | integer floating point types (deprecated) |
-| T \_\_builtin_elementwise_maxnum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2008 semantics (maxNum) with +0.0>-0.0. See [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
-| T \_\_builtin_elementwise_minnum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2008 semantics (minNum) with +0.0>-0.0. See [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_max(T x, T y) | return x or y, whichever is larger For floating point types, follows semantics of maxNum in IEEE 754-2008. See [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | integer floating point types (deprecated) |
+| T \_\_builtin_elementwise_min(T x, T y) | return x or y, whichever is smaller For floating point types, follows semantics of minNum in IEEE 754-2008. See [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | integer floating point types (deprecated) |
+| T \_\_builtin_elementwise_maxnum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2008 semantics (maxNum) with +0.0>-0.0. See [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_minnum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2008 semantics (minNum) with +0.0>-0.0. See [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
| T \_\_builtin_elementwise_add_sat(T x, T y) | return the sum of x and y, clamped to the range of representable values for the signed/unsigned integer type. | integer types |
| T \_\_builtin_elementwise_sub_sat(T x, T y) | return the difference of x and y, clamped to the range of representable values for the signed/unsigned integer type. | integer types |
-| T \_\_builtin_elementwise_maximum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
-| T \_\_builtin_elementwise_minimum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
-| T \_\_builtin_elementwise_maximumnum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
-| T \_\_builtin_elementwise_minimumnum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_maximum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_minimum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_maximumnum(T x, T y) | return x or y, whichever is larger. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
+| T \_\_builtin_elementwise_minimumnum(T x, T y) | return x or y, whichever is smaller. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
| T \_\_builtin_elementwise_fshl(T x, T y, T z) | perform a funnel shift left. Concatenate x and y (x is the most significant bits of the wide value), the combined value is shifted left by z (modulo the bit width of the original arguments), and the most significant bits are extracted to produce a result that is the same size as the original arguments. | integer types |
| T \_\_builtin_elementwise_fshr(T x, T y, T z) | perform a funnel shift right. Concatenate x and y (x is the most significant bits of the wide value), the combined value is shifted right by z (modulo the bit width of the original arguments), and the least significant bits are extracted to produce a result that is the same size as the original arguments. | integer types |
| T \_\_builtin_elementwise_clzg(T x[, T y]) | return the number of leading 0 bits in the first argument. If the first argument is 0 and an optional second argument is provided, the second argument is returned. It is undefined behaviour if the first argument is 0 and no second argument is provided. | integer types |
@@ -840,8 +840,8 @@ Let `VT` be a vector type and `ET` the element type of `VT`.
| ET \_\_builtin_reduce_and(VT a) | & | integer types |
| ET \_\_builtin_reduce_or(VT a) | \| | integer types |
| ET \_\_builtin_reduce_xor(VT a) | ^ | integer types |
-| ET \_\_builtin_reduce_maximum(VT a) | return the largest element of the vector. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
-| ET \_\_builtin_reduce_minimum(VT a) | return the smallest element of the vector. Follows IEEE 754-2019 semantics, see [LangRef](http://llvm.org/docs/LangRef.html#i-fminmax-family) for the comparison. | floating point types |
+| ET \_\_builtin_reduce_maximum(VT a) | return the largest element of the vector. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
+| ET \_\_builtin_reduce_minimum(VT a) | return the smallest element of the vector. Follows IEEE 754-2019 semantics, see [LangRef](inv:llvm:std:label#i_fminmax_family) for the comparison. | floating point types |
| ET \_\_builtin_reduce_assoc_fadd(VT a[, ET s]) | associative floating-point add reduction. | floating point types |
| ET \_\_builtin_reduce_in_order_fadd(VT a, ET s) | in order floating-point add reduction, initializing the accumulator with `(ET)s`, then adding each lane of the `a` in-order, starting from lane 0. The additions cannot be reassociated. | floating point types |
@@ -5527,7 +5527,7 @@ The pointer argument must point to the global or generic address space.
These builtins are supported on gfx9, gfx10, gfx11, and gfx12 targets.
They map to the LLVM intrinsics `llvm.amdgcn.av.load.b{8,16,32,64,128}` and
-`llvm.amdgcn.av.store.b{8,16,32,64,128}` documented in [User Guide for AMDGPU Backend](https://llvm.org/docs/AMDGPUUsage.html).
+`llvm.amdgcn.av.store.b{8,16,32,64,128}` documented in [User Guide for AMDGPU Backend](inv:llvm:std:doc#AMDGPUUsage).
### ARM/AArch64 Language Extensions
diff --git a/clang/docs/LibASTMatchersTutorial.md b/clang/docs/LibASTMatchersTutorial.md
index b12e3960f99f2e..1ec15bf33ce6d6 100644
--- a/clang/docs/LibASTMatchersTutorial.md
+++ b/clang/docs/LibASTMatchersTutorial.md
@@ -14,8 +14,8 @@ AST <IntroductionToTheClangAST>`
As Clang is part of the LLVM project, you'll need to download LLVM's
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).
+under different directories. For further information, see the
+[getting started guide](inv:llvm:std:doc#GettingStarted).
```console
mkdir ~/clang-llvm && cd ~/clang-llvm
diff --git a/clang/docs/MemorySanitizer.md b/clang/docs/MemorySanitizer.md
index d9ba74641c7787..c22053e31c5895 100644
--- a/clang/docs/MemorySanitizer.md
+++ b/clang/docs/MemorySanitizer.md
@@ -17,7 +17,7 @@ Here is a non-exhaustive list of cases when MemorySanitizer will report an error
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html).
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake).
## Usage
diff --git a/clang/docs/OffloadingDesign.md b/clang/docs/OffloadingDesign.md
index 6b9346f5d6b05e..e5d3a950087d6a 100644
--- a/clang/docs/OffloadingDesign.md
+++ b/clang/docs/OffloadingDesign.md
@@ -17,7 +17,7 @@ Clang and then executed using the `libomptarget` runtime and the associated
plugin for the target architecture, e.g. `libomptarget.rtl.cuda`. This section
describes the steps necessary to create a functioning device image that can be
loaded by the OpenMP runtime. More information on the OpenMP runtimes can be
-found at the [OpenMP documentation page](https://openmp.llvm.org).
+found at the [OpenMP documentation page](inv:openmp:std:doc#index).
(offloading-overview)=
diff --git a/clang/docs/OpenCLSupport.md b/clang/docs/OpenCLSupport.md
index f72258743ec22b..283c0a1ac27e6c 100644
--- a/clang/docs/OpenCLSupport.md
+++ b/clang/docs/OpenCLSupport.md
@@ -386,7 +386,7 @@ Feel free to contact us on [the Discourse forums (Clang Frontend category)](http
### C++ libraries for OpenCL
-There is ongoing work to support C++ standard libraries from [LLVM's libcxx](https://libcxx.llvm.org/) in OpenCL kernel code using C++ for OpenCL mode.
+There is ongoing work to support C++ standard libraries from [LLVM's libcxx](inv:libcxx:std:doc#index) in OpenCL kernel code using C++ for OpenCL mode.
It is currently possible to include `type_traits` from C++17 in the kernel
sources when the following clang extensions are enabled
diff --git a/clang/docs/PCHInternals.md b/clang/docs/PCHInternals.md
index c7fa0e3f235fcd..89fc8161dc17b4 100644
--- a/clang/docs/PCHInternals.md
+++ b/clang/docs/PCHInternals.md
@@ -62,7 +62,7 @@ Clang's AST files are designed with a compact on-disk representation, which
minimizes both creation time and the time required to initially load the AST
file. The AST file itself contains a serialized representation of Clang's
abstract syntax trees and supporting data structures, stored using the same
-compressed bitstream as [LLVM's bitcode file format](https://llvm.org/docs/BitCodeFormat.html).
+compressed bitstream as [LLVM's bitcode file format](inv:llvm:std:doc#BitCodeFormat).
Clang's AST files are loaded "lazily" from disk. When an AST file is initially
loaded, Clang reads only a small amount of data from the AST file to establish
@@ -125,7 +125,7 @@ only contain the serialized AST.
The `clangast` section is organized into several different blocks, each of
which contains the serialized representation of a part of Clang's internal
representation. Each of the blocks corresponds to either a block or a record
-within [LLVM's bitstream format](https://llvm.org/docs/BitCodeFormat.html).
+within [LLVM's bitstream format](inv:llvm:std:doc#BitCodeFormat).
The contents of each of these logical blocks are described below.
```{image} PCHLayout.png
@@ -134,7 +134,7 @@ The contents of each of these logical blocks are described below.
The `llvm-objdump` utility provides a `-raw-clang-ast` option to extract the
binary contents of the AST section from an object file container.
-The [llvm-bcanalyzer](https://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html)
+The [llvm-bcanalyzer](inv:llvm:std:doc#CommandGuide/llvm-bcanalyzer)
utility can be used to examine the actual structure of the bitstream for the AST
section. This information can be used both to help understand the structure of
the AST section and to isolate areas where the AST representation can still be
@@ -564,4 +564,3 @@ Name Visibility
existing, non-visible, already-deserialized AST nodes visible; it is the
responsibility of the AST reader to find and update these AST nodes when it
is notified of the import.
-
diff --git a/clang/docs/RealtimeSanitizer.md b/clang/docs/RealtimeSanitizer.md
index a333090b860002..29e8445e32a5f3 100644
--- a/clang/docs/RealtimeSanitizer.md
+++ b/clang/docs/RealtimeSanitizer.md
@@ -21,7 +21,7 @@ The runtime slowdown introduced by RealtimeSanitizer is negligible.
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html) and enable the
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake) and enable the
`compiler-rt` runtime. An example CMake configuration that will allow for the
use/testing of RealtimeSanitizer:
diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md
index e6e84323ca73f1..b415e12593d468 100644
--- a/clang/docs/ReleaseNotes.md
+++ b/clang/docs/ReleaseNotes.md
@@ -30,9 +30,9 @@ This document contains the release notes for the Clang C/C++/Objective-C
frontend, part of the LLVM Compiler Infrastructure, release {{env.config.release}}. Here we
describe the status of Clang in some detail, including major
improvements from the previous release and new feature work. For the
-general LLVM release notes, see [the LLVM
-documentation](https://llvm.org/docs/ReleaseNotes.html). For the libc++ release notes,
-see [this page](https://libcxx.llvm.org/ReleaseNotes.html). All LLVM releases
+general LLVM release notes, see
+[the LLVM documentation](inv:llvm:std:doc#ReleaseNotes). For the libc++ release notes,
+see [this page](inv:libcxx:std:doc#ReleaseNotes). All LLVM releases
may be downloaded from the [LLVM releases web site](https://llvm.org/releases/).
For more information about Clang or LLVM, including information about the
diff --git a/clang/docs/SafeBuffers.md b/clang/docs/SafeBuffers.md
index 85bf3a3c81e229..b8182cc1a05546 100644
--- a/clang/docs/SafeBuffers.md
+++ b/clang/docs/SafeBuffers.md
@@ -13,7 +13,7 @@ it combines:
during compilation to help you update your code to encapsulate and propagate
the bounds information associated with pointers;
- runtime assertions implemented as part of
- ([libc++ hardening modes](https://libcxx.llvm.org/Hardening.html))
+ ([libc++ hardening modes](inv:libcxx:std:doc#Hardening))
that eliminate undefined behavior as long as the coding convention
is followed and the bounds information is therefore available and correct.
@@ -37,7 +37,7 @@ In order to achieve bounds safety, your codebase needs to have access to
well-encapsulated bounds-safe container, view, and iterator types.
If your project uses libc++, standard container and view types such as
`std::vector` and `std::span` can be made bounds-safe by enabling
-the "fast" [hardening mode](https://libcxx.llvm.org/Hardening.html)
+the "fast" [hardening mode](inv:libcxx:std:doc#Hardening)
(passing `-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST`) to your
compiler) or any of the stricter hardening modes.
diff --git a/clang/docs/SanitizerCoverage.md b/clang/docs/SanitizerCoverage.md
index ae074d13f5322a..5d988fc69de47d 100644
--- a/clang/docs/SanitizerCoverage.md
+++ b/clang/docs/SanitizerCoverage.md
@@ -272,7 +272,7 @@ around comparison instructions and switch statements.
Similarly, with `-fsanitize-coverage=trace-div` the compiler will instrument
integer division instructions (to capture the right argument of division)
and with `-fsanitize-coverage=trace-gep` --
-the [LLVM GEP instructions](https://llvm.org/docs/GetElementPtr.html)
+the [LLVM GEP instructions](inv:llvm:std:doc#GetElementPtr)
(to capture array indices).
Similarly, with `-fsanitize-coverage=trace-loads` and `-fsanitize-coverage=trace-stores`
the compiler will instrument loads and stores, respectively.
diff --git a/clang/docs/SourceBasedCodeCoverage.md b/clang/docs/SourceBasedCodeCoverage.md
index 91fa5485ce78e2..e531e1882b3eae 100644
--- a/clang/docs/SourceBasedCodeCoverage.md
+++ b/clang/docs/SourceBasedCodeCoverage.md
@@ -120,7 +120,7 @@ copy that's mapped into memory). This implementation can be also enabled for
other platforms by passing the `-runtime-counter-relocation` option to the
backend during compilation.
-For a program such as the [Lit](https://llvm.org/docs/CommandGuide/lit.html)
+For a program such as the [Lit](inv:llvm:std:doc#CommandGuide/lit)
testing tool, which invokes other programs, it may be necessary to set
`LLVM_PROFILE_FILE` for each invocation. The pattern strings "%p" or "%Nm"
may help to avoid corruption due to concurrency. Note that "%p" is also a Lit
@@ -224,7 +224,7 @@ TOTAL 13 0 100.00% 3
The `llvm-cov` tool supports specifying a custom demangler, writing out
reports in a directory structure, and generating HTML reports. For the full
-list of options, please refer to the [command guide](https://llvm.org/docs/CommandGuide/llvm-cov.html).
+list of options, please refer to the [command guide](inv:llvm:std:doc#CommandGuide/llvm-cov).
A few final notes:
diff --git a/clang/docs/ThinLTO.md b/clang/docs/ThinLTO.md
index 4487b348c0e92d..6db440dc688662 100644
--- a/clang/docs/ThinLTO.md
+++ b/clang/docs/ThinLTO.md
@@ -39,7 +39,7 @@ the performance improvement.
The 3.9 release of clang includes ThinLTO support. However, ThinLTO
is under active development, and new features, improvements and bugfixes
are being added for the next release. For the latest ThinLTO support,
-[build a recent version of clang and LLVM](https://llvm.org/docs/CMake.html).
+[build a recent version of clang and LLVM](inv:llvm:std:doc#CMake).
### Linkers
@@ -51,7 +51,7 @@ ThinLTO is currently supported for the following linkers:
- **gold (via the gold-plugin)**:
Similar to monolithic LTO, this requires using
- a [gold linker configured with plugins enabled](https://llvm.org/docs/GoldPlugin.html).
+ a [gold linker configured with plugins enabled](inv:llvm:std:doc#GoldPlugin).
- **ld64**:
Starting with [Xcode 8](https://developer.apple.com/xcode/).
- **lld**:
@@ -197,8 +197,8 @@ with ThinLTO, follow these steps:
1. The host [compiler](#compiler) must be a version of clang that supports ThinLTO.
2. The host [linker](#linker) must support ThinLTO (and in the case of gold, must be
- [configured with plugins enabled](https://llvm.org/docs/GoldPlugin.html)).
-3. Use the following additional [CMake variables](https://llvm.org/docs/CMake.html#options-and-variables)
+ [configured with plugins enabled](inv:llvm:std:doc#GoldPlugin)).
+3. Use the following additional [CMake variables](inv:llvm:std:label#options and variables)
when configuring the bootstrap compiler build:
> - `-DLLVM_ENABLE_LTO=Thin`
@@ -233,7 +233,7 @@ Integrated Distributed ThinLTO (DTLTO) enables the distribution of backend
ThinLTO compilations via external distribution systems, such as Incredibuild,
during the traditional link step.
-The implementation is documented here: <https://llvm.org/docs/DTLTO.html>.
+The implementation is [documented here](inv:llvm:std:doc#DTLTO).
#### Command-Line Options
@@ -269,7 +269,7 @@ When using lld-link:
Note that currently, DTLTO is only supported in some LLD flavors. Support can
be added to other LLD flavours in the future.
-See [DTLTO](https://lld.llvm.org/DTLTO.html) for more information.
+See [DTLTO](inv:lld:std:doc#DTLTO) for more information.
## More Information
diff --git a/clang/docs/ThreadSanitizer.md b/clang/docs/ThreadSanitizer.md
index 7f48a7470e2540..59ccea3392a51f 100644
--- a/clang/docs/ThreadSanitizer.md
+++ b/clang/docs/ThreadSanitizer.md
@@ -9,7 +9,7 @@ ThreadSanitizer is about **5x-10x**.
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html).
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake).
## Supported Platforms
diff --git a/clang/docs/Toolchain.md b/clang/docs/Toolchain.md
index 8ed3c5515132e9..fa61ec79179d08 100644
--- a/clang/docs/Toolchain.md
+++ b/clang/docs/Toolchain.md
@@ -101,11 +101,11 @@ Clang can be configured to use one of several different linkers:
- GNU ld
- GNU gold
-- LLVM's [lld](https://lld.llvm.org)
+- LLVM's [lld](inv:lld:std:doc#index)
- MSVC's link.exe
Link-time optimization is natively supported by lld, and supported via
-a [linker plugin](https://llvm.org/docs/GoldPlugin.html) when using gold.
+a [linker plugin](inv:llvm:std:doc#GoldPlugin) when using gold.
The default linker varies between targets, and can be overridden via the
`-fuse-ld=<linker name>` flag.
@@ -295,7 +295,7 @@ of the [C++ standard library](https://en.cppreference.com/w/cpp).
#### libc++ (LLVM)
-[libc++](https://libcxx.llvm.org/) is LLVM's implementation of the C++
+[libc++](inv:libcxx:std:doc#index) is LLVM's implementation of the C++
standard library, aimed at being a complete implementation of the C++
standards from C++11 onwards.
diff --git a/clang/docs/TypeSanitizer.md b/clang/docs/TypeSanitizer.md
index c346d443b8a4b6..3c3a933ae58bae 100644
--- a/clang/docs/TypeSanitizer.md
+++ b/clang/docs/TypeSanitizer.md
@@ -56,7 +56,7 @@ same function for the library calls.
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html) and enable
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake) and enable
the `compiler-rt` runtime. An example CMake configuration that will allow
for the use/testing of TypeSanitizer:
diff --git a/clang/docs/UndefinedBehaviorSanitizer.md b/clang/docs/UndefinedBehaviorSanitizer.md
index 25fdb741c6a2b2..e663ec9e058d43 100644
--- a/clang/docs/UndefinedBehaviorSanitizer.md
+++ b/clang/docs/UndefinedBehaviorSanitizer.md
@@ -21,7 +21,7 @@ The checks have small runtime cost and no impact on address space layout or ABI.
## How to build
-Build LLVM/Clang with [CMake](https://llvm.org/docs/CMake.html).
+Build LLVM/Clang with [CMake](inv:llvm:std:doc#CMake).
## Usage
diff --git a/clang/docs/UsersManual.md b/clang/docs/UsersManual.md
index 96d1c4e009c71a..3663f48130824d 100644
--- a/clang/docs/UsersManual.md
+++ b/clang/docs/UsersManual.md
@@ -5226,7 +5226,7 @@ $ clang --target=spirv64 test1.cl test2.cl
```
More information about the SPIR-V target settings and supported versions of SPIR-V
-format can be found in [the SPIR-V target guide](https://llvm.org/docs/SPIRVUsage.html).
+format can be found in [the SPIR-V target guide](inv:llvm:std:doc#SPIRVUsage).
(clang-cl)=
diff --git a/clang/docs/analyzer/developer-docs/PerformanceInvestigation.md b/clang/docs/analyzer/developer-docs/PerformanceInvestigation.md
index 3d3ad508e444ed..3fd0b2c0a376a3 100644
--- a/clang/docs/analyzer/developer-docs/PerformanceInvestigation.md
+++ b/clang/docs/analyzer/developer-docs/PerformanceInvestigation.md
@@ -54,7 +54,7 @@ It's easy to start profiling, you only have 2 prerequisites.
Build with `-fno-omit-frame-pointer` and debug info (`-g`).
You can use release builds, but probably the easiest is to set the `CMAKE_BUILD_TYPE=RelWithDebInfo`
along with `CMAKE_CXX_FLAGS="-fno-omit-frame-pointer"` when configuring `llvm`.
-Here is how to [get started](https://llvm.org/docs/CMake.html#quick-start) if you are in trouble.
+Here is how to [get started](inv:llvm:std:label#quick start) if you are in trouble.
```{code-block} bash
:caption: Running the Clang Static Analyzer through ``perf`` to gather samples of the
@@ -135,4 +135,3 @@ cat trace.json | grep -Po '"name":"(.+)"' | sort | uniq -c | sort -nr | head -n
```
`uftrace` can also dump the report as a Flame graph using `uftrace dump --flame-graph`.
-
diff --git a/clang/docs/analyzer/user-docs/FilingBugs.md b/clang/docs/analyzer/user-docs/FilingBugs.md
index ab3fedbe2a155b..4dc5a6b98be3ba 100644
--- a/clang/docs/analyzer/user-docs/FilingBugs.md
+++ b/clang/docs/analyzer/user-docs/FilingBugs.md
@@ -11,6 +11,5 @@ following:
are seeing, including what you thought should have been the expected behavior
and why.
-Please [file bugs and feature requests](https://llvm.org/docs/HowToSubmitABug.html)
+Please [file bugs and feature requests](inv:llvm:std:doc#HowToSubmitABug)
in [LLVM's issue tracker](https://github.com/llvm/llvm-project/issues) and label the report with the `clang:static analyzer` label.
-
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
index e70a5c1aeaf819..39e6d587a3f451 100644
--- a/clang/docs/conf.py
+++ b/clang/docs/conf.py
@@ -26,6 +26,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions += [
+ "sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.graphviz",
@@ -36,6 +37,8 @@
llvm_sphinx_doc_url_prefixes = ("https://clang.llvm.org/docs/",)
+intersphinx_mapping = LLVM_INTERSPHINX_MAPPING.copy()
+
import sphinx
# General information about the project.
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index 2300c8456ef164..a7f570d45c10e1 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -232,7 +232,7 @@ extensions. Section 5 covers named address spaces.
[amdgpu user guide]: https://llvm.org/docs/AMDGPUUsage.html#address-spaces
[iso tr18037]: https://standards.iso.org/ittf/PubliclyAvailableStandards/c051126_ISO_IEC_TR_18037_2008.zip
-[nvptx user guide]: https://llvm.org/docs/NVPTXUsage.html#address-spaces
+[nvptx user guide]: inv:llvm:std:label#address-spaces
}];
}
@@ -3741,8 +3741,8 @@ An error will be given if:
def AMDGPUAvailableVisibleDocs : Documentation {
let Category = DocCatAMDGPUAttributes;
let Content = [{
-This attribute controls availability and visibility as described in the [AMDGPU
-Memory Model](https://llvm.org/docs/AMDGPUMemoryModel.html). When placed on
+This attribute controls availability and visibility as described in the
+[AMDGPU Memory Model](inv:llvm:std:doc#AMDGPUMemoryModel). When placed on
an atomic expression or fence, the resulting atomic or fence instruction carries
the corresponding *AV Metadata*.
@@ -7824,7 +7824,7 @@ should be enabled for the function body. This can also be applied to a method
in Objective C. This attribute will take precedence over the command line flag
in the case where {option}`-mno-speculative-load-hardening` is specified.
-[slh]: https://llvm.org/docs/SpeculativeLoadHardening.html
+[slh]: inv:llvm:std:doc#SpeculativeLoadHardening
Speculative Load Hardening is a best-effort mitigation against
information leak attacks that make use of control flow
More information about the llvm-branch-commits
mailing list