Lines Matching defs:unwrap
62 new MLIRContext(*unwrap(registry), toThreadingEnum(threadingEnabled));
67 return unwrap(ctx1) == unwrap(ctx2);
70 void mlirContextDestroy(MlirContext context) { delete unwrap(context); }
73 unwrap(context)->allowUnregisteredDialects(allow);
77 return unwrap(context)->allowsUnregisteredDialects();
80 return static_cast<intptr_t>(unwrap(context)->getAvailableDialects().size());
85 unwrap(ctx)->appendDialectRegistry(*unwrap(registry));
91 return static_cast<intptr_t>(unwrap(context)->getLoadedDialects().size());
96 return wrap(unwrap(context)->getOrLoadDialect(unwrap(name)));
100 return unwrap(context)->isOperationRegistered(unwrap(name));
104 return unwrap(context)->enableMultithreading(enable);
108 unwrap(context)->loadAllAvailableDialects();
113 unwrap(context)->setThreadPool(*unwrap(threadPool));
121 return wrap(unwrap(dialect)->getContext());
125 return unwrap(dialect1) == unwrap(dialect2);
129 return wrap(unwrap(dialect)->getNamespace());
141 delete unwrap(registry);
150 return wrap(new AsmState(unwrap(op), *unwrap(flags)));
172 mlir::Value val = unwrap(value);
182 op = findParent(op, unwrap(flags)->shouldUseLocalScope());
183 return wrap(new AsmState(op, *unwrap(flags)));
187 void mlirAsmStateDestroy(MlirAsmState state) { delete unwrap(state); }
198 delete unwrap(flags);
203 unwrap(flags)->elideLargeElementsAttrs(largeElementLimit);
208 unwrap(flags)->elideLargeResourceString(largeResourceLimit);
213 unwrap(flags)->enableDebugInfo(enable, /*prettyForm=*/prettyForm);
217 unwrap(flags)->printGenericOpForm();
221 unwrap(flags)->useLocalScope();
225 unwrap(flags)->assumeVerified();
229 unwrap(flags)->skipRegions();
240 delete unwrap(config);
245 unwrap(flags)->setDesiredBytecodeVersion(version);
253 return wrap(LocationAttr(unwrap(location)));
257 return wrap(Location(llvm::cast<LocationAttr>(unwrap(attribute))));
264 FileLineColLoc::get(unwrap(context), unwrap(filename), line, col)));
272 Location(FileLineColRange::get(unwrap(context), unwrap(filename),
277 return wrap(Location(CallSiteLoc::get(unwrap(callee), unwrap(caller))));
285 return wrap(FusedLoc::get(unwrappedLocs, unwrap(metadata), unwrap(ctx)));
292 Location(NameLoc::get(StringAttr::get(unwrap(context), unwrap(name)))));
294 StringAttr::get(unwrap(context), unwrap(name)), unwrap(childLoc))));
298 return wrap(Location(UnknownLoc::get(unwrap(context))));
302 return unwrap(l1) == unwrap(l2);
306 return wrap(unwrap(location).getContext());
312 unwrap(location).print(stream);
320 return wrap(ModuleOp::create(unwrap(location)));
325 parseSourceString<ModuleOp>(unwrap(module), unwrap(context));
332 return wrap(unwrap(module).getContext());
336 return wrap(unwrap(module).getBody());
342 OwningOpRef<ModuleOp>(unwrap(module));
346 return wrap(unwrap(module).getOperation());
350 return wrap(dyn_cast<ModuleOp>(unwrap(op)));
468 OperationState cppState(unwrap(state->location), unwrap(state->name));
480 cppState.addAttribute(unwrap(state->attributes[i].name),
481 unwrap(state->attributes[i].attribute));
484 cppState.addRegion(std::unique_ptr<Region>(unwrap(state->regions[i])));
508 parseSourceString(unwrap(sourceStr), unwrap(context), unwrap(sourceName))
513 return wrap(unwrap(op)->clone());
516 void mlirOperationDestroy(MlirOperation op) { unwrap(op)->erase(); }
518 void mlirOperationRemoveFromParent(MlirOperation op) { unwrap(op)->remove(); }
521 return unwrap(op) == unwrap(other);
525 return wrap(unwrap(op)->getContext());
529 return wrap(unwrap(op)->getLoc());
533 if (auto info = unwrap(op)->getRegisteredInfo())
539 return wrap(unwrap(op)->getName().getIdentifier());
543 return wrap(unwrap(op)->getBlock());
547 return wrap(unwrap(op)->getParentOp());
551 return static_cast<intptr_t>(unwrap(op)->getNumRegions());
555 return wrap(&unwrap(op)->getRegion(static_cast<unsigned>(pos)));
559 Operation *cppOp = unwrap(op);
566 Region *cppRegion = unwrap(region);
575 return wrap(unwrap(op)->getNextNode());
579 return static_cast<intptr_t>(unwrap(op)->getNumOperands());
583 return wrap(unwrap(op)->getOperand(static_cast<unsigned>(pos)));
588 unwrap(op)->setOperand(static_cast<unsigned>(pos), unwrap(newValue));
594 unwrap(op)->setOperands(unwrapList(nOperands, operands, ops));
598 return static_cast<intptr_t>(unwrap(op)->getNumResults());
602 return wrap(unwrap(op)->getResult(static_cast<unsigned>(pos)));
606 return static_cast<intptr_t>(unwrap(op)->getNumSuccessors());
610 return wrap(unwrap(op)->getSuccessor(static_cast<unsigned>(pos)));
615 std::optional<Attribute> attr = unwrap(op)->getInherentAttr(unwrap(name));
621 std::optional<Attribute> attr = unwrap(op)->getInherentAttr(unwrap(name));
630 unwrap(op)->setInherentAttr(
631 StringAttr::get(unwrap(op)->getContext(), unwrap(name)), unwrap(attr));
636 llvm::range_size(unwrap(op)->getDiscardableAttrs()));
642 *std::next(unwrap(op)->getDiscardableAttrs().begin(), pos);
648 return wrap(unwrap(op)->getDiscardableAttr(unwrap(name)));
654 unwrap(op)->setDiscardableAttr(unwrap(name), unwrap(attr));
659 return !!unwrap(op)->removeDiscardableAttr(unwrap(name));
664 unwrap(op)->setSuccessor(unwrap(block), static_cast<unsigned>(pos));
668 return static_cast<intptr_t>(unwrap(op)->getAttrs().size());
672 NamedAttribute attr = unwrap(op)->getAttrs()[pos];
678 return wrap(unwrap(op)->getAttr(unwrap(name)));
683 unwrap(op)->setAttr(unwrap(name), unwrap(attr));
687 return !!unwrap(op)->removeAttr(unwrap(name));
693 unwrap(op)->print(stream);
699 unwrap(op)->print(stream, *unwrap(flags));
706 unwrap(op)->print(stream, *unwrap(state));
707 unwrap(op)->print(stream);
714 (void)writeBytecodeToFile(unwrap(op), stream);
721 return wrap(writeBytecodeToFile(unwrap(op), stream, *unwrap(config)));
724 void mlirOperationDump(MlirOperation op) { return unwrap(op)->dump(); }
727 return succeeded(verify(unwrap(op)));
731 return unwrap(op)->moveAfter(unwrap(other));
735 return unwrap(op)->moveBefore(unwrap(other));
738 static mlir::WalkResult unwrap(MlirWalkResult result) {
749 llvm_unreachable("unknown result in WalkResult::unwrap");
757 unwrap(op)->walk<mlir::WalkOrder::PreOrder>(
759 return unwrap(callback(wrap(op), userData));
763 unwrap(op)->walk<mlir::WalkOrder::PostOrder>(
765 return unwrap(callback(wrap(op), userData));
777 return unwrap(region) == unwrap(other);
781 Region *cppRegion = unwrap(region);
788 unwrap(region)->push_back(unwrap(block));
793 auto &blockList = unwrap(region)->getBlocks();
794 blockList.insert(std::next(blockList.begin(), pos), unwrap(block));
799 Region *cppRegion = unwrap(region);
801 cppRegion->getBlocks().insert(cppRegion->begin(), unwrap(block));
805 assert(unwrap(reference)->getParent() == unwrap(region) &&
807 cppRegion->getBlocks().insertAfter(Region::iterator(unwrap(reference)),
808 unwrap(block));
816 assert(unwrap(reference)->getParent() == unwrap(region) &&
818 unwrap(region)->getBlocks().insert(Region::iterator(unwrap(reference)),
819 unwrap(block));
827 unwrap(target)->takeBody(*unwrap(source));
838 b->addArgument(unwrap(args[i]), unwrap(locs[i]));
843 return unwrap(block) == unwrap(other);
847 return wrap(unwrap(block)->getParentOp());
851 return wrap(unwrap(block)->getParent());
855 return wrap(unwrap(block)->getNextNode());
859 Block *cppBlock = unwrap(block);
866 Block *cppBlock = unwrap(block);
876 unwrap(block)->push_back(unwrap(operation));
881 auto &opList = unwrap(block)->getOperations();
882 opList.insert(std::next(opList.begin(), pos), unwrap(operation));
888 Block *cppBlock = unwrap(block);
890 cppBlock->getOperations().insert(cppBlock->begin(), unwrap(operation));
894 assert(unwrap(reference)->getBlock() == unwrap(block) &&
896 cppBlock->getOperations().insertAfter(Block::iterator(unwrap(reference)),
897 unwrap(operation));
906 assert(unwrap(reference)->getBlock() == unwrap(block) &&
908 unwrap(block)->getOperations().insert(Block::iterator(unwrap(reference)),
909 unwrap(operation));
912 void mlirBlockDestroy(MlirBlock block) { delete unwrap(block); }
915 Block *b = unwrap(block);
920 return static_cast<intptr_t>(unwrap(block)->getNumArguments());
925 return wrap(unwrap(block)->addArgument(unwrap(type), unwrap(loc)));
929 return unwrap(block)->eraseArgument(index);
934 return wrap(unwrap(block)->insertArgument(pos, unwrap(type), unwrap(loc)));
938 return wrap(unwrap(block)->getArgument(static_cast<unsigned>(pos)));
944 unwrap(block)->print(stream);
952 return unwrap(value1) == unwrap(value2);
956 return llvm::isa<BlockArgument>(unwrap(value));
960 return llvm::isa<OpResult>(unwrap(value));
964 return wrap(llvm::cast<BlockArgument>(unwrap(value)).getOwner());
969 llvm::cast<BlockArgument>(unwrap(value)).getArgNumber());
973 llvm::cast<BlockArgument>(unwrap(value)).setType(unwrap(type));
977 return wrap(llvm::cast<OpResult>(unwrap(value)).getOwner());
982 llvm::cast<OpResult>(unwrap(value)).getResultNumber());
986 return wrap(unwrap(value).getType());
990 unwrap(value).setType(unwrap(type));
993 void mlirValueDump(MlirValue value) { unwrap(value).dump(); }
998 unwrap(value).print(stream);
1004 Value cppValue = unwrap(value);
1005 cppValue.printAsOperand(stream, *unwrap(state));
1009 Value cppValue = unwrap(value);
1019 unwrap(oldValue).replaceAllUsesWith(unwrap(newValue));
1025 Value oldValueCpp = unwrap(oldValue);
1026 Value newValueCpp = unwrap(newValue);
1030 exceptionSet.insert(unwrap(exceptions[i]));
1043 return wrap(unwrap(opOperand)->getOwner());
1047 return wrap(unwrap(opOperand)->get());
1051 return unwrap(opOperand)->getOperandNumber();
1059 unwrap(opOperand)->getNextOperandUsingThisValue());
1072 return wrap(mlir::parseType(unwrap(type), unwrap(context)));
1076 return wrap(unwrap(type).getContext());
1080 return wrap(unwrap(type).getTypeID());
1084 return wrap(&unwrap(type).getDialect());
1088 return unwrap(t1) == unwrap(t2);
1093 unwrap(type).print(stream);
1096 void mlirTypeDump(MlirType type) { unwrap(type).dump(); }
1103 return wrap(mlir::parseAttribute(unwrap(attr), unwrap(context)));
1107 return wrap(unwrap(attribute).getContext());
1111 Attribute attr = unwrap(attribute);
1118 return wrap(unwrap(attr).getTypeID());
1122 return wrap(&unwrap(attr).getDialect());
1126 return unwrap(a1) == unwrap(a2);
1132 unwrap(attr).print(stream);
1135 void mlirAttributeDump(MlirAttribute attr) { unwrap(attr).dump(); }
1147 return wrap(StringAttr::get(unwrap(context), unwrap(str)));
1151 return wrap(unwrap(ident).getContext());
1155 return unwrap(ident) == unwrap(other);
1159 return wrap(unwrap(ident).strref());
1175 if (!unwrap(operation)->hasTrait<OpTrait::SymbolTable>())
1177 return wrap(new SymbolTable(unwrap(operation)));
1181 delete unwrap(symbolTable);
1186 return wrap(unwrap(symbolTable)->lookup(StringRef(name.data, name.length)));
1191 return wrap((Attribute)unwrap(symbolTable)->insert(unwrap(operation)));
1196 unwrap(symbolTable)->erase(unwrap(operation));
1202 auto *cppFrom = unwrap(from);
1204 auto oldSymbolAttr = StringAttr::get(context, unwrap(oldSymbol));
1205 auto newSymbolAttr = StringAttr::get(context, unwrap(newSymbol));
1207 unwrap(from)));
1214 SymbolTable::walkSymbolTables(unwrap(from), allSymUsesVisible,