From d214df291c7f627288a9c14ee84a754ba077eea4 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 6 Sep 2023 15:20:08 +0200 Subject: [PATCH] Fix gimple guide --- doc/gimple.md | 8 ++++---- 1 file 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))