@@ -45,6 +45,7 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitor<InlineFunctionCa
45
45
46
46
bool from_inline_function_call, inlining_function;
47
47
bool fixed_duplicated_expr_stmt;
48
+ bool is_fast;
48
49
49
50
// Stores the local variables corresponding to the ones
50
51
// present in function symbol table.
@@ -66,10 +67,12 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitor<InlineFunctionCa
66
67
67
68
bool function_inlined;
68
69
69
- InlineFunctionCallVisitor (Allocator &al_, const std::string& rl_path_, bool inline_external_symbol_calls_)
70
+ InlineFunctionCallVisitor (Allocator &al_, const std::string& rl_path_,
71
+ bool inline_external_symbol_calls_, bool is_fast_)
70
72
: PassVisitor(al_, nullptr ),
71
73
rl_path (rl_path_), function_result_var(nullptr ),
72
74
from_inline_function_call(false ), inlining_function(false ), fixed_duplicated_expr_stmt(false ),
75
+ is_fast(is_fast_),
73
76
current_routine(" " ), inline_external_symbol_calls(inline_external_symbol_calls_),
74
77
node_duplicator(al_), current_routine_scope(nullptr ),
75
78
label_generator(ASRUtils::LabelGenerator::get_instance()),
@@ -211,6 +214,10 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitor<InlineFunctionCa
211
214
return ;
212
215
}
213
216
217
+ if ( !is_fast && !func->m_inline ) {
218
+ return ;
219
+ }
220
+
214
221
current_routine_scope = func->m_symtab ;
215
222
216
223
ASR::expr_t * return_var = nullptr ;
@@ -448,7 +455,7 @@ void pass_inline_function_calls(Allocator &al, ASR::TranslationUnit_t &unit,
448
455
const LCompilers::PassOptions& pass_options) {
449
456
std::string rl_path = pass_options.runtime_library_dir ;
450
457
bool inline_external_symbol_calls = pass_options.inline_external_symbol_calls ;
451
- InlineFunctionCallVisitor v (al, rl_path, inline_external_symbol_calls);
458
+ InlineFunctionCallVisitor v (al, rl_path, inline_external_symbol_calls, pass_options. fast );
452
459
v.configure_node_duplicator (false );
453
460
v.visit_TranslationUnit (unit);
454
461
v.configure_node_duplicator (true );
0 commit comments