Skip to content

Commit e90833a

Browse files
committed
Make docs/README.md compatible with Swift DocC
This adds necessary metadata and updates links to Markdown documents in `README.md`. Remaining `.rst` documents still need to be converted to Markdown for linking to work.
1 parent 1ef4f80 commit e90833a

File tree

8 files changed

+113
-146
lines changed

8 files changed

+113
-146
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ tags
3333
#==============================================================================#
3434
# Generated docs
3535
docs/_build
36+
docs/.docc-build
3637

3738
# Finder metadata
3839
.DS_Store

docs/ABI/GenericSignature.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Generic Signatures
22

33
A generic signature describes a set of generic type parameters along with
4-
a set of constraints on those parameters. Generic entities in Swift
5-
have a corresponding generic signature. For example, the following generic function:
4+
a set of constraints on those parameters.
5+
6+
Generic entities in Swift have a corresponding generic signature. For example, the following generic function:
67

78
```swift
89
func foo<C1: Collection, C2: Collection>(c1: C1, c2: C2)

docs/ABI/KeyPaths.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
**Key path objects** are laid out at runtime as a heap object with a
44
variable-sized payload containing a sequence of encoded components describing
5-
how the key path traverses a value. When the compiler sees a key path literal,
5+
how the key path traverses a value.
6+
7+
When the compiler sees a key path literal,
68
it generates a **key path pattern** that can be efficiently interpreted by
79
the runtime to instantiate a key path object when needed. This document
810
describes the layout of both. The key path pattern layout is designed in such a

docs/DebuggingTheCompiler.md

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
# Debugging The Compiler
12

2-
<h1>Debugging The Compiler</h1>
3+
This document contains some useful information for debugging.
34

4-
This document contains some useful information for debugging:
5+
With this document you can learn how to debug:
56

67
* The Swift compiler.
78
* Intermediate output of the Swift Compiler.
@@ -10,52 +11,6 @@ This document contains some useful information for debugging:
1011
Please feel free to add any useful tips that one finds to this document for the
1112
benefit of all Swift developers.
1213

13-
**Table of Contents**
14-
15-
- [Debugging the Compiler Itself](#debugging-the-compiler-itself)
16-
- [Basic Utilities](#basic-utilities)
17-
- [Printing the Intermediate Representations](#printing-the-intermediate-representations)
18-
- [Debugging Diagnostic Emission](#debugging-diagnostic-emission)
19-
- [Asserting on first emitted Warning/Assert Diagnostic](#asserting-on-first-emitted-warningassert-diagnostic)
20-
- [Finding Diagnostic Names](#finding-diagnostic-names)
21-
- [Debugging the Type Checker](#debugging-the-type-checker)
22-
- [Enabling Logging](#enabling-logging)
23-
- [Debugging on SIL Level](#debugging-on-sil-level)
24-
- [Options for Dumping the SIL](#options-for-dumping-the-sil)
25-
- [Getting CommandLine for swift stdlib from Ninja to enable dumping stdlib SIL](#getting-commandline-for-swift-stdlib-from-ninja-to-enable-dumping-stdlib-sil)
26-
- [Dumping the SIL and other Data in LLDB](#dumping-the-sil-and-other-data-in-lldb)
27-
- [Debugging and Profiling on SIL level](#debugging-and-profiling-on-sil-level)
28-
- [SIL source level profiling using -sil-based-debuginfo](#sil-source-level-profiling)
29-
- [ViewCFG: Regex based CFG Printer for SIL/LLVM-IR](#viewcfg-regex-based-cfg-printer-for-silllvm-ir)
30-
- [Debugging the Compiler using advanced LLDB Breakpoints](#debugging-the-compiler-using-advanced-lldb-breakpoints)
31-
- [Debugging the Compiler using LLDB Scripts](#debugging-the-compiler-using-lldb-scripts)
32-
- [Custom LLDB Commands](#custom-lldb-commands)
33-
- [Debugging at LLVM Level](#debugging-at-llvm-level)
34-
- [Options for Dumping LLVM IR](#options-for-dumping-llvm-ir)
35-
- [Bisecting Compiler Errors](#bisecting-compiler-errors)
36-
- [Bisecting on SIL optimizer pass counts to identify optimizer bugs](#bisecting-on-sil-optimizer-pass-counts-to-identify-optimizer-bugs)
37-
- [Using git-bisect in the presence of branch forwarding/feature branches](#using-git-bisect-in-the-presence-of-branch-forwardingfeature-branches)
38-
- [Reducing SIL test cases using bug_reducer](#reducing-sil-test-cases-using-bug_reducer)
39-
- [Debugging the Compiler Build](#debugging-the-compiler-build)
40-
- [Build Dry Run](#build-dry-run)
41-
- [Debugging the Compiler Driver](#debugging-the-compiler-driver-build)
42-
- [Swift Compiler Driver F.A.Q](#swift-compiler-driver-f.a.q.)
43-
- [Building the compiler without using the standalone driver](#building-the-compiler-without-the-standalone-driver)
44-
- [Invoking the compiler without forwarding to the standalone driver](#invoking-the-compiler-without-forwarding-to-the-standalone-driver)
45-
- [Reproducing the Compiler Driver build steps](#reproducing-the-compiler-driver-build-steps)
46-
- [Installing the Compiler Driver](#installing-the-compiler-driver)
47-
- [Debugging Swift Executables](#debugging-swift-executables)
48-
- [Determining the mangled name of a function in LLDB](#determining-the-mangled-name-of-a-function-in-lldb)
49-
- [Manually symbolication using LLDB](#manually-symbolication-using-lldb)
50-
- [Viewing allocation history, references, and page-level info](#viewing-allocation-history-references-and-page-level-info)
51-
- [Printing memory contents](#printing-memory-contents)
52-
- [Debugging LLDB failures](#debugging-lldb-failures)
53-
- ["Types" Log](#types-log)
54-
- ["Expression" Log](#expression-log)
55-
- [Multiple Logs at a Time](#multiple-logs-at-a-time)
56-
- [Compiler Tools/Options for Bug Hunting](#compiler-toolsoptions-for-bug-hunting)
57-
- [Using `clang-tidy` to run the Static Analyzer](#using-clang-tidy-to-run-the-static-analyzer)
58-
5914
# Debugging the Compiler Itself
6015

6116
## Basic Utilities

docs/GenericsManifesto.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Swift Generics Manifesto
2+
13
(Source: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160229/011666.html, authored by Douglas Gregor)
24

35
## Introduction

docs/OptimizerDesign.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
2-
### Design of the Swift optimizer
1+
# Design of the Swift optimizer
32

43
This document describes the design of the Swift Optimizer. It is intended for
54
developers who wish to debug, improve or simply understand what the Swift
65
optimizer does. Basic familiarity with the Swift programming language and
76
knowledge of compiler optimizations is required.
87

9-
10-
### Optimization pipeline overview
8+
## Optimization pipeline overview
119

1210
The Swift compiler translates textual Swift programs into LLVM-IR and uses
1311
multiple representations in between. The Swift frontend is responsible for
@@ -47,7 +45,7 @@ higher-level optimizations. For example, the ARC optimizer and devirtualizer
4745
need SSA representation to analyze the program, and dead-code-elimination is a
4846
prerequisite to the array optimizations.
4947

50-
### The Swift Pass Manager
48+
## The Swift Pass Manager
5149

5250
The Swift pass manager is the unit that executes optimization
5351
passes on the functions in the Swift module. Unlike the LLVM optimizer, the
@@ -71,7 +69,7 @@ after specific optimizations and to measure how much time is spent in
7169
each pass.
7270

7371

74-
### Optimization passes
72+
## Optimization passes
7573

7674
There are two kind of optimization passes in Swift: Function passes, and Module
7775
passes. Function passes can inspect the entire module but can only modify a
@@ -102,7 +100,7 @@ This is the structure of a simple function pass:
102100
```
103101

104102

105-
### Analysis Invalidation
103+
## Analysis Invalidation
106104

107105
Swift Analysis are very different from LLVM analysis. Swift analysis are simply
108106
a cache behind some utility that performs computation. For example, the
@@ -159,7 +157,7 @@ The invalidation traits that passes can invalidate are:
159157
3. Branches - branches in the code were added, deleted or modified.
160158
4. Functions - Some functions were added or deleted.
161159

162-
### Semantic Tags
160+
## Semantic Tags
163161

164162
The Swift optimizer has optimization passes that target specific data structures
165163
in the Swift standard library. For example, one optimization can remove the
@@ -192,7 +190,7 @@ pipeline.
192190
Please refer to the document "High-Level SIL Optimizations" for more details.
193191

194192

195-
### Instruction Invalidation in SIL
193+
## Instruction Invalidation in SIL
196194

197195
Swift Passes and Analysis often keep instruction pointers in internal data
198196
structures such as Map or Set. A good example of such data structure is a list
@@ -231,14 +229,14 @@ following virtual method:
231229
}
232230
```
233231

234-
### Debugging the optimizer
232+
## Debugging the optimizer
235233

236234
TODO.
237235

238-
### Whole Module Optimizations
236+
## Whole Module Optimizations
239237

240238
TODO.
241239

242-
### List of passes
240+
## List of passes
243241

244242
The updated list of passes is available in the file "Passes.def".

0 commit comments

Comments
 (0)