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.
1 parent e93b461 commit 7fa884aCopy full SHA for 7fa884a
llvm/lib/Transforms/Yk/ControlPoint.cpp
@@ -363,7 +363,12 @@ class YkControlPoint : public ModulePass {
363
Builder.SetInsertPoint(ExitBB);
364
// YKFIXME: We need to return the value of interpreted return and the return
365
// type must be that of the control point's caller.
366
- Builder.CreateRet(ConstantInt::get(Type::getInt32Ty(Context), 0));
+ Type *RetTy = Caller->getReturnType();
367
+ if (RetTy->isVoidTy()) {
368
+ Builder.CreateRetVoid();
369
+ } else {
370
+ Builder.CreateRet(ConstantInt::get(Type::getInt32Ty(Context), 0));
371
+ }
372
373
// To do so we need to first split up the current block and then
374
// insert a conditional branch that either continues or returns.
0 commit comments