Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions deps/ReactantExtra/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,26 @@ extern "C" MlirAttribute mlirComplexAttrDoubleGetChecked(MlirLocation loc,
unwrap(loc), cast<ComplexType>(unwrap(type)), real, imag));
}

extern "C" MlirOperation mlirOperationParse(MlirContext ctx,
MlirStringRef code) {
ParserConfig config(unwrap(ctx));
OwningOpRef<Operation *> owning_op = parseSourceString(unwrap(code), config);
if (!owning_op)
extern "C" bool mlirOperationInject(MlirContext ctx, MlirBlock block,
MlirStringRef code, MlirLocation location,
bool verify_after_parse) {
ParserConfig config(unwrap(ctx), verify_after_parse);
if (failed(parseSourceString(unwrap(code), unwrap(block), config)))
return false;
return true;
}

extern "C" MlirOperation mlirOperationParse(MlirContext ctx, MlirBlock block,
MlirStringRef code,
MlirLocation location,
bool verify_after_parse) {
ParserConfig config(unwrap(ctx), verify_after_parse);
if (failed(parseSourceString(unwrap(code), unwrap(block), config)))
return MlirOperation{nullptr};
return MlirOperation{owning_op.release()};
return MlirOperation{
mlir::detail::constructContainerOpForParserIfNecessary<Operation *>(
unwrap(block), config.getContext(), unwrap(location))
.release()};
}

// TODO mlirComplexAttrGetnValue
Expand Down
Loading