mirror-llvm-project/llvm/docs
Scott Linder 42ff45b865
[docs] Create utils/docs (#203962)
llvm-project is home to many sphinx documentation sites, each with
configuration quirks and bespoke extensions.

The sphinx config model makes sharing code somewhat difficult. There
are options like sphinx-multiproject, but some of our docs builds are
out of the source tree while some are done out of the binary tree, so
the multiproject configuration itself would need to be generated. It
also would impose more uniformity around extensions than required.

This change instead creates a python package at utils/docs/llvm_sphinx
and makes it available to all sphinx-build processes via PYTHONPATH.
Each conf.py does not modify its own sys.path because not all builds are
out of the source tree, so there isn't a stable relative path to use to
refer to the utils/docs/ directory.

Type checking via pyright in new package is pinned to being python 3.8
compatible.

The myst slug script from llvm/docs is promoted to be the default,
with a slight edit to targets needed in FlangDriver.md to adapt to the
change.

The ghlinks extension from clang gets lifted to be the first generic
extension, although it is still only used in clang currently. I used it
as an example of a general extension that might be useful for other
projects, but I also intend to add a new generic extension in a future
patch.

As part of the move ghlinks is refactored a bit:

* Rather than have a main function directly to run its tests, those
  tests are now run via the command-line entrypoint to the new package,
  e.g. `python utils/docs --test` will now replace
  `python clang/docs/ghlinks.py --test`. This makes the command-line
  more pithy (`python utils/docs/llvm_sphinx/ext/ghlinks --test` is a
  bit long), and makes the default behavior when running be to
  include utils/docs in the sys.path, so imports can be absolute and
  the behavior is as close to the CMake targets as possible.
* The static files that were previously written to a tempdir during
  testing are just committed directly in git. The assumption here is
  that the original version was taking pains to avoid polluting the
  clang/docs directory with test files that would confuse sphinx-build,
  and without that limitation the workaround can be removed.
* Some typing-related changes to make it strictly python 3.8 compatible.

Change-Id: Ie16de273f74973f163dbf7fe9d22d80a466d051f
2026-06-24 15:12:48 -04:00
..
_ocamldoc
_static
_templates
_themes/llvm-theme
AMDGPU [AMDGPU][docs][NFC] Update gfx12 documentation (#200976) 2026-06-02 11:55:36 -07:00
AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack
CommandGuide [llvm-objdump] Add --substitute-path and --source-dir for --source (#201096) 2026-06-24 17:00:23 +01:00
DependenceGraphs
DirectX [HLSL] Use 0 to represent unbounded resources (#186022) 2026-03-16 13:36:53 -07:00
Frontend [GlobalISel] Support the byte type in the IRTranslator (#196125) 2026-06-05 06:06:03 -04:00
GlobalISel [GlobalISel] Support the byte type in the IRTranslator (#196125) 2026-06-05 06:06:03 -04:00
HistoricalNotes
PDB [docs][pdb] Link to the pdb-rs docs (#204172) 2026-06-16 18:59:01 +02:00
Proposals fix the link to the Mozilla coding style ref 2025-05-17 12:42:52 +02:00
RISCV [RISCV][docs] Document RISCVVLOptimizer and remove trivial VP intrinsics (#195358) 2026-05-01 16:09:32 -07:00
TableGen [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
tutorial [docs] Kaleidoscope Tutorial Chapter 7 - base class Value* used for AllocaInst for assignment expression (#202101) 2026-06-12 18:22:50 +10:00
AArch64SME.rst [AArch64][SME] Remove SelectionDAG SME ABI lowering (#190950) 2026-04-13 09:52:18 +01:00
AddingConstrainedIntrinsics.rst [llvm] Proofread *.rst (#167108) 2025-11-08 07:41:23 -08:00
AdminTasks.rst Document some of the regular admin tasks (#133825) 2025-09-10 21:21:10 -07:00
AdvancedBuilds.rst [flang][cmake][perf-training] Optimize flang with PGO and BOLT (#198863) 2026-06-24 18:01:07 +01:00
AIToolPolicy.md [docs] Add exception to AI tool policy for Bazel build fixer (#183408) 2026-03-05 13:53:44 -08:00
AliasAnalysis.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
AMDGPUAsyncOperations.rst [AMDGPU] Improve the description of asyncmark semantics (#202579) 2026-06-22 11:20:07 +05:30
AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst [AMDGPU][docs] Remove abandoned augementation-related changes (#204420) 2026-06-18 16:47:17 -04:00
AMDGPUExecutionSynchronization.rst [AMDGPU][doc] Refactor Barrier Execution Model (#204566) 2026-06-22 09:34:05 +02:00
AMDGPUInstructionNotation.rst
AMDGPUInstructionSyntax.rst
AMDGPUMemoryModel.rst [AMDGPU] Implement "non-av" semantics using metadata (#199489) 2026-06-08 10:58:25 +05:30
AMDGPUModifierSyntax.rst [AMDGPU] Documentation files for GFX950 instructions (#184710) 2026-04-10 10:19:20 -07:00
AMDGPUOperandSyntax.rst [AMDGPU] Fix some links in the GFX950 documentation (#195951) 2026-05-06 15:09:00 -07:00
AMDGPUUsage.rst [AMDGPU] Define new target gfx1154 (#204816) 2026-06-23 15:17:04 +02:00
ARM-BE-bitcastfail.png
ARM-BE-bitcastsuccess.png
ARM-BE-ld1.png
ARM-BE-ldr.png
AssignmentTracking.md [DebugInfo][AT] Treat escaping calls as untagged stores in assignment tracking (#183979) 2026-03-12 20:47:53 +05:30
Atomics.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
Benchmarking.rst [llvm] Proofread Benchmarking.rst (#155792) 2025-08-28 07:44:24 -07:00
BigEndianNEON.rst [llvm] Proofread BigEndianNEON.rst (#156141) 2025-08-30 10:01:33 -07:00
BitCodeFormat.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
BlockFrequencyTerminology.rst
BranchWeightMetadata.rst [tools][examples][NFC] Drop remaining uses of BranchInst (#187293) 2026-03-18 15:38:50 +00:00
BugLifeCycle.rst [llvm] Proofread BugLifeCycle.rst (#160817) 2025-09-26 08:44:04 -07:00
BugpointRedesign.md
buildbot_worker_contact.png
BuildingADistribution.rst [llvm] Proofread BuildingADistribution.rst (#160980) 2025-09-27 09:05:24 -07:00
CalleeTypeMetadata.rst [llvm] Introduce callee_type metadata 2025-07-18 14:40:54 -07:00
CallGraphSection.md [NFC][llvm] Update call graph section's name. (#163429) 2025-10-15 07:52:54 -07:00
CFIVerify.rst [llvm] Proofread CFIVerify.rst (#162431) 2025-10-08 08:13:05 -07:00
CIBestPractices.rst [Docs] Reccomend Container Pinning (#198572) 2026-05-19 11:21:55 -07:00
CMake.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
CMakeLists.txt [docs] try again to handle doxygen everywhere (#203081) 2026-06-11 08:58:36 -04:00
CMakePrimer.rst [llvm] Proofread CMakePrimer.rst (#157231) 2025-09-06 09:52:07 -07:00
CodeGenerator.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
CodeOfConduct.rst [docs][Coc] Add link to most recent transparency report (#163964) 2025-10-17 09:55:06 -04:00
CodeReview.rst Document the community RFC process (#116386) 2025-12-04 11:59:57 -05:00
CodingStandards.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
CommandLine.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
CompileCudaWithLLVM.rst [Docs, CUDA] Update cuda compilation docs (#191271) 2026-04-09 15:30:37 -07:00
CompilerWriterInfo.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
conf.py [docs] Create utils/docs (#203962) 2026-06-24 15:12:48 -04:00
ContentAddressableStorage.md [CAS] Add ActionCache to LLVMCAS Library (#114097) 2025-08-20 14:42:44 -07:00
Contributing.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
convergence-both-diverged-nested.png
convergence-closed-path.png
convergence-divergent-inside.png
convergence-divergent-outside.png
convergence-natural-loop.png
ConvergenceAndUniformity.rst [llvm] Fix typos in documentation (#140844) 2025-05-21 01:11:08 -07:00
ConvergentOperations.rst [llvm] Proofread ConvergentOperations.rst (#158214) 2025-09-12 07:52:04 -07:00
Coroutines.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
CoverageMappingFormat.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
cycle-1.png
cycle-2.png
cycle-3.png
CycleTerminology.rst
DebuggingJITedCode.rst
DebuggingLLVM.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
DeveloperPolicy.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
DirectXUsage.rst [llvm] Proofread DirectXUsage.rst (#161481) 2025-10-01 08:59:58 -07:00
DiscourseMigrationGuide.md [www][docs] Remove last mentions of IRC (#139076) 2025-05-08 09:40:33 -04:00
Docker.rst [docs] Fix typo in Docker.rst (#205346) 2026-06-23 17:31:35 +02:00
doxygen-mainpage.dox
doxygen.cfg.in [docs] update CI to use latest release of doxygen (#202420) 2026-06-10 10:25:33 -04:00
DTLTO.rst [DOC][DTLTO] Update DTLTO documentation for the LLVM 22 release (#177368) 2026-01-30 16:17:20 +00:00
epilogue-vectorization-cfg.png
ExceptionHandling.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
ExtendedIntegerResults.txt
ExtendingLLVM.rst [llvm] Proofread ExtendingLLVM.rst (#160646) 2025-09-25 08:52:03 -07:00
Extensions.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
FAQ.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
FatLTO.rst [llvm] Proofread *.rst (#167108) 2025-11-08 07:41:23 -08:00
FaultMaps.rst [llvm] Proofread *.rst (#167108) 2025-11-08 07:41:23 -08:00
FuzzingLLVM.rst [llvm] Proofread FuzzingLLVM.rst (#161046) 2025-09-28 10:27:36 -07:00
GarbageCollection.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
gcc-loops.png
GetElementPtr.rst [llvm] Proofread *.rst (#167108) 2025-11-08 07:41:23 -08:00
GettingInvolved.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
GettingStarted.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
GettingStartedTutorials.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
GettingStartedVS.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
GitBisecting.rst [docs] Point to git bisect --first-parent (#171728) 2025-12-12 14:24:49 -08:00
GitHub.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
GitRepositoryPolicy.md [docs] Rename 22 popular LLVM docs .rst -> .md (#201243) 2026-06-22 16:00:56 -07:00
GoldPlugin.rst [llvm] Proofread GoldPlugin.rst (#166509) 2025-11-05 08:41:47 -08:00
GwpAsan.rst [llvm] Proofread *.rst (#167108) 2025-11-08 07:41:23 -08:00
HowToAddABuilder.rst [DOCS][BUILDBOT] Bump recommended worker version (#144853) 2025-06-26 10:30:55 +01:00
HowToBuildOnARM.rst [llvm] Proofread HowToBuildOnARM.rst (#163039) 2025-10-12 20:49:03 -07:00
HowToBuildWindowsItaniumPrograms.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
HowToBuildWithPGO.rst
HowToCrossCompileBuiltinsOnArm.rst [llvm] Proofread HowToCrossCompileBuiltinsOnArm.rst (#165655) 2025-10-30 12:05:19 -07:00
HowToCrossCompileLLVM.rst [docs] Fix broken formatting for link in HowToCrossCompileLLVM 2025-03-11 20:37:41 +00:00
HowToReleaseLLVM.rst [llvm][docs] Release process improvements (#175759) 2026-01-14 15:31:55 +00:00
HowToSetUpLLVMStyleRTTI.rst [llvm/docs] Add advanced RTTI techniques to HowToSetUpLLVMStyleRTTI (#181863) 2026-02-26 23:46:10 +08:00
HowToSubmitABug.rst docs: Delete incorrect code generation section of HowToSubmitABug (#182315) 2026-02-19 18:21:24 +01:00
HowToUpdateDebugInfo.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
HowToUseAttributes.rst
HowToUseInstrMappings.rst Reapply "[MC][TableGen] Expand Opcode field of MCInstrDesc" (#180321) (#180954) 2026-02-12 09:17:02 +01:00
InAlloca.rst
index.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
InstCombineContributorGuide.md [docs] Fix typos and remove redundant whitespace (#169981) 2025-11-29 13:00:21 +00:00
InstrProfileFormat.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
InstrRefDebugInfo.md [docs] Rename 22 popular LLVM docs .rst -> .md (#201243) 2026-06-22 16:00:56 -07:00
Instrumentor.rst [Instrumentor] Add a property filter for static properties (#197530) 2026-05-14 14:47:35 -07:00
InterfaceExportAnnotations.rst [llvm] revisions to LLVM_ABI export macro definitions (#144598) 2025-06-24 09:18:34 -07:00
JITLink.rst [JITLink][Docs] Update roadmap and availability sections (#195446) 2026-05-03 12:57:55 +02:00
KernelInfo.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
KeyInstructionsDebugInfo.md [Docs] Fixes indents for InstrRefDebugInfo and KeyInstructionsDebugInfo (#194532) 2026-04-28 06:44:47 -07:00
LangRef.rst [ISel] Introduce llvm.pext and llvm.pdep intrinsics (#200570) 2026-06-16 11:05:41 +00:00
Lexicon.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
LFI.rst [LFI][AArch64] Add rewrites for memory accesses (#195167) 2026-06-10 15:58:04 -04:00
LibFuzzer.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
LinkTimeOptimization.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
linpack-pc.png
llvm_telemetry_design.png
loop-guard.svg
loop-irreducible.svg
loop-merge.svg
loop-nested.svg
loop-nonmaximal.svg
loop-separate.svg
loop-single.svg
loop-terminology-guarded-loop.png
loop-terminology-initial-loop.png
loop-terminology-rotated-loop.png
loop-terminology.svg
LoopFusion.rst [LoopFusion][docs][NFC] Document atomic accesses as a fusion blocker (#201775) 2026-06-05 08:28:24 +00:00
LoopTerminology.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
make.bat
MarkdownQuickstartTemplate.md [docs] Rename SphinxQuickstartTemplate.{rst|md} for blame (#198899) 2026-06-02 14:01:42 -07:00
MarkedUpDisassembly.rst
MCJIT-creation.png
MCJIT-dyld-load.png
MCJIT-engine-builder.png
MCJIT-load-object.png
MCJIT-load.png
MCJIT-resolve-relocations.png
MCJITDesignAndImplementation.rst
MeetupGuidelines.rst
MemoryModelRelaxationAnnotations.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
MemorySSA.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
MemProf.rst [docs][MemProf]Update compiler options for static data partitioning (#175872) 2026-01-14 15:12:21 -08:00
MemTagSanitizer.rst
MergeFunctions.rst [llvm] Proofread MergeFunctions.rst (#166317) 2025-11-04 07:12:45 -08:00
MIRLangRef.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
MisExpect.rst
MLGO.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
MyFirstTypoFix.rst [llvm] Fix typos in documentation (#140844) 2025-05-21 01:11:08 -07:00
NewPassManager.md [docs] Migrate 20 LLVM docs to markdown (#201465) 2026-06-05 15:26:28 -07:00
NVPTXUsage.rst [NVPTX] Add intrinsics for narrow-fp to bf16 conversions (#191376) 2026-04-22 13:04:00 +05:30
OpaquePointers.rst [llvm] Fix typos in documentation (#140844) 2025-05-21 01:11:08 -07:00
OptBisect.rst [llvm] Proofread OptBisect.rst (#162225) 2025-10-07 06:49:33 -07:00
ORCv2.rst
Passes.md [UnifyFunctionExitNodes] Remove the pass (#205519) 2026-06-24 14:36:32 +02:00
PCSectionsMetadata.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
PointerAuth.md
ProgrammersManual.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
ProjectGovernance.rst [docs] Minor edits to project governace docs (#203149) 2026-06-22 22:13:40 +00:00
Projects.rst
QualGroup.rst [QualGroup][docs] Clarify biannual membership review and active contributor status (#185884) 2026-04-08 22:38:59 +09:00
re_format.7
README.txt [docs] Rename SphinxQuickstartTemplate.{rst|md} for blame (#198899) 2026-06-02 14:01:42 -07:00
Reference.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
ReleaseNotes.md [RISCV] Update Xqcilo Pseudos (#196422) 2026-06-22 22:19:15 -07:00
ReleaseNotesTemplate.txt [Docs] Normalize headers and indents for ReleaseNotes (#194784) 2026-04-29 06:02:21 -07:00
ReleaseProcess.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
Remarks.rst [Remarks] Restructure bitstream remarks to be fully standalone (#156715) 2025-09-22 16:41:39 +01:00
RemoveDIsDebugInfo.md [docs] Rename 22 popular LLVM docs .rst -> .md (#201243) 2026-06-22 16:00:56 -07:00
ReportingGuide.rst
requirements.txt workflows: Require hashed dependencies when installing docs dependencies (#197306) 2026-05-24 13:50:02 -07:00
requirements.txt.in workflows: Require hashed dependencies when installing docs dependencies (#197306) 2026-05-24 13:50:02 -07:00
ResponseGuide.rst [llvm] Proofread *.rst (#168185) 2025-11-15 08:06:23 -08:00
RFCProcess.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
RISCVUsage.rst [RISCV] Adopt SpacemitX60's scheduling model for -mtune=generic (#167008) 2026-06-09 17:26:48 -07:00
SandboxIR.md Reapply "[SandboxIR][Tracker] Implement accept(/*AcceptAll*/) and revert(/*RevertAll*/)" (#199776) (#199805) 2026-05-27 09:03:55 -07:00
SandboxVectorizer.md [SandboxVec][LoadStoreVec] Initial pass implementation (#188308) 2026-03-31 15:15:43 -07:00
ScudoHardenedAllocator.rst [llvm] Fix typos in documentation (#141078) 2025-05-22 13:58:42 -07:00
Security.rst [docs] Remove myself from security response (#203061) 2026-06-17 14:40:39 -03:00
SecurityTransparencyReports.rst 2025 Security Response Group Transparency Report (#194066) 2026-05-07 16:55:17 -03:00
SegmentedStacks.rst
SourceLevelDebugging.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
speculative_load_hardening_microbenchmarks.png
SpeculativeLoadHardening.md
SphinxQuickstartTemplate.md [docs] Rename 22 popular LLVM docs .rst -> .md (#201243) 2026-06-22 16:00:56 -07:00
SPIRVUsage.rst Implement SPV_KHR_poison_freeze extension (#198037) 2026-05-28 16:09:54 +02:00
StackMaps.rst [llvm] Fix typos in documentation (#141078) 2025-05-22 13:58:42 -07:00
StackSafetyAnalysis.rst
Statepoints.rst
SupportLibrary.rst
SupportPolicy.rst
SymbolizerMarkupFormat.rst [llvm] Proofread *.rst (#151087) 2025-08-01 07:01:50 -07:00
SystemLibrary.rst
TableGenFundamentals.rst
Telemetry.rst [docs] Fix typos and remove redundant whitespace (#169981) 2025-11-29 13:00:21 +00:00
TestingGuide.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
TestSuiteGuide.md [Docs] typo settting -> setting (#178665) 2026-03-14 21:43:15 +00:00
TransformMetadata.rst [LoopVectorize] Reland: Add metadata to distinguish vectorized loop body from scalar remainder (#194912) 2026-05-01 09:00:59 -05:00
TypeMetadata.rst
UndefinedBehavior.rst [docs][nfc] Fix code-formatting in UB docs (#139079) 2025-05-08 14:27:46 +01:00
UserGuides.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
VectorizationPlan.rst
Vectorizers.rst [VPlan] Optimize BranchOnTwoConds to chain of 2 simple branches. (#174016) 2026-01-13 20:14:15 +00:00
vplan-early-exit-lowered.dot [VPlan] Optimize BranchOnTwoConds to chain of 2 simple branches. (#174016) 2026-01-13 20:14:15 +00:00
vplan-early-exit-lowered.png [VPlan] Optimize BranchOnTwoConds to chain of 2 simple branches. (#174016) 2026-01-13 20:14:15 +00:00
vplan-early-exit.dot [VPlan] Add BranchOnTwoConds, use for early exit plans. (#172750) 2025-12-29 19:39:38 +00:00
vplan-early-exit.png [VPlan] Add BranchOnTwoConds, use for early exit plans. (#172750) 2025-12-29 19:39:38 +00:00
vplan-scope.png
vplan-transform-pipeline.png
WritingAnLLVMBackend.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
WritingAnLLVMNewPMPass.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
WritingAnLLVMPass.md [docs] Migrate 22 popular LLVM docs to MyST (#201244) 2026-06-22 16:02:50 -07:00
XRay.rst
XRayExample.rst
XRayFDRFormat.rst [llvm] Proofread *.rst (#168254) 2025-11-16 08:09:07 -08:00
yaml2obj.rst
YamlIO.rst [llvm] Proofread YamlIO.rst (#165193) 2025-10-26 22:10:04 -07:00

LLVM Documentation
==================

LLVM's documentation is written in reStructuredText, a lightweight
plaintext markup language (file extension `.rst`). While the
reStructuredText documentation should be quite readable in source form, it
is mostly meant to be processed by the Sphinx documentation generation
system to create HTML pages which are hosted on <https://llvm.org/docs/> and
updated after every commit. Manpage output is also supported, see below.

If you instead would like to generate and view the HTML locally, install
Sphinx <http://sphinx-doc.org/> and then do:

    cd <build-dir>
    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true <src-dir>
    make -j3 docs-llvm-html
    $BROWSER <build-dir>/docs/html/index.html

The mapping between reStructuredText files and generated documentation is
`docs/Foo.rst` <-> `<build-dir>/docs//html/Foo.html` <-> `https://llvm.org/docs/Foo.html`.

If you are interested in writing new documentation, you will want to read
`SphinxQuickstartTemplate.md` which will get you writing documentation
very fast and includes examples of the most important reStructuredText
markup syntax.

Manpage Output
===============

Building the manpages is similar to building the HTML documentation. The
primary difference is to use the `man` makefile target, instead of the
default (which is `html`). Sphinx then produces the man pages in the
directory `<build-dir>/docs/man/`.

    cd <build-dir>
    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true <src-dir>
    make -j3 docs-llvm-man
    man -l <build-dir>/docs/man/FileCheck.1

The correspondence between .rst files and man pages is
`docs/CommandGuide/Foo.rst` <-> `<build-dir>/docs//man/Foo.1`.
These .rst files are also included during HTML generation so they are also
viewable online (as noted above) at e.g.
`https://llvm.org/docs/CommandGuide/Foo.html`.

Checking links
==============

The reachability of external links in the documentation can be checked by
running:

    cd llvm/docs/
    sphinx-build -b linkcheck . _build/lintcheck/
    # report will be generated in _build/lintcheck/output.txt

Doxygen page Output
==============

Install doxygen <https://www.doxygen.nl/download.html> and dot2tex <https://dot2tex.readthedocs.io/en/latest>.

    cd <build-dir>
    cmake -DLLVM_ENABLE_DOXYGEN=On <llvm-top-src-dir>
    make doxygen-llvm # for LLVM docs
    make doxygen-clang # for clang docs

It will generate html in

    <build-dir>/docs/doxygen/html # for LLVM docs
    <build-dir>/tools/clang/docs/doxygen/html # for clang docs