@@ -3903,27 +3903,27 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
3903
3903
} else if (parent_subroutine){
3904
3904
push_nested_stack (parent_subroutine);
3905
3905
}
3906
+ bool intrinsic_function = ASRUtils::is_intrinsic_function2 (s);
3906
3907
uint32_t h;
3907
- if (s->m_abi == ASR::abiType::Source) {
3908
+ if (s->m_abi == ASR::abiType::Source && !intrinsic_function ) {
3908
3909
h = get_hash ((ASR::asr_t *)s);
3909
3910
} else if (s->m_abi == ASR::abiType::LFortranModule) {
3910
3911
throw CodeGenError (" Function LFortran interfaces not implemented yet" );
3911
3912
} else if (s->m_abi == ASR::abiType::Interactive) {
3912
3913
h = get_hash ((ASR::asr_t *)s);
3913
- } else if (s->m_abi == ASR::abiType::Intrinsic) {
3914
+ } else if (s->m_abi == ASR::abiType::Intrinsic || intrinsic_function ) {
3914
3915
std::string func_name = s->m_name ;
3915
3916
if ( fname2arg_type.find (func_name) != fname2arg_type.end () ) {
3916
3917
h = get_hash ((ASR::asr_t *)s);
3917
3918
} else {
3919
+ if (func_name == " len" ) {
3920
+ std::vector<llvm::Value *> args = convert_call_args (x, " len" );
3921
+ LFORTRAN_ASSERT (args.size () == 1 )
3922
+ tmp = lfortran_str_len (args[0 ]);
3923
+ return ;
3924
+ }
3918
3925
if ( s->m_deftype == ASR::deftypeType::Interface ) {
3919
- if (func_name == " len" ) {
3920
- std::vector<llvm::Value *> args = convert_call_args (x, " len" );
3921
- LFORTRAN_ASSERT (args.size () == 1 )
3922
- tmp = lfortran_str_len (args[0 ]);
3923
- return ;
3924
- } else {
3925
- throw CodeGenError (" Intrinsic '" + func_name + " ' not implemented yet and compile time value is not available." );
3926
- }
3926
+ throw CodeGenError (" Intrinsic '" + func_name + " ' not implemented yet and compile time value is not available." );
3927
3927
} else {
3928
3928
h = get_hash ((ASR::asr_t *)s);
3929
3929
}
0 commit comments