33 auto &propStorage = this->path;
34 return ::llvm::cast<::mlir::StringAttr>(propStorage);
36 void setPath(const ::mlir::StringAttr &propValue) {
37 this->path = propValue;
43 auto &propStorage = this->sym_name;
44 return ::llvm::cast<::mlir::StringAttr>(propStorage);
47 this->sym_name = propValue;
51 rhs.
path == this->path &&
56 return !(*
this == rhs);
84 auto attr = ::llvm::cast<::mlir::StringAttr>(
getProperties().sym_name);
90 auto attr = ::llvm::cast<::mlir::StringAttr>(
getProperties().path);
97template <
typename RangeT>
99 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
110 template <
typename LateInst = IncludeOp,
typename = std::enable_if_t<std::is_same_v<LateInst, IncludeOp>>>
119 return {std::next(odsOperands.begin(), valueRange.first),
120 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
135 ::llvm::LogicalResult
verify(::mlir::Location loc);
137class IncludeOp :
public ::mlir::Op<IncludeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolOpInterface::Trait> {
142 template <
typename RangeT>
147 static ::llvm::StringRef attrNames[] = {::llvm::StringRef(
"path"), ::llvm::StringRef(
"sym_name")};
148 return ::llvm::ArrayRef(attrNames);
152 return getAttributeNameForIndex(0);
156 return getAttributeNameForIndex(
name, 0);
160 return getAttributeNameForIndex(1);
164 return getAttributeNameForIndex(
name, 1);
168 return ::llvm::StringLiteral(
"include.from");
177 return {std::next(getOperation()->operand_begin(), valueRange.first),
178 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
187 return {std::next(getOperation()->result_begin(), valueRange.first),
188 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
191 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
197 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
198 static ::llvm::LogicalResult
readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
201 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
206 return ::llvm::cast<::mlir::StringAttr>(getProperties().path);
211 getProperties().sym_name = attr;
216 getProperties().path = attr;
219 void setPath(::llvm::StringRef attrValue);
220 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
221 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
222 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::llvm::StringRef path);
223 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
224 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
227 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
228 void print(::mlir::OpAsmPrinter &_odsPrinter);
230 ::mlir::StringAttr getAttributeNameForIndex(
unsigned index) {
231 return getAttributeNameForIndex((*this)->getName(), index);
234 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName
name,
unsigned index) {
235 assert(index < 2 &&
"invalid attribute index");
237 assert(
name.isRegistered() &&
"Operation isn't registered, missing a "
238 "dependent dialect loading?");
239 return name.getAttributeNames()[index];
246 ::mlir::FailureOr<mlir::OwningOpRef<mlir::ModuleOp>>
openModule();
IncludeOpAdaptor(IncludeOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
IncludeOpGenericAdaptor(RangeT values, const IncludeOpGenericAdaptorBase &base)
RangeT getODSOperands(unsigned index)
IncludeOpGenericAdaptor(RangeT values, LateInst op)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path)
::mlir::StringAttr getPathAttrName()
void setPathAttr(::mlir::StringAttr attr)
::llvm::StringRef getSymName()
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
static constexpr ::llvm::StringLiteral getOperationName()
::llvm::LogicalResult verifyInvariantsImpl()
IncludeOpGenericAdaptor< RangeT > GenericAdaptor
::mlir::Operation::operand_range getODSOperands(unsigned index)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static llvm::hash_code computePropertiesHash(const Properties &prop)
FoldAdaptor::Properties Properties
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
void setSymName(::llvm::StringRef attrValue)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::StringRef getPath()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::StringAttr getPathAttr()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::StringAttr getSymNameAttrName()
static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path)
::llvm::LogicalResult verifyInvariants()
::mlir::FailureOr< mlir::OwningOpRef< mlir::ModuleOp > > openModule()
Opens the module this include references but doesn't insert it into the parent module.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
void setSymNameAttr(::mlir::StringAttr attr)
::mlir::Operation::result_range getODSResults(unsigned index)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::FailureOr< mlir::ModuleOp > inlineAndErase()
Opens the module this include references and replace this include with that module.
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::mlir::StringAttr getSymNameAttr()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
void setPath(::llvm::StringRef attrValue)
::mlir::StringAttr getPathAttrName(::mlir::OperationName name)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
const Properties & getProperties()
::llvm::StringRef getPath()
::mlir::StringAttr getPathAttr()
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr getAttributes()
::mlir::StringAttr getSymNameAttr()
::llvm::StringRef getSymName()
bool operator==(const Properties &rhs) const
void setPath(const ::mlir::StringAttr &propValue)
::mlir::StringAttr pathTy
::mlir::StringAttr sym_nameTy
void setSymName(const ::mlir::StringAttr &propValue)
bool operator!=(const Properties &rhs) const