@@ -42,7 +42,7 @@ Map between `llir/llvm` tagged releases and LLVM release versions.
42
42
43
43
## Usage
44
44
45
- ### Input example - Parse LLVM IR assembly
45
+ ### Input example, parsing LLVM IR assembly
46
46
47
47
[ Example usage in GoDoc] ( https://pkg.go.dev/github.com/llir/llvm/asm#example-package ) .
48
48
@@ -73,8 +73,10 @@ func main() {
73
73
74
74
#### Hello, World
75
75
76
+ [ Example usage in GoDoc] ( https://pkg.go.dev/github.com/llir/llvm/ir#example-package-Hello ) .
77
+
76
78
``` go
77
- // This example produces LLVM IR generating "Hello, World" output:
79
+ // This example produces LLVM IR generating "Hello, World" output.
78
80
79
81
package main
80
82
@@ -95,15 +97,13 @@ func main() {
95
97
puts := m.NewFunc (" puts" , types.I32 , ir.NewParam (" " , types.NewPointer (types.I8 )))
96
98
main := m.NewFunc (" main" , types.I32 )
97
99
entry := main.NewBlock (" " )
98
- // Cast *[15]i8 to *i8; c.f.: [1]
100
+ // Cast *[15]i8 to *i8.
99
101
zero := constant.NewInt (types.I64 , 0 )
100
102
gep := constant.NewGetElementPtr (hello.Typ , str, zero, zero)
101
103
entry.NewCall (puts, gep)
102
104
entry.NewRet (constant.NewInt (types.I32 , 0 ))
103
105
fmt.Println (m)
104
106
}
105
- // [1] See also:
106
- // https://github.com/anoopsarkar/compilers-class-hw/blob/master/llvm-practice/helloworld.ll
107
107
```
108
108
109
109
#### Pseudo Random-Number Generator
@@ -176,9 +176,9 @@ func main() {
176
176
}
177
177
```
178
178
179
- ### Analysis example - Process LLVM IR
179
+ ### Analysis example, processing LLVM IR
180
180
181
- [ Example usage in GoDoc] ( https://pkg.go.dev/github.com/llir/llvm/ir#example-package-- Callgraph ) .
181
+ [ Example usage in GoDoc] ( https://pkg.go.dev/github.com/llir/llvm/ir#example-package-Callgraph ) .
182
182
183
183
``` go
184
184
// This example program analyses an LLVM IR module to produce a callgraph in
0 commit comments