Skip to content

Commit 53e7662

Browse files
committed
Add a section on types
1 parent 4e05e28 commit 53e7662

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 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.
57+
LLVMSwift defines 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

0 commit comments

Comments
 (0)