Skip to content

Commit 12bfd33

Browse files
committed
LLVM: Implement CPtr casts
1 parent 4e8bc5a commit 12bfd33

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6818,6 +6818,14 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
68186818
// tmp = tmp
68196819
break;
68206820
}
6821+
case (ASR::cast_kindType::CPtrToUnsignedInteger) : {
6822+
tmp = builder->CreatePtrToInt(tmp, getIntType(8, false));
6823+
break;
6824+
}
6825+
case (ASR::cast_kindType::UnsignedIntegerToCPtr) : {
6826+
tmp = builder->CreateIntToPtr(tmp, llvm::Type::getVoidTy(context)->getPointerTo());
6827+
break;
6828+
}
68216829
case (ASR::cast_kindType::ComplexToComplex) : {
68226830
llvm::Type *target_type;
68236831
int arg_kind = -1, dest_kind = -1;

0 commit comments

Comments
 (0)