Skip to content

Commit 29dfef1

Browse files
committed
Parser Optimization: Local constant folding
Sync with amrex AMReX-Codes/amrex#4428.
1 parent 24b99e0 commit 29dfef1

File tree

2 files changed

+116
-70
lines changed

2 files changed

+116
-70
lines changed

Src/amrexpr_Parser_Y.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <cstdio>
1212
#include <cstdlib>
1313
#include <cstring>
14+
#include <map>
1415
#include <set>
1516
#include <string>
1617
#include <string_view>
@@ -273,7 +274,7 @@ std::set<std::string> parser_get_symbols (struct amrexpr_parser* parser);
273274
int parser_depth (struct amrexpr_parser* parser);
274275

275276
/* We need to walk the tree in these functions */
276-
void parser_ast_optimize (struct parser_node* node);
277+
void parser_ast_optimize (struct parser_node* node, std::map<std::string,double>& local_consts);
277278
std::size_t parser_ast_size (struct parser_node* node);
278279
void parser_ast_print (struct parser_node* node, std::string const& space, std::ostream& printer);
279280
void parser_ast_regvar (struct parser_node* node, char const* name, int i);

0 commit comments

Comments
 (0)