[LLVMdev] gfortran: patch, question
Chris Lattner
sabre at nondot.org
Sat Sep 2 11:25:27 PDT 2006
On Fri, 1 Sep 2006, Michael McCracken wrote:
> I've attached a patch for the changes to the make_decl_rtl callsites,
> at the end.
Sounds good, I'll apply the patch on monday.
-Chris
> Now f951 doesn't crash when compiling, but still can't compile the
> libgfortran files. It now finds some syntax errors in a generated file
> that's part of the intrinsics library.
>
>
> It does compile a very simple test program. It generates
> reasonable-looking LLVM code, except for using "MAIN__" instead of
> "main" for the main procedure. I suspect that may be solved by
> libgfortran once that's working. After editing that, the simple
> example runs in lli up to the linking errors where the libgfortran
> routines are called.
>
> I'm looking into the errors, and I'll update the list on any progress.
>
> Index: gcc/fortran/f95-lang.c
> ===================================================================
> --- gcc/fortran/f95-lang.c (revision 160)
> +++ gcc/fortran/f95-lang.c (working copy)
> @@ -713,7 +713,11 @@
> TREE_PUBLIC (decl) = 1;
> if (library_name)
> SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
> +#ifndef ENABLE_LLVM
> make_decl_rtl (decl);
> +#else
> + make_decl_llvm (decl);
> +#endif
> pushdecl (decl);
> DECL_BUILT_IN_CLASS (decl) = class;
> DECL_FUNCTION_CODE (decl) = function_code;
> Index: gcc/fortran/trans-decl.c
> ===================================================================
> --- gcc/fortran/trans-decl.c (revision 160)
> +++ gcc/fortran/trans-decl.c (working copy)
> @@ -1334,7 +1334,11 @@
> }
>
> /* Create RTL for function definition. */
> +#ifndef ENABLE_LLVM
> make_decl_rtl (fndecl);
> +#else
> + make_decl_llvm (fndecl);
> +#endif
>
> init_function_start (fndecl);
>
> @@ -2472,8 +2476,11 @@
> current_function_decl = fndecl;
>
> rest_of_decl_compilation (fndecl, 1, 0);
> -
> +#ifndef ENABLE_LLVM
> make_decl_rtl (fndecl);
> +#else
> + make_decl_llvm (fndecl);
> +#endif
>
> init_function_start (fndecl);
>
>
> Thanks,
> -mike
>
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list