10#if defined(GET_OP_CLASSES) || defined(GET_OP_FWD_DEFINES)
11#undef GET_OP_FWD_DEFINES
42 auto &propStorage = this->value;
43 return ::llvm::cast<::mlir::StringAttr>(propStorage);
45 void setValue(const ::mlir::StringAttr &propValue) {
46 this->value = propValue;
50 rhs.
value == this->value &&
54 return !(*
this == rhs);
77template <
typename RangeT>
79 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
86 template <
typename LateInst = LitStringOp,
typename = std::enable_if_t<std::is_same_v<LateInst, LitStringOp>>>
95 return {std::next(odsOperands.begin(), valueRange.first),
96 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
111 ::mlir::LogicalResult
verify(::mlir::Location loc);
113class LitStringOp :
public ::mlir::Op<LitStringOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::string::StringType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::ConstantLike> {
118 template <
typename RangeT>
123 static ::llvm::StringRef attrNames[] = {::llvm::StringRef(
"value")};
124 return ::llvm::ArrayRef(attrNames);
128 return getAttributeNameForIndex(0);
132 return getAttributeNameForIndex(
name, 0);
136 return ::llvm::StringLiteral(
"string.new");
142 ::mlir::Operation::result_range
getODSResults(
unsigned index);
143 ::mlir::TypedValue<::llzk::string::StringType>
getResult();
144 static ::mlir::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
150 static ::mlir::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
151 static ::mlir::LogicalResult
readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
156 void setValue(::llvm::StringRef attrValue);
157 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value);
158 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr value);
159 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llvm::StringRef value);
160 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef value);
161 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
165 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
166 void print(::mlir::OpAsmPrinter &_odsPrinter);
167 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
169 ::mlir::StringAttr getAttributeNameForIndex(
unsigned index) {
170 return getAttributeNameForIndex((*this)->getName(), index);
173 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName
name,
unsigned index) {
174 assert(index < 1 &&
"invalid attribute index");
176 assert(
name.isRegistered() &&
"Operation isn't registered, missing a "
177 "dependent dialect loading?");
178 return name.getAttributeNames()[index];
LitStringOpAdaptor(LitStringOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
LitStringOpGenericAdaptor(RangeT values, LateInst op)
::mlir::LogicalResult verifyInvariants()
LitStringOpGenericAdaptor< RangeT > GenericAdaptor
static llvm::hash_code computePropertiesHash(const Properties &prop)
void setValueAttr(::mlir::StringAttr attr)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value)
void print(::mlir::OpAsmPrinter &_odsPrinter)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::mlir::TypedValue<::llzk::string::StringType > getResult()
::mlir::LogicalResult verifyInvariantsImpl()
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
::mlir::StringAttr getValueAttr()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
LitStringOpAdaptor Adaptor
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
void setValue(::llvm::StringRef attrValue)
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::mlir::StringAttr getValueAttrName(::mlir::OperationName name)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::StringAttr getValueAttrName()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
FoldAdaptor::Properties Properties
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::StringRef getValue()
::mlir::DictionaryAttr odsAttrs
::llvm::StringRef getValue()
::mlir::DictionaryAttr getAttributes()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::StringAttr getValueAttr()
LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
::mlir::RegionRange odsRegions
const Properties & getProperties()
::mlir::StringAttr valueTy
void setValue(const ::mlir::StringAttr &propValue)
bool operator==(const Properties &rhs) const
bool operator!=(const Properties &rhs) const