We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a27725e + 41dde17 commit f4cf11eCopy full SHA for f4cf11e
src/libasr/codegen/asr_to_llvm.cpp
@@ -3472,12 +3472,11 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
3472
printf(context, *module, *builder, printf_args);
3473
}
3474
3475
- void visit_Stop(const ASR::Stop_t & /* x */) {
+ void visit_Stop(const ASR::Stop_t &x) {
3476
llvm::Value *fmt_ptr = builder->CreateGlobalStringPtr("STOP\n");
3477
printf(context, *module, *builder, {fmt_ptr});
3478
- int exit_code_int = 0;
3479
- llvm::Value *exit_code = llvm::ConstantInt::get(context,
3480
- llvm::APInt(32, exit_code_int));
+ this->visit_expr(*x.m_code);
+ llvm::Value *exit_code = tmp;
3481
exit(context, *module, *builder, exit_code);
3482
3483
0 commit comments