diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-02-11 10:27:55 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-02-11 10:27:55 +0000 |
commit | 4242d45d3d6590630ea88909ed996b8cf2640d35 (patch) | |
tree | d4059dbe453be902ebd68d4704160db6942bb1b3 /gcc/rust/rust-gcc.cc | |
parent | 5801e165b3902f3376387649c632933c05647274 (diff) | |
download | gcc-4242d45d3d6590630ea88909ed996b8cf2640d35.zip gcc-4242d45d3d6590630ea88909ed996b8cf2640d35.tar.gz gcc-4242d45d3d6590630ea88909ed996b8cf2640d35.tar.bz2 |
refactor named_constant_expression out of the backend class
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
-rw-r--r-- | gcc/rust/rust-gcc.cc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index cc5f4a90..812fd55 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -195,9 +195,6 @@ public: tree indirect_expression (tree, tree expr, bool known_valid, Location); - tree named_constant_expression (tree type, const std::string &name, tree val, - Location); - tree integer_constant_expression (tree type, mpz_t val); tree float_constant_expression (tree type, mpfr_t val); @@ -1096,27 +1093,6 @@ Gcc_backend::indirect_expression (tree type_tree, tree expr_tree, return ret; } -// Return an expression that declares a constant named NAME with the -// constant value VAL in BTYPE. - -tree -Gcc_backend::named_constant_expression (tree type_tree, const std::string &name, - tree const_val, Location location) -{ - if (type_tree == error_mark_node || const_val == error_mark_node) - return error_mark_node; - - tree name_tree = get_identifier_from_string (name); - tree decl - = build_decl (location.gcc_location (), CONST_DECL, name_tree, type_tree); - DECL_INITIAL (decl) = const_val; - TREE_CONSTANT (decl) = 1; - TREE_READONLY (decl) = 1; - - rust_preserve_from_gc (decl); - return decl; -} - // Return a typed value as a constant integer. tree |