33 auto &propStorage = this->value;
34 return ::llvm::cast<::mlir::StringAttr>(propStorage);
36 void setValue(const ::mlir::StringAttr &propValue) {
37 this->value = propValue;
41 rhs.
value == this->value &&
45 return !(*
this == rhs);
73 auto attr = ::llvm::cast<::mlir::StringAttr>(
getProperties().value);
80template <
typename RangeT>
82 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
93 template <
typename LateInst = LitStringOp,
typename = std::enable_if_t<std::is_same_v<LateInst, LitStringOp>>>
102 return {std::next(odsOperands.begin(), valueRange.first),
103 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
118 ::llvm::LogicalResult
verify(::mlir::Location loc);
120class 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> {
125 template <
typename RangeT>
130 static ::llvm::StringRef attrNames[] = {::llvm::StringRef(
"value")};
131 return ::llvm::ArrayRef(attrNames);
135 return getAttributeNameForIndex(0);
139 return getAttributeNameForIndex(
name, 0);
143 return ::llvm::StringLiteral(
"string.new");
152 return {std::next(getOperation()->operand_begin(), valueRange.first),
153 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
162 return {std::next(getOperation()->result_begin(), valueRange.first),
163 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
166 ::mlir::TypedValue<::llzk::string::StringType>
getResult() {
167 return ::llvm::cast<::mlir::TypedValue<::llzk::string::StringType>>(*
getODSResults(0).begin());
170 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
176 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
177 static ::llvm::LogicalResult
readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
180 return ::llvm::cast<::mlir::StringAttr>(getProperties().value);
185 getProperties().value = attr;
188 void setValue(::llvm::StringRef attrValue);
189 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value);
190 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr value);
191 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llvm::StringRef value);
192 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef value);
193 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
197 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
198 void print(::mlir::OpAsmPrinter &_odsPrinter);
199 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
201 ::mlir::StringAttr getAttributeNameForIndex(
unsigned index) {
202 return getAttributeNameForIndex((*this)->getName(), index);
205 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName
name,
unsigned index) {
206 assert(index < 1 &&
"invalid attribute index");
208 assert(
name.isRegistered() &&
"Operation isn't registered, missing a "
209 "dependent dialect loading?");
210 return name.getAttributeNames()[index];
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
LitStringOpAdaptor(LitStringOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
LitStringOpGenericAdaptor(RangeT values, const LitStringOpGenericAdaptorBase &base)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
LitStringOpGenericAdaptor(RangeT values, LateInst op)
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)
::llvm::LogicalResult verifyInvariantsImpl()
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::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)
::mlir::Operation::result_range getODSResults(unsigned index)
LitStringOpAdaptor Adaptor
::mlir::StringAttr getValueAttr()
static constexpr ::llvm::StringLiteral getOperationName()
void setValue(::llvm::StringRef attrValue)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::LogicalResult verifyInvariants()
::mlir::TypedValue<::llzk::string::StringType > getResult()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::StringAttr getValueAttrName(::mlir::OperationName name)
::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
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::StringRef getValue()
::mlir::DictionaryAttr odsAttrs
::mlir::StringAttr getValueAttr()
::llvm::StringRef getValue()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::std::optional<::mlir::OperationName > odsOpName
LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr getAttributes()
const Properties & getProperties()
::mlir::StringAttr valueTy
void setValue(const ::mlir::StringAttr &propValue)
bool operator==(const Properties &rhs) const
bool operator!=(const Properties &rhs) const