Skip to content

Commit

Permalink
[LLVM] Handle CPtr intent::Out argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel authored and certik committed Nov 29, 2023
1 parent 3c6c19f commit 0c1d3e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/libasr/codegen/asr_to_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7766,9 +7766,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
if (llvm_symtab.find(h) != llvm_symtab.end()) {
tmp = llvm_symtab[h];
if( !ASRUtils::is_array(arg->m_type) ) {

if (x_abi == ASR::abiType::Source && ASR::is_a<ASR::CPtr_t>(*arg->m_type)) {
if (arg->m_intent == intent_local) {
if ( orig_arg_intent != ASRUtils::intent_out &&
arg->m_intent == intent_local ) {
// Local variable of type
// CPtr is a void**, so we
// have to load it
Expand Down Expand Up @@ -7815,9 +7815,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
}
}
} else if (is_a<ASR::CPtr_t>(*arg_type)) {
if (arg->m_intent == intent_local) {
// Local variable of type
// CPtr is a void**, so we
if ( arg->m_intent == intent_local ||
arg->m_intent == ASRUtils::intent_out) {
// Local variable or Dummy out argument
// of type CPtr is a void**, so we
// have to load it
tmp = CreateLoad(tmp);
}
Expand Down

0 comments on commit 0c1d3e6

Please sign in to comment.