Skip to content

Commit

Permalink
intrinsic function's body & dependency left unchanged
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipul-Cariappa committed May 22, 2024
1 parent 06d2531 commit b90bbdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/libasr/asr_scopes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ void SymbolTable::mark_all_variables_external(Allocator &al) {
case (ASR::symbolType::Function) : {
ASR::Function_t *v = ASR::down_cast<ASR::Function_t>(a.second);
ASR::FunctionType_t* v_func_type = ASR::down_cast<ASR::FunctionType_t>(v->m_function_signature);
if ((v_func_type->m_abi != ASR::abiType::Intrinsic) &&
(v_func_type->m_abi != ASR::abiType::Interactive)) {
v->m_dependencies = nullptr;
v->n_dependencies = 0;
v->m_body = nullptr;
v->n_body = 0;
}
v_func_type->m_abi = ASR::abiType::Interactive;
v->m_body = nullptr;
v->n_body = 0;
break;
}
case (ASR::symbolType::Module) : {
Expand Down
8 changes: 0 additions & 8 deletions src/libasr/asr_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,6 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
}

void visit_Function(const Function_t &x) {
ASR::FunctionType_t* v_func_type = ASR::down_cast<ASR::FunctionType_t>(x.m_function_signature);
if (v_func_type->m_abi == abiType::Interactive) {
require(x.n_body == 0,
"The Function::n_body should be 0 if abi set to Interactive");
require(x.m_body == nullptr,
"The Function::m_body should be null if abi set to Interactive");
return;
}
std::vector<std::string> function_dependencies_copy = function_dependencies;
function_dependencies.clear();
function_dependencies.reserve(x.n_dependencies);
Expand Down

0 comments on commit b90bbdd

Please sign in to comment.