Commit Graph
23 Commits
Author SHA1 Message Date
Nigel Tao 38bfebf204 Don't have "puffs gen" run type checking twice.
"puffs-c gen" already runs type checking, as type information is needed
for code generation. Accordingly, there's no need for "puffs gen" to
also run type checking beforehand.
2017-08-26 11:14:05 +10:00
Nigel Tao fdddcc8e1d Merge multiple puffs-xxx-c binaries into one. 2017-08-24 09:43:57 +10:00
Nigel Tao 8488ab0d86 Add a "puffs genlib" command. 2017-08-10 16:48:14 +10:00
Nigel Tao e0f87fb2a7 Add a -reps=N flag to "puffs bench". 2017-07-30 08:27:52 +10:00
Nigel Tao a29dcb92db Fix some error messages for "puffs bench". 2017-07-07 15:12:27 +10:00
Nigel Tao a65e2bacf0 Add mimic tests. 2017-07-02 11:19:23 +10:00
Nigel Tao a58bfc67f1 Add "bench" to puffs' usage message. 2017-07-01 11:26:55 +10:00
Nigel Tao 0cba6885fa Spell the "-b" flag fully, as "-bench". 2017-06-30 08:50:12 +10:00
Nigel Tao 480c509214 Add benchmarks. 2017-06-29 14:13:23 +10:00
Nigel Tao dc71a93dcf Re-introduce type/bounds checking to "puffs gen".
This rolls back some of:
f23a808 Remove some redundant cmd/puffs/gen.go code.
3258c1e Remove check.FlagsOnlyTypeCheck.

The language-specific code generators, such as puffs-gen-c, have to do
type and bounds checking anyway, to generate the right types and
function calls. Accordingly, I thought that the type and bounds checking
in the language-agnostic cmd/puffs/gen.go was redundant, and removed it.

However, puffs-gen-c just works with stdin and stdout, and the comments
have been stripped from its input, so it cannot print either the right
filename or right line number for any errors.

We therefore need to do type and bounds checking in cmd/puffs/gen.go
too, in order to produce actionable errors.
2017-06-18 10:17:09 +10:00
Nigel Tao f23a80820c Remove some redundant cmd/puffs/gen.go code. 2017-06-18 09:26:30 +10:00
Nigel Tao 6904068251 Remove check.FlagsOnlyTypeCheck.
The puffs-gen-foo commands might need to bounds check anyway, to e.g.
generate different code paths depending on whether a u64 typed
expression fits in a usize's range.
2017-06-18 09:17:58 +10:00
Nigel Tao 1c2ccee966 Put "std" in the "gen/c/std/gif.c" filename. 2017-06-16 11:32:39 +10:00
Nigel Tao 70612df43a Re-organize test/c code. 2017-06-16 10:47:54 +10:00
Nigel Tao 6e7e566232 Rename token.IDMap to token.Map. 2017-06-08 13:10:01 +10:00
Nigel Tao 1b4590d878 Remove puffs-gen-h as a separate executable.
The .h file is already a prefix of the .c file. We already call
puffs-gen-c and can truncate its output.
2017-06-01 10:33:42 +10:00
Nigel Tao 0819a42ab8 Update puffs usage message. 2017-05-27 10:24:32 +10:00
Nigel Tao a1dd73a58c Generate C status codes. 2017-05-26 15:53:41 +10:00
Nigel Tao d7403b8e57 Generate C structs. 2017-05-26 14:45:20 +10:00
Nigel Tao 5d5381ea17 Generate .h files too, not just .c files. 2017-05-26 10:56:59 +10:00
Nigel Tao 6e7decbf3b Add "puffs test" to the puffs tool. 2017-05-25 19:02:15 +10:00
Nigel Tao fb6f9bbe4b Don't overwrite an unchanged generated file. 2017-05-25 17:17:26 +10:00
Nigel Tao 3663708405 First cut of the puffs tool: "puffs gen". 2017-05-25 15:33:58 +10:00