Commit 009890be by Olivier Hainque Committed by Olivier Hainque

Access to most C builtins from Ada

2008-04-21  Olivier Hainque  <hainque@adacore.com>

ada/
        Access to most C builtins from Ada
        * utils.c: #include "langhooks.h" and define GCC_DIAG_STYLE.
        (handle_pure_attribute, handle_novops_attribute,
        handle_nonnull_attribute, handle_sentinel_attribute,
        handle_noreturn_attribute, handle_malloc_attribute,
        handle_type_generic_attribute): New attribute handlers, from C fe.
        (gnat_internal_attribute_table): Map the new handlers.
        (gnat_init_decl_processing): Move call to gnat_install_builtins to ...
        (init_gigi_decls): ... here.
        (handle_const_attribute, handle_nothrow_attribute, builtin_decl_for):
        Move to a section dedicated to builtins processing.
        (build_void_list_node, builtin_type_for_size): New functions.
        (def_fn_type, get_nonnull_operand): Likewise.
        (install_builtin_elementary_type, install_builtin_function_types,
        install_builtin_attributes): Likewise.
        (fake_attribute_handler): Fake handler for attributes we don't
        support in Ada.
        (def_builtin_1): New function, worker for DEF_BUILTIN.
        (install_builtin_functions): New function.
        (gnat_install_builtins): Move to the builtins processing section.
        Now calling the newly introduced installers.

testsuite/
        * gnat.dg/bltins.adb: New testcase.

From-SVN: r134504
parent d82b799c
2008-04-21 Olivier Hainque <hainque@adacore.com>
Access to most C builtins from Ada
* utils.c: #include "langhooks.h" and define GCC_DIAG_STYLE.
(handle_pure_attribute, handle_novops_attribute,
handle_nonnull_attribute, handle_sentinel_attribute,
handle_noreturn_attribute, handle_malloc_attribute,
handle_type_generic_attribute): New attribute handlers, from C fe.
(gnat_internal_attribute_table): Map the new handlers.
(gnat_init_decl_processing): Move call to gnat_install_builtins to ...
(init_gigi_decls): ... here.
(handle_const_attribute, handle_nothrow_attribute, builtin_decl_for):
Move to a section dedicated to builtins processing.
(build_void_list_node, builtin_type_for_size): New functions.
(def_fn_type, get_nonnull_operand): Likewise.
(install_builtin_elementary_type, install_builtin_function_types,
install_builtin_attributes): Likewise.
(fake_attribute_handler): Fake handler for attributes we don't
support in Ada.
(def_builtin_1): New function, worker for DEF_BUILTIN.
(install_builtin_functions): New function.
(gnat_install_builtins): Move to the builtins processing section.
Now calling the newly introduced installers.
2008-04-20 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (gnat_to_gnu_entity) <object>: Also promote the alignment of
......@@ -1125,10 +1125,10 @@ ada/trans.o : ada/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(ADA_TREE_H) ada/gigi.h gt-ada-trans.h
ada/utils.o : ada/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FLAGS_H) $(EXPR_H) convert.h defaults.h ada/ada.h ada/types.h \
ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \
ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-utils.h \
gtype-ada.h $(TARGET_H)
$(TREE_H) $(FLAGS_H) $(EXPR_H) convert.h defaults.h langhooks.h \
ada/ada.h ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h \
ada/einfo.h ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) \
ada/gigi.h gt-ada-utils.h gtype-ada.h $(TARGET_H)
ada/utils2.o : ada/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FLAGS_H) ada/ada.h ada/types.h ada/atree.h ada/nlists.h \
......
2008-04-21 Olivier Hainque <hainque@adacore.com>
* gnat.dg/bltins.adb: New testcase.
2008-04-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35991
-- { dg-do run }
procedure Bltins is
function Sqrt (F : Float) return Float;
pragma Import (Intrinsic, Sqrt, "__builtin_sqrtf");
F : Float := 4.0;
R : Float;
begin
R := Sqrt (F);
end;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment