Skip to content

Commit d214df2

Browse files
Fix gimple guide
1 parent b6ccb55 commit d214df2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/gimple.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ 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_dump_to_file(ctxt, "tmp.gimple", 1);
3838
return 0;
3939
}
4040
```
4141

4242
Then we can compile it by using:
4343

4444
```console
45-
gcc const.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out
45+
gcc local.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out
4646
```
4747

4848
And finally when you run it:
4949

5050
```console
51-
LD_LIBRARY_PATH=`pwd`/gcc-build/gcc ./out
51+
LD_LIBRARY_PATH=`pwd`/gcc-build/gcc LIBRARY_PATH=`pwd`/gcc-build/gcc ./out
5252
```
5353

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

5656
```c
5757
__attribute__((const))

0 commit comments

Comments
 (0)