diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-09-06 15:20:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-06 15:20:08 +0200 |
| commit | d214df291c7f627288a9c14ee84a754ba077eea4 (patch) | |
| tree | c1c560cf6a2954dea259bf9a4070e769d728881b | |
| parent | b6ccb55f561adc795b9e3b154244b8097a65ff30 (diff) | |
| download | rust-d214df291c7f627288a9c14ee84a754ba077eea4.tar.gz rust-d214df291c7f627288a9c14ee84a754ba077eea4.zip | |
Fix gimple guide
| -rw-r--r-- | doc/gimple.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/gimple.md b/doc/gimple.md index 589cf3db7a6..1bd8035e75d 100644 --- a/doc/gimple.md +++ b/doc/gimple.md @@ -34,7 +34,7 @@ also add the calls we need to generate the GIMPLE: int main() { gcc_jit_context *ctxt = gcc_jit_context_acquire(); create_code(ctxt, NULL); - gcc_jit_context_compile_to_file(ctxt, GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, "tmp"); + gcc_jit_context_dump_to_file(ctxt, "tmp.gimple", 1); return 0; } ``` @@ -42,16 +42,16 @@ int main() { Then we can compile it by using: ```console -gcc const.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out +gcc local.c -I `pwd`/gcc/gcc/jit/ -L `pwd`/gcc-build/gcc -lgccjit -o out ``` And finally when you run it: ```console -LD_LIBRARY_PATH=`pwd`/gcc-build/gcc ./out +LD_LIBRARY_PATH=`pwd`/gcc-build/gcc LIBRARY_PATH=`pwd`/gcc-build/gcc ./out ``` -It should display: +You should now have a file named `tmp.gimple` which contains: ```c __attribute__((const)) |
