diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-08-25 14:35:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 14:35:59 +0000 |
commit | 1416b85322cd9cd74c7a79e3270bb334ceb3a44c (patch) | |
tree | e6d175fcec2b7f252b82a163460768deb7db2f03 /gcc/rust/backend/rust-compile-intrinsic.cc | |
parent | 5b3c4be73fb72cb87d9a135415ed421a0808ff3b (diff) | |
parent | 43b7dd91fb0df9cdb7708581089bd3cd36f14a43 (diff) | |
download | gcc-1416b85322cd9cd74c7a79e3270bb334ceb3a44c.zip gcc-1416b85322cd9cd74c7a79e3270bb334ceb3a44c.tar.gz gcc-1416b85322cd9cd74c7a79e3270bb334ceb3a44c.tar.bz2 |
Merge #1499
1499: Constant folding in gccrs: port over rest of the code from CP frontend r=philberty a=abbasfaisal
Co-authored-by: Faisal Abbas <90.abbasfaisal@gmail.com>
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-intrinsic.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-intrinsic.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index 61084b9..6169196 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -15,17 +15,18 @@ // <http://www.gnu.org/licenses/>. #include "rust-compile-intrinsic.h" -#include "fold-const.h" -#include "langhooks.h" #include "rust-compile-context.h" #include "rust-compile-type.h" #include "rust-compile-fnparam.h" #include "rust-builtins.h" #include "rust-diagnostics.h" #include "rust-location.h" +#include "rust-constexpr.h" #include "rust-tree.h" #include "tree-core.h" #include "print-tree.h" +#include "fold-const.h" +#include "langhooks.h" namespace Rust { namespace Compile { @@ -213,6 +214,9 @@ finalize_intrinsic_block (Context *ctx, tree fndecl) DECL_SAVED_TREE (fndecl) = bind_tree; ctx->push_function (fndecl); + + DECL_DECLARED_CONSTEXPR_P (fndecl) = 1; + maybe_save_constexpr_fundef (fndecl); } static tree |