comparison gcc/cp/cp-lang.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Language-dependent hooks for C++. 1 /* Language-dependent hooks for C++.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc. 2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Contributed by Alexandre Oliva <aoliva@redhat.com> 3 Contributed by Alexandre Oliva <aoliva@redhat.com>
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
26 #include "langhooks.h" 26 #include "langhooks.h"
27 #include "langhooks-def.h" 27 #include "langhooks-def.h"
28 #include "cp-objcp-common.h" 28 #include "cp-objcp-common.h"
29 29
30 enum c_language_kind c_language = clk_cxx; 30 enum c_language_kind c_language = clk_cxx;
31 static void cp_init_ts (void);
32 static const char * cxx_dwarf_name (tree t, int verbosity); 31 static const char * cxx_dwarf_name (tree t, int verbosity);
33 static enum classify_record cp_classify_record (tree type); 32 static enum classify_record cp_classify_record (tree type);
34 static tree cp_eh_personality (void); 33 static tree cp_eh_personality (void);
35 static tree get_template_innermost_arguments_folded (const_tree); 34 static tree get_template_innermost_arguments_folded (const_tree);
36 static tree get_template_argument_pack_elems_folded (const_tree); 35 static tree get_template_argument_pack_elems_folded (const_tree);
69 #undef LANG_HOOKS_GET_GENERIC_FUNCTION_DECL 68 #undef LANG_HOOKS_GET_GENERIC_FUNCTION_DECL
70 #define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL get_function_template_decl 69 #define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL get_function_template_decl
71 #undef LANG_HOOKS_DWARF_NAME 70 #undef LANG_HOOKS_DWARF_NAME
72 #define LANG_HOOKS_DWARF_NAME cxx_dwarf_name 71 #define LANG_HOOKS_DWARF_NAME cxx_dwarf_name
73 #undef LANG_HOOKS_INIT_TS 72 #undef LANG_HOOKS_INIT_TS
74 #define LANG_HOOKS_INIT_TS cp_init_ts 73 #define LANG_HOOKS_INIT_TS cp_common_init_ts
75 #undef LANG_HOOKS_EH_PERSONALITY 74 #undef LANG_HOOKS_EH_PERSONALITY
76 #define LANG_HOOKS_EH_PERSONALITY cp_eh_personality 75 #define LANG_HOOKS_EH_PERSONALITY cp_eh_personality
77 #undef LANG_HOOKS_EH_RUNTIME_TYPE 76 #undef LANG_HOOKS_EH_RUNTIME_TYPE
78 #define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type 77 #define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type
79 #undef LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE 78 #undef LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE
82 #if CHECKING_P 81 #if CHECKING_P
83 #undef LANG_HOOKS_RUN_LANG_SELFTESTS 82 #undef LANG_HOOKS_RUN_LANG_SELFTESTS
84 #define LANG_HOOKS_RUN_LANG_SELFTESTS selftest::run_cp_tests 83 #define LANG_HOOKS_RUN_LANG_SELFTESTS selftest::run_cp_tests
85 #endif /* #if CHECKING_P */ 84 #endif /* #if CHECKING_P */
86 85
86 #undef LANG_HOOKS_GET_SUBSTRING_LOCATION
87 #define LANG_HOOKS_GET_SUBSTRING_LOCATION c_get_substring_location
88
87 /* Each front end provides its own lang hook initializer. */ 89 /* Each front end provides its own lang hook initializer. */
88 struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; 90 struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
89 91
90 /* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c; 92 /* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c;
91 there should be very few routines below. */ 93 there should be very few routines below. */
98 tsubst_flags_t /*complain*/, 100 tsubst_flags_t /*complain*/,
99 tree /*in_decl*/, 101 tree /*in_decl*/,
100 bool /*function_p*/) 102 bool /*function_p*/)
101 { 103 {
102 return NULL_TREE; 104 return NULL_TREE;
103 }
104
105 static void
106 cp_init_ts (void)
107 {
108 cp_common_init_ts ();
109
110 init_shadowed_var_for_decl ();
111 } 105 }
112 106
113 static const char * 107 static const char *
114 cxx_dwarf_name (tree t, int verbosity) 108 cxx_dwarf_name (tree t, int verbosity)
115 { 109 {
245 { 239 {
246 /* Run selftests shared within the C family. */ 240 /* Run selftests shared within the C family. */
247 c_family_tests (); 241 c_family_tests ();
248 242
249 /* Additional C++-specific tests. */ 243 /* Additional C++-specific tests. */
244 cp_pt_c_tests ();
245 cp_tree_c_tests ();
250 } 246 }
251 247
252 } // namespace selftest 248 } // namespace selftest
253 249
254 #endif /* #if CHECKING_P */ 250 #endif /* #if CHECKING_P */