Skip to content

Commit 910f9e3

Browse files
committed
Add a section on types
1 parent 4e05e28 commit 910f9e3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,29 @@ entry:
4848
}
4949
```
5050

51+
### Types
52+
53+
LLVM IR is a strong, statically typed language. As such, values and functions
54+
are tagged with their types, and conversions between them must be explicit (see
55+
[Conversion Operators](http://llvm.org/docs/LangRef.html#conversion-operations)).
56+
LLVMSwift represents this with values conforming to the `IRType` protocol and defines
57+
the following types:
58+
59+
|**Type** | **Represents** |
60+
|:---:|:---:|
61+
| VoidType | Nothing; Has no size |
62+
| IntType | Integer and Boolean values (`i1`) |
63+
| FloatType | Floating-point values |
64+
| FunctionType | Function values |
65+
| LabelType | Code labels |
66+
| TokenType | Values paired with instructions |
67+
| MetadataType | Embedded metadata |
68+
| X86MMXType | X86 MMX values |
69+
| PointerType | Pointer values |
70+
| VectorType | SIMD data |
71+
| ArrayType | Homogeneous values |
72+
| Structure Type | Heterogeneous values |
73+
5174

5275
### Control Flow
5376

@@ -158,8 +181,6 @@ print(fn(true)) // 0.00917431192660551...
158181
print(fn(false)) // 0.0112359550561798...
159182
```
160183

161-
### Platform Management
162-
163184
## Installation
164185

165186
There are a couple, annoying steps you need to get it working before it'll

0 commit comments

Comments
 (0)