https://github.com/ibara/o
Peephole optimizer for cproc and QBE
https://github.com/ibara/o
c compiler freebsd linux netbsd openbsd optimizer unix
Last synced: 26 days ago
JSON representation
Peephole optimizer for cproc and QBE
- Host: GitHub
- URL: https://github.com/ibara/o
- Owner: ibara
- License: isc
- Created: 2022-03-30T00:21:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-02T23:54:27.000Z (29 days ago)
- Last Synced: 2025-05-03T00:28:58.721Z (29 days ago)
- Topics: c, compiler, freebsd, linux, netbsd, openbsd, optimizer, unix
- Language: C
- Homepage: https://briancallahan.net/blog/20220330.html
- Size: 12.7 KB
- Stars: 25
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
O
=
`O` is a peephole optimizer for
[qbe](https://c9x.me/compile/).It is meant to be used in conjunction with
[cproc](https://sr.ht/~mcf/cproc/).Why?
----
`O` is the subject of two
[blog](https://briancallahan.net/blog/20220330.html)
[posts](https://briancallahan.net/blog/20220402.html).Building
--------
Just run `make`.The only non-C89 functions are
[`getline(3)`](https://man.openbsd.org/getline.3)
and
[`snprintf(3)`](https://man.openbsd.org/snprintf.3).Running
-------
```
usage: O in.s [-o out.s]
```Output is listed on `stdout` unless `-o` is passed on the command line.
You can pass this to an assembler using something like:
```
$ O file.s | as -o file.o -
````O` can read from `stdin` if invoked as `O -`.
License
-------
ISC License. See `LICENSE` for more information.