Implement constants

This commit is contained in:
2024-12-29 22:28:53 +01:00
parent 20949c7829
commit c558c3d6b4
7 changed files with 85 additions and 29 deletions

View File

@ -16,6 +16,7 @@
#include <fstream>
#include <elna/source/driver.h>
#include "elna/gcc/elna-tree.h"
#include "elna/gcc/elna-generic.h"
#include "elna/gcc/elna-diagnostic.h"
#include "parser.hh"
@ -64,17 +65,18 @@ struct GTY (()) language_function
static bool elna_langhook_init(void)
{
build_common_tree_nodes (false);
build_common_tree_nodes(false);
enumeral_node = make_node(ENUMERAL_TYPE);
/* I don't know why this has to be done explicitly. */
void_list_node = build_tree_list (NULL_TREE, void_type_node);
void_list_node = build_tree_list(NULL_TREE, void_type_node);
build_common_builtin_nodes ();
build_common_builtin_nodes();
return true;
}
static void elna_parse_file (const char *filename)
static void elna_parse_file(const char *filename)
{
std::ifstream file{ filename, std::ios::in };
@ -106,12 +108,11 @@ static void elna_parse_file (const char *filename)
linemap_add(line_table, LC_LEAVE, 0, NULL, 0);
}
static void
elna_langhook_parse_file (void)
static void elna_langhook_parse_file(void)
{
for (int i = 0; i < num_in_fnames; i++)
for (int i = 0; i < num_in_fnames; i++)
{
elna_parse_file (in_fnames[i]);
elna_parse_file (in_fnames[i]);
}
}
@ -161,39 +162,32 @@ elna_langhook_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL;
}
static tree
elna_langhook_type_for_size (unsigned int bits ATTRIBUTE_UNUSED,
int unsignedp ATTRIBUTE_UNUSED)
static tree elna_langhook_type_for_size(unsigned int bits ATTRIBUTE_UNUSED,
int unsignedp ATTRIBUTE_UNUSED)
{
gcc_unreachable ();
return NULL;
gcc_unreachable();
}
/* Record a builtin function. We just ignore builtin functions. */
static tree
elna_langhook_builtin_function (tree decl)
static tree elna_langhook_builtin_function(tree decl)
{
return decl;
return decl;
}
static bool
elna_langhook_global_bindings_p (void)
static bool elna_langhook_global_bindings_p(void)
{
gcc_unreachable ();
return true;
gcc_unreachable();
}
static tree
elna_langhook_pushdecl (tree decl ATTRIBUTE_UNUSED)
static tree elna_langhook_pushdecl(tree decl ATTRIBUTE_UNUSED)
{
gcc_unreachable ();
gcc_unreachable();
}
static tree
elna_langhook_getdecls (void)
static tree elna_langhook_getdecls(void)
{
return NULL;
return NULL;
}
#undef LANG_HOOKS_NAME