Skip to content

Commit 874e7ac

Browse files
committed
AST->ASR: do not mark bind(c) fns as intrinsic
1 parent 168c205 commit 874e7ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
154154
for (auto &item : mod2->m_symtab->scope) {
155155
if (ASR::is_a<ASR::Subroutine_t>(*item.second)) {
156156
ASR::Subroutine_t *s = ASR::down_cast<ASR::Subroutine_t>(item.second);
157-
s->m_abi = ASR::abiType::Intrinsic;
157+
if (s->m_abi == ASR::abiType::Source) {
158+
s->m_abi = ASR::abiType::Intrinsic;
159+
}
158160
if (s->n_body == 0) {
159161
std::string name = s->m_name;
160162
if (name == "ubound" || name == "lbound") {
@@ -164,7 +166,9 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
164166
}
165167
if (ASR::is_a<ASR::Function_t>(*item.second)) {
166168
ASR::Function_t *s = ASR::down_cast<ASR::Function_t>(item.second);
167-
s->m_abi = ASR::abiType::Intrinsic;
169+
if (s->m_abi == ASR::abiType::Source) {
170+
s->m_abi = ASR::abiType::Intrinsic;
171+
}
168172
if (s->n_body == 0) {
169173
std::string name = s->m_name;
170174
if (name == "ubound" || name == "lbound") {

0 commit comments

Comments
 (0)