Skip to content

Commit e39f3a2

Browse files
authored
Merge pull request #327 from GuillaumeGomez/fix-gimple-guide
Fix gimple guide
2 parents b6ccb55 + 7324ee2 commit e39f3a2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/gimple.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,25 @@ also add the calls we need to generate the GIMPLE:
3434
int main() {
3535
gcc_jit_context *ctxt = gcc_jit_context_acquire();
3636
create_code(ctxt, NULL);
37-
gcc_jit_context_compile_to_file(ctxt, GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, "tmp");
37+
gcc_jit_context_compile(ctxt);
38+
gcc_jit_context_dump_to_file(ctxt, "tmp.gimple", 1);
3839
return 0;
3940
}
4041
```
4142

4243
Then we can compile it by using:
4344

4445
```console
45-
gcc const.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out
46+
gcc local.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out
4647
```
4748

4849
And finally when you run it:
4950

5051
```console
51-
LD_LIBRARY_PATH=`pwd`/gcc-build/gcc ./out
52+
LD_LIBRARY_PATH=`pwd`/gcc-build/gcc LIBRARY_PATH=`pwd`/gcc-build/gcc ./out
5253
```
5354

54-
It should display:
55+
You should now have a file named `tmp.gimple` which contains:
5556

5657
```c
5758
__attribute__((const))

0 commit comments

Comments
 (0)