Skip to content

Commit

Permalink
[lumen] fix validation of landingpad op
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Jul 31, 2020
1 parent 3757e7a commit 9a7f0a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,13 @@ def LLVM_ResumeOp : LLVM_TerminatorOp<"resume", []> {
let arguments = (ins LLVM_Type:$value);
string llvmBuilder = [{ builder.CreateResume($value); }];
let verifier = [{
if (!isa_and_nonnull<LandingpadOp>(value().getDefiningOp()))
return emitOpError("expects landingpad value as operand");
Value v = value();
// No check for personality of function - landingpad op verifies it.
return success();
if (isa_and_nonnull<LandingpadOp>(v.getDefiningOp()))
return success();
if (v && v.isa<BlockArgument>())
return success();
return emitOpError("expects landingpad value as operand");
}];

let assemblyFormat = "$value attr-dict `:` type($value)";
Expand Down

0 comments on commit 9a7f0a0

Please sign in to comment.